diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4d0a2dce475df9a8657dd8a325375dcad0b41ea9..d3d7bad2b5e23c91fa3eef3f3ecb5b3e5610328f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,18 +1,54 @@ +# This file creates automated tests on GitLab CI for Purr Data. +# See https://docs.gitlab.com/ee/ci/yaml/README.html for details of the format. + +# These are script snippets used in the jobs defined below. +.debian_image_preparation: &debian_image_preparation + - echo "" | sudo -S apt-get -qq purge -y pd-l2ork > /dev/null || echo "couldn't purge..." + - echo "" | sudo -S DEBIAN_FRONTEND=noninteractive apt-get -qq -y update > /dev/null + - echo "" | sudo -S DEBIAN_FRONTEND=noninteractive apt-get -qq -y upgrade > /dev/null + +.build_all: &build_all + - echo -e "section_start:`date +%s`:build_all\r\e[0KBuilding Purr Data" + - cd l2ork_addons + - export V=0 + - ./tar_em_up.sh $BUILD_TYPE_FLAG + - cd .. + - echo -e "section_end:`date +%s`:build_all\r\e[0K" + +.test_linux: &test_linux + - echo -e "section_start:`date +%s`:test_linux\r\e[0KTesting Purr Data for Linux" + - echo "" | sudo -S DEBIAN_FRONTEND=noninteractive dpkg --force-all -i pd-l2ork*.deb > /dev/null + - valgrind pd-l2ork -noprefs -nogui -nrt -noaudio -send "init dollarzero \$0" scripts/regression_tests.pd + - valgrind pd-l2ork -noprefs -nostdpath -nogui -nrt -noaudio scripts/external-tests.pd + - echo -e "section_end:`date +%s`:text_linux\r\e[0K" + +.test_osx: &test_osx + - echo -e "section_start:`date +%s`:test_osx\r\e[0KTesting Purr Data for Mac OSX" + - cd scripts + - ../packages/darwin_app/build/*.app/Contents/Resources/app.nw/bin/pd-l2ork -noprefs -nogui -noaudio -send "init dollarzero \$0" regression_tests.pd + - ../packages/darwin_app/build/*.app/Contents/Resources/app.nw/bin/pd-l2ork -noprefs -nostdpath -nogui -noaudio external-tests.pd + - echo -e "section_end:`date +%s`:text_osx\r\e[0K" + +.test_windows: &test_windows + - echo -e "section_start:`date +%s`:test_windows\r\e[0KTesting Purr Data for Windows" + - cd scripts + - ../packages/win32_inno/build/bin/pd.com -noprefs -nogui -noaudio -send "init dollarzero \$0" regression_tests.pd + - ../packages/win32_inno/build/bin/pd.com -noprefs -nostdpath -nogui -noaudio external-tests.pd + - echo -e "section_end:`date +%s`:text_windows\r\e[0K" + + debian_stretch_x86_64_deb: tags: - debian - stretch - x86_64 + variables: + BUILD_TYPE_FLAG: -B + before_script: + - *debian_image_preparation script: - - echo "" | sudo -S apt-get -qq purge -y pd-l2ork > /dev/null || echo "couldn't purge..." - - echo "" | sudo -S DEBIAN_FRONTEND=noninteractive apt-get -qq -y update > /dev/null - - echo "" | sudo -S DEBIAN_FRONTEND=noninteractive apt-get -qq -y upgrade > /dev/null - - cd l2ork_addons - - ./tar_em_up.sh -B - - cd .. - - echo "" | sudo -S DEBIAN_FRONTEND=noninteractive dpkg --force-all -i pd-l2ork*.deb > /dev/null - - valgrind pd-l2ork -noprefs -nogui -nrt -noaudio -send "init dollarzero \$0" scripts/regression_tests.pd - - valgrind pd-l2ork -noprefs -nostdpath -nogui -nrt -noaudio scripts/external-tests.pd + - *build_all + - *test_linux artifacts: name: "$CI_RUNNER_DESCRIPTION" expire_in: 1 day @@ -24,17 +60,13 @@ ubuntu_16.04_x86_64_deb: - ubuntu - v16.04 - x86_64 + variables: + BUILD_TYPE_FLAG: -B + before_script: + - *debian_image_preparation script: - - echo "" | sudo -S apt-get -qq purge -y pd-l2ork > /dev/null || echo "couldn't purge..." - - echo "" | sudo -S DEBIAN_FRONTEND=noninteractive apt-get -qq -y update > /dev/null - - echo "" | sudo -S DEBIAN_FRONTEND=noninteractive apt-get -qq -y upgrade > /dev/null - - cd l2ork_addons - - ./tar_em_up.sh -B - - cd .. - - echo "" | sudo -S DEBIAN_FRONTEND=noninteractive dpkg --force-all -i pd-l2ork*.deb > /dev/null - - cd scripts - - valgrind pd-l2ork -noprefs -nogui -nrt -noaudio -send "init dollarzero \$0" regression_tests.pd - - valgrind pd-l2ork -noprefs -nostdpath -nogui -nrt -noaudio external-tests.pd + - *build_all + - *test_linux artifacts: name: "$CI_RUNNER_DESCRIPTION" expire_in: 1 day @@ -46,13 +78,12 @@ osx_10.11_x86_64_dmg: - osx - v10.11 - dmg + variables: + BUILD_TYPE_FLAG: -X script: - echo `pwd` - - cd l2ork_addons - - ./tar_em_up.sh -X - - cd ../scripts - - ../packages/darwin_app/build/*.app/Contents/Resources/app.nw/bin/pd-l2ork -noprefs -nogui -noaudio -send "init dollarzero \$0" regression_tests.pd - - ../packages/darwin_app/build/*.app/Contents/Resources/app.nw/bin/pd-l2ork -noprefs -nostdpath -nogui -noaudio external-tests.pd + - *build_all + - *test_osx artifacts: name: "$CI_RUNNER_DESCRIPTION" expire_in: 1 day @@ -64,13 +95,13 @@ osx_10.8_x86_64_dmg: - osx - v10.8 - dmg + variables: + BUILD_TYPE_FLAG: -X + osx_version: "10.8" script: - echo `pwd` - - cd l2ork_addons - - osx_version=10.8 ./tar_em_up.sh -X - - cd ../scripts - - ../packages/darwin_app/build/*.app/Contents/Resources/app.nw/bin/pd-l2ork -noprefs -nogui -noaudio -send "init dollarzero \$0" regression_tests.pd - - ../packages/darwin_app/build/*.app/Contents/Resources/app.nw/bin/pd-l2ork -noprefs -nostdpath -nogui -noaudio external-tests.pd + - *build_all + - *test_osx artifacts: name: "$CI_RUNNER_DESCRIPTION" expire_in: 1 day @@ -81,13 +112,12 @@ windows_i386_innosetup: tags: - windows - i386 + variables: + BUILD_TYPE_FLAG: -Z script: - echo `pwd` - - cd l2ork_addons - - ./tar_em_up.sh -Z - - cd ../scripts - - ../packages/win32_inno/build/bin/pd.com -noprefs -nogui -noaudio -send "init dollarzero \$0" regression_tests.pd - - ../packages/win32_inno/build/bin/pd.com -noprefs -nostdpath -nogui -noaudio external-tests.pd + - *build_all + - *test_windows artifacts: name: "$CI_RUNNER_DESCRIPTION" expire_in: 1 day @@ -99,17 +129,14 @@ raspbian_stretch_armv7l_deb: - raspbian - arm - stretch + variables: + BUILD_TYPE_FLAG: -r + before_script: + - *debian_image_preparation script: - - echo "" | sudo -S apt-get -qq purge -y pd-l2ork > /dev/null || echo "couldn't purge..." - - echo "" | sudo -S DEBIAN_FRONTEND=noninteractive apt-get -qq -y update > /dev/null - - echo "" | sudo -S DEBIAN_FRONTEND=noninteractive apt-get -qq -y upgrade > /dev/null - echo `pwd` - - cd l2ork_addons - - ./tar_em_up.sh -r - - cd .. - - echo "" | sudo -S DEBIAN_FRONTEND=noninteractive dpkg --force-all -i pd-l2ork*.deb > /dev/null - - valgrind pd-l2ork -noprefs -nogui -nrt -noaudio -send "init dollarzero \$0" scripts/regression_tests.pd - - valgrind pd-l2ork -noprefs -nostdpath -nogui -nrt -noaudio scripts/external-tests.pd + - *build_all + - *test_linux artifacts: name: "$CI_RUNNER_DESCRIPTION" expire_in: 1 day diff --git a/Makefile b/Makefile index 447878688186aaa6e20a719e41386c70b45c491a..5f7ddd3ee3fce10fdc3a29c9c11f237176cd1f28 100644 --- a/Makefile +++ b/Makefile @@ -85,8 +85,8 @@ export macos_target = 10.9 # Installation prefix under which Pd-l2ork is installed (Linux only). If this # isn't set, a default location will be used (usually /usr/local). NOTE: We -# *always* assume that this variable is set properly in the install targets -# (see below). +# *always* assume that this variable is set properly in the install targets, +# as well as the (Linux) check target (see below). prefix = /usr ifneq ($(prefix),) @@ -157,6 +157,40 @@ realclean: git checkout . git clean -dffx -e pd/nw/nw/ +# Check targets. These run the regression tests in scripts. +# Requires a full build. + +os = $(shell uname|sed 's/^\(MINGW[0-9]*\)_NT.*/\1/') + +ifeq ($(os),Linux) +# Linux (all flavors) +pdprog = packages/linux_make/build$(prefix)/bin/pd-l2ork +else ifeq ($(os),Darwin) +# Mac +pdprog = packages/darwin_app/build/*.app/Contents/Resources/app.nw/bin/pd-l2ork +else ifeq ($(os),MINGW64) +# Msys2 mingw64 +pdprog = packages/win64_inno/build/bin/pd.exe +else ifeq ($(os),MINGW32) +# Msys2 mingw32 +pdprog = packages/win32_inno/build/bin/pd.exe +endif + +ifneq ($(pdprog),) +# This runs just a quick regression test, useful to see whether the program +# works at all. +check1: + $(pdprog) -noprefs -nogui -noaudio -send 'init dollarzero $$0' scripts/regression_tests.pd + +# This runs the full test suite, including the test of the externals. +check: + $(pdprog) -noprefs -nogui -noaudio -send 'init dollarzero $$0' scripts/regression_tests.pd + $(pdprog) -noprefs -nostdpath -nogui -noaudio scripts/external-tests.pd +else +check1 check: + @echo "Target $(os) not recognized, can't run 'make $@'!"; false +endif + # Installation targets. These don't work on Mac and Windows right now, you # should use the generated installers on these systems instead. Also, # $(prefix) must be set. $(DESTDIR) is supported as well, so you can do staged diff --git a/README.md b/README.md index b8c536380c1d29b784dd812207e4c5f4b0f039e5..1490530c71c83319f05695755716d8809e521868 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ maintainers: * [OSX](#osx-64-bit-using-homebrew) * [Windows](#windows-32-bit-using-msys2) * [Code of Conduct](#code-of-conduct) +* [Project Governance](#project-governance) * [Contributor Guide](#contributor-guide) * [Human Interface Guidelines](#human-interface-guidelines) * [Core Pd Notes](#core-pd-notes) @@ -63,16 +64,22 @@ Pd-L2ork has the following goals: documentation. We like documentation, so it follows that we like consistent interfaces. -### User Guide +### User Guide and Weblinks For a more in-depth look at Purr Data for new users and developers, see: -[https://agraef.github.io/purr-data-intro/Purr-Data-Intro.html](https://agraef.github.io/purr-data-intro/Purr-Data-Intro.html) +<https://agraef.github.io/purr-data-intro/Purr-Data-Intro.html> For more resources see: -[https://agraef.github.io/purr-data/](https://agraef.github.io/purr-data/) +<https://agraef.github.io/purr-data/> +For Ico Bukvic's original Pd-l2ork website see: + +<http://l2ork.music.vt.edu/main/make-your-own-l2ork/software/> + +(Note that the latter link is more about "classic" Pd-L2Ork a.k.a. Pd-L2Ork 1.0, see below. But it also contains some information about Purr Data.) + ### Relationship of Purr Data to Pure Data There are three maintained distributions of Pure Data: @@ -81,7 +88,7 @@ There are three maintained distributions of Pure Data: external libraries and uses a modern GUI written using HTML5. 2. Pd-L2Ork 1.0, the version used by Ivica Bukvic for his laptop orchestra. Pd-l2ork 1.0 uses tcl/tk (and tkpath) for the GUI. You can find it - [here](http://l2ork.music.vt.edu/main/make-your-own-l2ork/software/) + [here](http://l2ork.music.vt.edu/main/make-your-own-l2ork/software/). 3. Pure Data "Vanilla". Miller Puckette's personal version which he hosts on his website and maintains. It doesn't come with external libraries pre-installed, but it does include an interface you can use to search @@ -89,156 +96,36 @@ There are three maintained distributions of Pure Data: ### Downloads -Packages for Windows and OSX: - -[https://github.com/jonwwilkes/purr-data/releases](https://github.com/jonwwilkes/purr-data/releases) - -Gnu/Linux installation instructions: - -* [Arch](#arch) - -* [Debian 9, 10, and testing](#debian) - -* [Raspbian 9, and 10](#raspbian) - -* [Ubuntu 16.04, 18.04, 19.04, and 19.10](#ubuntu) - -* [openSUSE](#opensuse) - -### Installation Guide - -#### Arch - -All of this needs to be done as root, using either `sudo` or `su`. - -The following goes into /etc/pacman.conf: - -~~~ -[home_aggraef_Arch] -SigLevel = Never -Server = https://download.opensuse.org/repositories/home:aggraef/Arch/$arch -~~~ - -Then just run: - -~~~ -pacman -Sy -pacman -S purr-data -~~~ - -#### Debian - -All of this needs to be done as root, using either `sudo` or `su`. Use "Debian_9.0" instead if you're running Debian Stretch rather than Buster; likewise if you're running Unstable or Testing. - -You should import the repository key first, so that the packages can be updated automatically (this only needs to be done once): - -~~~ -wget -nv https://download.opensuse.org/repositories/home:aggraef/Debian_10/Release.key -apt-key add Release.key -~~~ - -Then add the repository to your apt sources as follows (taking Debian 10 as an example): - -~~~ -echo 'deb http://download.opensuse.org/repositories/home:/aggraef/Debian_10/ /' > /etc/apt/sources.list.d/home:aggraef.list -apt update -~~~ - -**NOTE:** This creates the source in a separate file /etc/apt/sources.list.d/home:aggraef.list. You can just remove this file when you don't need the repository any more. - -Finally install the package: - -~~~ -apt install purr-data -~~~ - -#### Raspbian - -All of this needs to be done as root, using either `sudo` or `su`. Use "Raspbian_9.0" instead if you're running Raspbian Stretch rather than Buster. +**Windows and OSX:** -~~~ -sudo su -~~~ +Releases are done on GitHub: -You should import the repository key first, so that the packages can be updated automatically (this only needs to be done once): +<https://github.com/jonwwilkes/purr-data/releases> -~~~ -wget -nv https://download.opensuse.org/repositories/home:aggraef/Raspbian_10/Release.key -apt-key add Release.key -~~~ +This is where the packages first come out as soon as Jonathan Wilkes releases them. The same packages can also be dowloaded (usually shortly after release) on Albert Gräf's mirror, which also provides a website, wiki, additional documentation, and an up-to-date mirror of the source code repository: -Then add the repository to your apt sources as follows: +<https://github.com/agraef/purr-data/releases> -~~~ -echo 'deb http://download.opensuse.org/repositories/home:/aggraef/Raspbian_10/ /' > /etc/apt/sources.list.d/home:aggraef.list -apt update -~~~ +**Linux:** -Finally install the package: +Packages for various Linux distributions (including Arch, Debian, Ubuntu, and openSUSE) are available through the JGU package repositories maintained by Albert Gräf on the OBS (Open Build System). Detailed instructions can be found [here](https://github.com/agraef/purr-data/wiki/Installation#linux). -~~~ -apt install purr-data -~~~ - -#### Ubuntu - -All of this needs to be done as root, using either `sudo` or `su`. Replace "18.04" with the version of Ubuntu you use. - -~~~ -sudo su -~~~ - -You should import the repository key first, so that the packages can be updated automatically (this only needs to be done once): - -~~~ -wget -nv https://download.opensuse.org/repositories/home:aggraef/xUbuntu_18.04/Release.key -apt-key add Release.key -~~~ - -Then add the repository to your apt sources as follows: - -~~~ -echo 'deb http://download.opensuse.org/repositories/home:/aggraef/xUbuntu_18.04/ /' > /etc/apt/sources.list.d/home:aggraef.list -apt update -~~~ - -Finally install the package: - -~~~ -apt install purr-data -~~~ - -#### openSUSE - -**NOTE:** The openSUSE builds are somewhat experimental right now. In particular, the flite external is not supported, because the required dependencies are not available. Also note that some of the multimedia functionality (Gem video, in particular) will require proprietary media codecs and thus won't work in stock openSUSE. You will need to add third-party repositories like [Packman](https://en.opensuse.org/Additional_package_repositories#Packman) to make these work. - -We take Tumbleweed as an example here, if you're running Leap then replace "Tumbleweed" with "Leap_15.1" or whatever version you use. - -~~~ -sudo su - -zypper addrepo https://download.opensuse.org/repositories/home:aggraef/openSUSE_Tumbleweed/home:aggraef.repo -zypper refresh -zypper install purr-data -~~~ +You can also just go to the [OBS Download](https://software.opensuse.org/download/package?package=purr-data&project=home%3Aaggraef), pick your Linux system, and follow the instructions. ### Build Guide -**NOTE:** The instructions for Windows and OSX below talk about running the `tar_em_up.sh` build -script, which is still the recommended way to build Purr Data right now. -However, Purr Data also has a new (and experimental) toplevel Makefile so that -just typing `make` will build the package. You may find this easier. The -Makefile also offers the customary targets to clean (`make clean`, or -`make realclean` to put the sources in pristine state again) and to roll a -self-contained distribution tarball (`make dist`). Please check the comments -at the beginning of the Makefile for more information. +Purr Data is usually built by just running `make` in the toplevel source directory after checking out the sources from its git repository. This works across all supported platforms (Linux, Mac and Windows at this time). The Makefile also offers the customary targets to clean (`make clean`, or `make realclean` to put the sources in pristine state again) and to roll a self-contained distribution tarball (`make dist`), as well as some other convenience targets (please check the comments at the beginning of the Makefile for more information). + +However, to make this work, you will most likely have to install some prerequisites first: *build tools* such as a C/C++ compiler and the make program itself, as well as *dependencies*, the libraries that Purr Data needs. Detailed instructions for each of the supported platforms are given below. #### Linux Time to build: *10 minutes light install, 45 minutes to 1.5 hours full install* Hard drive space required: *roughly 2.5 GB* -1. Install the dependencies +1. Install the dependencies (please note that the packages may be named + slightly differently for different Linux distributions; the given names are + for Debian/Ubuntu) sudo apt-get install bison flex automake libasound2-dev \ libjack-jackd2-dev libtool libbluetooth-dev libgl1-mesa-dev \ @@ -261,26 +148,17 @@ Hard drive space required: *roughly 2.5 GB* git clone https://git.purrdata.net/jwilkes/purr-data.git -4. Compile the code *(5 minutes to 1.5 hours)* full +4. Compile the code *(5 minutes [light] to 1.5 hours [full])* * to build only the core: `make light` *(5 minutes)* - * to build core and all externals: `make all` *(20 minutes to 1.5 hours)* + * to build the core and all externals: `make all` *(20 minutes to 1.5 hours)* * to build everything *except* Gem: `make incremental` *(10 to 20 minutes)* -5. There should now be an installer file in the main directory of the repo. - If you're using an apt-based Linux distribution it will be an apt package. - Otherwise, it will be a tarball which you can unzip, enter, and run - `make install` (as well as `make uninstall` to remove it). - -To install using a pre-compiled binary, follow these instructions: -http://l2ork.music.vt.edu/main/?page_id=56 - -To set up a development environment, first make sure you have the following -package dependencies listed here: -http://l2ork.music.vt.edu/main/?page_id=56 - -Then follow the steps outlined here: -http://l2ork.music.vt.edu/main/?page_id=56#install-dev +5. If you're using an apt-based Linux distribution and you have the necessary + Debian packaging tools installed, there should now be an installer file in + the main source directory, which can be installed as usual. Otherwise, run + `make install` to install the software, and `make uninstall` to remove it + again. #### OSX 64-bit using Homebrew @@ -311,45 +189,42 @@ Hard drive space required: *roughly 2 GB* git clone https://git.purrdata.net/jwilkes/purr-data.git -4. Change to the directory - - cd purr-data/l2ork_addons - -5. Run the installer *(15 minutes)* +4. Change to the source directory - ./tar_em_up.sh -X + cd purr-data -6. When the installer finishes, type +5. Build the OSX app and the installer disk image (.dmg file) *(15 minutes)* - cd .. + make -7. There should now be a .dmg file in your current directory +6. There should now be a .dmg file in your current directory, which lets you install the app in the usual way #### Windows 32-bit Using msys2 Time to build: *roughly 1.5 hours-- 30 minutes of this is for Gem alone* Hard drive space required to build: *rougly 2.5 GB* -Important note: check the name of your Windows user account. If it has a space -in it-- like "My Home Computer" or "2nd Laptop", then **stop**. You may not -use this guide. (Actually you can probably just install everything in ~/.. in -that case, but I haven't tested doing it like that. Sorry. Get a better OS...) +**Important note:** We recommend doing the build under your msys2 home +directory (usually /home/username in the msys2 shell). This directory should +not have any spaces in it, which would otherwise cause trouble during the +build. Never try using your Windows home directory for this purpose instead, +since it will usually contain spaces, making the build fail. 1. Download and install [msys2](https://msys2.github.io/) *(5 minutes)* - There are two installers-- one for 32-bit Windows systems (i386) and one for - 64-bit Windows (x_64). Be sure you know which - [version](http://windows.microsoft.com/en-us/windows/32-bit-and-64-bit-windows#1TC=windows-7) + There are two installers-- one for 32-bit Windows systems (i686) and one for + 64-bit Windows (x86_64). Be sure you know which + [version](http://windows.microsoft.com/en-us/windows/32-bit-and-64-bit-windows) of Windows you are running and download the appropriate installer. - Note: don't run it after it installs. You'll open it manually in the next - step. + Note: don't run the shell after installation finishes. You'll do that + manually in step 3. -2. Download and install [inno setup](http://www.jrsoftware.org/isdl.php) *(5 minutes)* +2. Download and install the [inno setup Quickstart Pack](http://www.jrsoftware.org/isdl.php) which includes the Script Editor *(5 minutes)* -3. Run MinGW-w64 Win32 Shell *(less than a minute)* +3. Run the "MSYS2 MinGW 32-bit" shell *(less than a minute)* msys2 adds three Start Menu items for different "flavors" of shell: - + MinGW-w64 __Win32__ Shell <- click this one! - + MinGW-w64 Win64 Shell - + MSYS Shell + + MSYS2 MinGW __32-bit__ <- click this one! + + MSYS2 MinGW 64-bit + + MSYS2 MSYS 4. Install the dependencies *(5-10 minutes)* Once the shell opens, we need to install the dependencies for building @@ -367,11 +242,13 @@ that case, but I haven't tested doing it like that. Sorry. Get a better OS...) pacman -S autoconf automake git libtool \ make mingw-w64-i686-dlfcn mingw-w64-i686-fftw \ mingw-w64-i686-fluidsynth \ + mingw-w64-i686-SDL2 \ mingw-w64-i686-ftgl mingw-w64-i686-fribidi \ mingw-w64-i686-ladspa-sdk mingw-w64-i686-lame \ mingw-w64-i686-libsndfile mingw-w64-i686-libvorbis \ mingw-w64-i686-lua mingw-w64-i686-toolchain \ mingw-w64-i686-libjpeg-turbo \ + mingw-w64-i686-speex \ rsync unzip wget 5. Download the source code *(3-6 minutes)* @@ -380,16 +257,24 @@ that case, but I haven't tested doing it like that. Sorry. Get a better OS...) git clone https://git.purrdata.net/jwilkes/purr-data.git -6. Enter the purr-data/l2ork_addons directory *(less than a minute)* +6. Enter the source directory *(less than a minute)* - cd purr-data/l2ork_addons + cd purr-data 7. Finally, build Purr-Data *(45-80 minutes)* - ./tar_em_up.sh -Z + make -8. Look in the top level directory of the Git repository and click the setup file to - start installing Purr Data to your machine. +8. Look in the top level source directory and double-click the setup file to + start installing Purr Data on your system. + +#### Windows 64-bit Using msys2 + +The instructions are exactly the same as for the 32 bit build (see above), but the build needs to be done using mingw64 instead of mingw32. That is: + +- Install the mingw64 packages for the dependencies. See the i686 packages listed under dependencies above, and replace i686 with x86_64 in the package names when installing. + +- Use the MSYS2 MinGW 64-bit shell (rather than the 32-bit shell) to do the build. ### Code of Conduct @@ -406,6 +291,16 @@ that case, but I haven't tested doing it like that. Sorry. Get a better OS...) It is a bad idea to break this Code of Conduct *even if* no one complains about your behavior. +### Project Governance + +* the three maintainers listed at the top of this document are the ones in + charge of this project +* unanimous decisions are preferred +* 2 out of 3 can break a disagreement +* there will only ever be three maintainers of this project at any given time. + If you'd like to temporarily step in as one of the three, + send an inquiry to the list and we cany discuss it + ### Contributor Guide Contributing is easy: diff --git a/debuild/Makefile b/debuild/Makefile index ce66c9885ef0b69a193dfda1651da82e8201fd0b..3895b7d3643579cbf874f2645950f3cbe70046d2 100644 --- a/debuild/Makefile +++ b/debuild/Makefile @@ -44,9 +44,9 @@ debdist = purr-data-$(debversion) # nw.js sdk # NOTE: arm packages need some special-casing, since they are released # separately, and the version numbers do not always match up. -nwjsver = 0.24.4 +nwjsver = 0.28.1 nwjspkg = nwjs-sdk-v$(nwjsver)-linux -nwjsver_arm = 0.24.5 +nwjsver_arm = 0.27.6 nwjspkg_arm = nwjs-sdk-v$(nwjsver_arm)-linux nwjs = $(nwjspkg)-ia32.tar.gz $(nwjspkg)-x64.tar.gz $(nwjspkg_arm)-arm.tar.gz diff --git a/debuild/debian/control b/debuild/debian/control index e9c633f77deb69711e82fa2fb72aa83c4a0a32d7..c4563d759a3991640c523e918049b1f7b18bc394 100644 --- a/debuild/debian/control +++ b/debuild/debian/control @@ -2,13 +2,13 @@ Source: purr-data Section: sound Priority: extra Maintainer: Albert Graef <aggraef@gmail.com> -Build-Depends: debhelper (>= 7.0.50~), autoconf, automake, libtool, pkg-config, bison, flex, libgtk2.0-dev, libgtk-3-dev, python-dev, dh-python | python-support, flite1-dev, ladspa-sdk, libasound2-dev, libjack-dev, libbluetooth-dev, libcairo2-dev, libgl1-mesa-dev | libgl-dev, libglew1.6-dev | libglew-dev, libgsl-dev | libgsl0-dev, libmagick++-dev, libavifile-0.7-dev, libdc1394-22-dev, libfftw3-dev, libfluidsynth-dev, libftgl-dev, libgmerlin-avdec-dev, libgsm1-dev, libjpeg-dev, liblua5.3-dev | liblua5.2-dev, libmp3lame-dev, libmpeg3-dev, libquicktime-dev, libraw1394-dev, libsmpeg-dev, libspeex-dev, libstk0-dev, libtiff5-dev, libv4l-dev, libdv4-dev, libiec61883-dev, libxv-dev, libxxf86vm-dev, libvorbis-dev, zlib1g-dev (>= 1:1.1.3), rsync, libgconf2-dev, libnss3-dev, libxtst-dev, libxss-dev +Build-Depends: debhelper (>= 7.0.50~), autoconf, automake, libtool, pkg-config, bison, flex, libgtk2.0-dev, libgtk-3-dev, python2-dev | python-dev, dh-python, flite1-dev, ladspa-sdk, libasound2-dev, libjack-dev, libbluetooth-dev, libcairo2-dev, libgl1-mesa-dev | libgl-dev, libglew1.6-dev | libglew-dev, libgsl-dev | libgsl0-dev, libmagick++-dev, libavifile-0.7-dev, libdc1394-22-dev, libfftw3-dev, libfluidsynth-dev, libftgl-dev, libgmerlin-avdec-dev, libgsm1-dev, libjpeg-dev, liblua5.3-dev | liblua5.2-dev, libmp3lame-dev, libmpeg3-dev, libquicktime-dev, libraw1394-dev, libsmpeg-dev, libspeex-dev, libstk0-dev, libtiff5-dev, libv4l-dev, libdv4-dev, libiec61883-dev, libxv-dev, libxxf86vm-dev, libvorbis-dev, zlib1g-dev (>= 1:1.1.3), rsync, libgconf2-dev, libnss3-dev, libxtst-dev, libxss-dev Standards-Version: 3.9.5 Homepage: https://git.purrdata.net/jwilkes/purr-data Package: purr-data Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} +Depends: ${shlibs:Depends}, ${misc:Depends}, liblua5.3-0 | liblua5.2-0 Recommends: xdg-utils, pulseaudio-utils, tap-plugins, ladspa-foo-plugins, invada-studio-plugins-ladspa, blepvco, swh-plugins, mcp-plugins, cmt, blop, omins, ubuntustudio-audio-plugins, rev-plugins, dssi-utils, vco-plugins, wah-plugins, fil-plugins, mda-lv2 Suggests: python, fluid-soundfont-gm Description: Interactive multimedia programming environment (NW.js variant) diff --git a/debuild/debian/rules b/debuild/debian/rules index d2d9358221a6996a0a603d6d95437e7ab4384cdb..915afeffa527d8c162dffe56affdf4d068ad8e62 100755 --- a/debuild/debian/rules +++ b/debuild/debian/rules @@ -4,12 +4,12 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -nwjsver = 0.24.4 +nwjsver = 0.28.1 nwjspkg = nwjs-sdk-v$(nwjsver)-linux ifeq ("$(shell dpkg-architecture -qDEB_HOST_ARCH)","armhf") arch = arm -nwjsver = 0.24.5 +nwjsver = 0.27.6 else ifeq ("$(shell dpkg-architecture -qDEB_HOST_ARCH)","amd64") arch = x64 else @@ -30,10 +30,16 @@ override_dh_auto_configure: override_dh_auto_clean: +# This runs too late, 'make check' then fails, probably due to our meddling +# with the directory layout, executable names, etc., during 'make install'. +# Instead we invoke 'make check' right after the build, see below. +override_dh_auto_test: + override_dh_auto_build: # Copy the nw.js sources to where purr-data wants them. tar -xf debian/nwjs/$(nwjspkg)-$(arch).tar.gz && rm -rf pd/nw/nw && mv $(nwjspkg)-$(arch) pd/nw/nw - cd l2ork_addons && (export inst_dir=$(prefix); ./tar_em_up.sh -B -n) + cd l2ork_addons && (export V=0 inst_dir=$(prefix); ./tar_em_up.sh -Bn) + make check prefix=$(prefix) override_dh_auto_install: mkdir -p debian/purr-data && mv packages/linux_make/build/* debian/purr-data diff --git a/externals/Makefile b/externals/Makefile index 3ed6d201d23583c5b6f9f2ebf4da55a4a06f5009..7f44b593076c0f710556f92b85819a1dc525d607 100644 --- a/externals/Makefile +++ b/externals/Makefile @@ -48,7 +48,7 @@ DEST_PATHS = BUILDLAYOUT_DIR=$(BUILDLAYOUT_DIR) \ BUILDSRC_OS_NAME = $(OS_NAME) WARN_FLAGS = -Wall -W -Wno-unused-parameter -CFLAGS = -DPD -I$(pd_src)/src $(WARN_FLAGS) $(DEBUG_CFLAGS) $(CFLAGS_ADD) -I$(gem_src)/src +CFLAGS = -DPD -D__USE_MINGW_ANSI_STDIO=1 -I$(pd_src)/src $(WARN_FLAGS) $(DEBUG_CFLAGS) $(CFLAGS_ADD) -I$(gem_src)/src LDFLAGS = LIBS = -lm @@ -139,7 +139,7 @@ ifeq ($(LIGHT),yes) lib_targets = loaders-libdir pddp INCREMENTAL = yes else -lib_targets = adaptive arraysize autotune bassemu boids bsaylor comport creb cxc cyclone disis earplug ekext ext13 fftease flatgui fluid freeverb ggee hcs iem_ambi iem_bin_ambi iemlib iemgui iemguts iem_adaptfilt iemmatrix iemxmlrpc iem_delay iem_roomsim iem_spec2 iem_tab jasch_lib loaders-libdir lyonpotpourri mapping markex maxlib mjlib moocow moonlib motex mrpeach oscx pan pdcontainer pddp pdlua pdogg plugin pmpd rjlib sigpack smlib tof unauthorized vbap windowing zexy +lib_targets = adaptive arraysize autotune bassemu bendinfix boids bsaylor comport creb cxc cyclone disis earplug ekext ext13 fftease flatgui fluid freeverb ggee hcs iem_ambi iem_bin_ambi iemlib iemgui iemguts iem_adaptfilt iemmatrix iemxmlrpc iem_delay iem_roomsim iem_spec2 iem_tab jasch_lib loaders-libdir lyonpotpourri mapping markex maxlib mjlib moocow moonlib motex mrpeach oscx pan pdcontainer pddp pdlua pdogg plugin pmpd rjlib sigpack smlib tof unauthorized vbap windowing zexy endif # NEW (IN-PROGRESS): flext @@ -358,6 +358,21 @@ bassemu_clean: make -C $(externals_src)/bassemu~ clean +#------------------------------------------------------------------------------# +# BENDINFIX + +bendinfix: + make -C $(externals_src)/bendinfix PD_PATH=$(pd_src) \ + pdbinpath=$(pd_src)/src CFLAGS="$(CFLAGS_ADD)" + +bendinfix_install: + make -C $(externals_src)/bendinfix DESTDIR="$(DESTDIR)" \ + objectsdir="$(objectsdir)" install + +bendinfix_clean: + make -C $(externals_src)/bendinfix clean + + #------------------------------------------------------------------------------# # BOIDS boids: @@ -1328,6 +1343,7 @@ motex_clean: # MRPEACH MRPEACH_NAME=mrpeach MRPEACH_OBJECTS := $(wildcard $(externals_src)/mrpeach/*/*.c) +mrpeach: WARN_FLAGS=-Wno-pedantic-ms-format mrpeach: $(MRPEACH_OBJECTS:.c=.$(EXTENSION)) mrpeach_install: mrpeach @@ -1860,72 +1876,17 @@ windowing_clean: ZEXY_NAME = zexy zexy_src := $(externals_src)/$(ZEXY_NAME) -$(zexy_src)/configure: $(zexy_src)/configure.ac - cd $(zexy_src) && ./autogen.sh - -$(zexy_src)/Makefile: $(zexy_src)/configure $(zexy_src)/Makefile.am $(zexy_src)/src/Makefile.am - cd $(zexy_src) && ./configure --disable-library \ - --with-extension=$(EXTENSION) \ - --prefix=$(prefix) \ - --libdir=$(objectsdir) \ - --with-pd=$(pd_src) - zexy: $(zexy_src)/Makefile - $(MAKE) -C $(zexy_src) + $(MAKE) -C $(zexy_src) PDINCLUDEDIR=$(pd_src)/src PDBINDIR=$(pd_src)/src zexy_install: zexy $(MAKE) -C $(zexy_src) DESTDIR=$(DESTDIR) prefix=$(prefix) \ - libdir=$(objectsdir) pkglibdir=$(objectsdir)/$(ZEXY_NAME) install -# remove all .la files (libtool archives) created by autotools - find $(DESTDIR)$(objectsdir)/$(ZEXY_NAME) -name "*.la" -exec rm {} \; - find $(DESTDIR)$(objectsdir)/$(ZEXY_NAME) -name "*.dll.a" -exec rm {} \; -# add missing aliases -# can't do these on Windows because FAT, NTFS don't support these chars in filenames -# on Windows, these are faked in by loading them as libs -#ifneq ($(OS_NAME),windows) -# test -e $(DESTDIR)$(objectsdir)/$(ZEXY_NAME)/..$(EXTENSION) || \ -# ln -s 0x2e.$(EXTENSION) \ -# $(DESTDIR)$(objectsdir)/$(ZEXY_NAME)/..$(EXTENSION) -# test -e '$(DESTDIR)$(objectsdir)/$(ZEXY_NAME)/&&~.$(EXTENSION)' || \ -# ln -s 0x260x26_tilde.$(EXTENSION) \ -# '$(DESTDIR)$(objectsdir)/$(ZEXY_NAME)/&&~.$(EXTENSION)' -# test -e '$(DESTDIR)$(objectsdir)/$(ZEXY_NAME)/<~.$(EXTENSION)' || \ -# ln -s 0x3c_tilde.$(EXTENSION) \ -# '$(DESTDIR)$(objectsdir)/$(ZEXY_NAME)/<~.$(EXTENSION)' -# test -e '$(DESTDIR)$(objectsdir)/$(ZEXY_NAME)/==~.$(EXTENSION)' || \ -# ln -s 0x3d0x3d_tilde.$(EXTENSION) \ -# '$(DESTDIR)$(objectsdir)/$(ZEXY_NAME)/==~.$(EXTENSION)' -# test -e '$(DESTDIR)$(objectsdir)/$(ZEXY_NAME)/>~.$(EXTENSION)' || \ -# ln -s 0x3e_tilde.$(EXTENSION) \ -# '$(DESTDIR)$(objectsdir)/$(ZEXY_NAME)/>~.$(EXTENSION)' -# test -e '$(DESTDIR)$(objectsdir)/$(ZEXY_NAME)/||~.$(EXTENSION)' || \ -# ln -s 0x7c0x7c_tilde.$(EXTENSION) \ -# '$(DESTDIR)$(objectsdir)/$(ZEXY_NAME)/||~.$(EXTENSION)' -#endif + libdir=$(objectsdir) pkglibdir=$(objectsdir) install zexy_clean: cd $(externals_src)/zexy -$(MAKE) -C $(externals_src)/zexy clean - -rm -rf -- $(externals_src)/zexy/autom4te.cache - -rm -f -- $(externals_src)/zexy/aclocal.m4 - -rm -f -- $(externals_src)/zexy/libtool - -rm -f -- $(externals_src)/zexy/ltmain.sh - -rm -f -- $(externals_src)/zexy/m4/lt*.m4 - -rm -f -- $(externals_src)/zexy/m4/libtool.m4 - -rm -f -- $(externals_src)/zexy/configure -rm -f -- $(externals_src)/zexy/src/*.o - -rm -f -- $(externals_src)/zexy/Makefile - -rm -f -- $(externals_src)/zexy/Makefile.in - -rm -f -- $(externals_src)/zexy/*/Makefile - -rm -f -- $(externals_src)/zexy/*/Makefile.in - -rm -f -- $(externals_src)/zexy/compile - -rm -f -- $(externals_src)/zexy/config.* - -rm -f -- $(externals_src)/zexy/depcomp - -rm -f -- $(externals_src)/zexy/install-sh - -rm -f -- $(externals_src)/zexy/missing - -rm -f -- $(externals_src)/zexy/stamp-h1 - -rm -f -- $(externals_src)/zexy/test-driver - -rm -f -- $(externals_src)/zexy/*.pd diff --git a/externals/OSCx/libOSC/OSC-timetag.c b/externals/OSCx/libOSC/OSC-timetag.c index 666daef0c3987c32d976cb30d1f173abdf8d72d9..6a2f51909c9af4339b652dc3347f71ef3bd9d9c6 100644 --- a/externals/OSCx/libOSC/OSC-timetag.c +++ b/externals/OSCx/libOSC/OSC-timetag.c @@ -50,7 +50,7 @@ OSCTimeTag OSCTT_BiggestPossibleTimeTag(void) { OSCTimeTag OSCTT_PlusSeconds(OSCTimeTag original, float secondsOffset) { int8 offset = (int8) (secondsOffset * TWO_TO_THE_32_FLOAT); -/* printf("* OSCTT_PlusSeconds %llx plus %f seconds (i.e., %lld offset) is %llx\n", original, +/* printf("* OSCTT_PlusSeconds %zx plus %f seconds (i.e., %lld offset) is %zx\n", original, secondsOffset, offset, original + offset); */ return original + offset; @@ -58,7 +58,7 @@ OSCTimeTag OSCTT_PlusSeconds(OSCTimeTag original, float secondsOffset) { int OSCTT_Compare(OSCTimeTag left, OSCTimeTag right) { #if 0 - printf("***** OSCTT_Compare(%llx, %llx): %d\n", left, right, + printf("***** OSCTT_Compare(%zx, %zx): %d\n", left, right, (left<right) ? -1 : ((left == right) ? 0 : 1)); #endif if (left < right) { @@ -107,7 +107,7 @@ OSCTimeTag OSCTT_CurrentTime(void) { result += usecOffset; -/* printf("* OSCTT_CurrentTime is %llx\n", result); */ +/* printf("* OSCTT_CurrentTime is %zx\n", result); */ return result; } diff --git a/externals/OSCx/libOSC/test_OSC.c b/externals/OSCx/libOSC/test_OSC.c index 4593ec6724a61221915b46565a090be055a813a7..bf1111df2b91d1ea26df9da97d32f7216a138ef3 100644 --- a/externals/OSCx/libOSC/test_OSC.c +++ b/externals/OSCx/libOSC/test_OSC.c @@ -108,7 +108,7 @@ main() { printf("Testing time tags\n"); tt = OSCTT_CurrentTime(); - printf("Time now is %llx\n", tt); + printf("Time now is %zx\n", tt); printf("Testing bundles\n"); if (OSC_openBundle(b, tt)) { diff --git a/externals/OSCx/libOSC/test_OSC_timeTag.c b/externals/OSCx/libOSC/test_OSC_timeTag.c index 8a1cabf80ddeb1f6848ad23292c1d8995de8f14d..373106f2487dbe69e09ff912bfd51296dec3cd79 100644 --- a/externals/OSCx/libOSC/test_OSC_timeTag.c +++ b/externals/OSCx/libOSC/test_OSC_timeTag.c @@ -22,15 +22,15 @@ main() { OSCTimeTag now, later; now = OSCTT_CurrentTime(); - printf("Now it's %llu (0x%llx)\n", now, now); + printf("Now it's %llu (0x%zx)\n", now, now); - printf("Immediately would be %llu (0x%llx)\n", OSCTT_Immediately(), + printf("Immediately would be %llu (0x%zx)\n", OSCTT_Immediately(), OSCTT_Immediately()); later = OSCTT_PlusSeconds(now, 1.0f); - printf("One second from now would be %llu (0x%llx)\n", later, later); + printf("One second from now would be %llu (0x%zx)\n", later, later); now = OSCTT_CurrentTime(); - printf("And *now* it's %llu (0x%llx)\n", now, now); + printf("And *now* it's %llu (0x%zx)\n", now, now); } diff --git a/externals/OSCx/send+dump/sendOSC.c b/externals/OSCx/send+dump/sendOSC.c index bde4f8d00c2492ebd0d851f523a571f162b327a7..b77c9ccc68face723dc66207f88dd4034d5a2be8 100644 --- a/externals/OSCx/send+dump/sendOSC.c +++ b/externals/OSCx/send+dump/sendOSC.c @@ -302,7 +302,7 @@ OSCTimeTag ParseTimeTag(char *s) { if (isdigit(*p) || (*p >= 'a' && *p <='f') || (*p >= 'A' && *p <='F')) { /* They specified the 8-byte tag in hex */ OSCTimeTag tt; - if (sscanf(p, "%llx", &tt) != 1) { + if (sscanf(p, "%zx", &tt) != 1) { complain("warning: couldn't parse time tag %s\n", s); return OSCTT_Immediately(); } diff --git a/externals/bassemu~/bassemu~.c b/externals/bassemu~/bassemu~.c index dcb9d5b29d264443268d62c3918c3fb15bde8255..30d6011e67e0d7ddd676850eb7eac6be5984f20a 100644 --- a/externals/bassemu~/bassemu~.c +++ b/externals/bassemu~/bassemu~.c @@ -311,7 +311,7 @@ static void bassemu_list(t_bassemu *x, t_symbol *s, int argc, t_atom *argv) } if (argc >= 1) { - if(argv[0].a_type = A_FLOAT && (atom_getfloatarg(0,argc,argv) != -1)) + if(argv[0].a_type == A_FLOAT && (atom_getfloatarg(0,argc,argv) != -1)) { // note x->thisnote = atom_getfloatarg(0,argc,argv)-57; x->vco_inc = ((x->tune/x->sr)*pow(2, (x->thisnote)*(1.0/12.0)) / 2.); diff --git a/externals/bbogart/entry/entry.c b/externals/bbogart/entry/entry.c index 50adfbcad0aff634aca348c2fe7b587c8fbb6ab7..947c987da56fade110601e5c4922178eb34b0afe 100644 --- a/externals/bbogart/entry/entry.c +++ b/externals/bbogart/entry/entry.c @@ -133,32 +133,32 @@ static void set_tk_widget_ids(t_entry *x, t_canvas *canvas) x->x_canvas = canvas; /* Tk ID for the current canvas that this object is drawn in */ - sprintf(buf,".x%lx.c", (long unsigned int) canvas); + sprintf(buf,".x%zx.c", (t_uint) canvas); x->canvas_id = getbytes(strlen(buf) + 1); strcpy(x->canvas_id, buf); /* Tk ID for the "frame" the other things are drawn in */ - sprintf(buf,"%s.frame%lx", x->canvas_id, (long unsigned int)x); + sprintf(buf,"%s.frame%zx", x->canvas_id, (t_uint)x); x->frame_id = getbytes(strlen(buf) + 1); strcpy(x->frame_id, buf); - sprintf(buf,"%s.text%lx", x->frame_id, (long unsigned int)x); + sprintf(buf,"%s.text%zx", x->frame_id, (t_uint)x); x->text_id = getbytes(strlen(buf) + 1); strcpy(x->text_id, buf); /* Tk ID for the "text", the meat! */ - sprintf(buf,"%s.window%lx", x->canvas_id, (long unsigned int)x); + sprintf(buf,"%s.window%zx", x->canvas_id, (t_uint)x); x->window_tag = getbytes(strlen(buf) + 1); strcpy(x->window_tag, buf); /* Tk ID for the resizing "window" */ - sprintf(buf,"%s.handle%lx", x->canvas_id, (long unsigned int)x); + sprintf(buf,"%s.handle%zx", x->canvas_id, (t_uint)x); x->handle_id = getbytes(strlen(buf) + 1); strcpy(x->handle_id, buf); /* Tk ID for the resizing "handle" */ - sprintf(buf,"%s.scrollbar%lx", x->frame_id, (long unsigned int)x); + sprintf(buf,"%s.scrollbar%zx", x->frame_id, (t_uint)x); x->scrollbar_id = getbytes(strlen(buf) + 1); strcpy(x->scrollbar_id, buf); /* Tk ID for the optional "scrollbar" */ - sprintf(buf,"all%lx", (long unsigned int)x); + sprintf(buf,"all%zx", (t_uint)x); x->all_tag = getbytes(strlen(buf) + 1); strcpy(x->all_tag, buf); /* Tk ID for the optional "scrollbar" */ } @@ -273,7 +273,7 @@ static void create_widget(t_entry *x) DEBUG(post("create_widget");); /* I guess this is for fine-tuning of the rect size based on width and height? */ - sys_vgui("namespace eval entry%lx {} \n", x); + sys_vgui("namespace eval entry%zx {} \n", x); /* Seems we have to delete the widget in case it already exists (Provided by Guenter)*/ sys_vgui("destroy %s\n", x->frame_id); @@ -298,7 +298,7 @@ static void create_widget(t_entry *x) static void entry_drawme(t_entry *x, t_glist *glist, int firsttime) { - DEBUG(post("entry_drawme: firsttime %d canvas %lx glist %lx", firsttime, x->x_canvas, glist);); + DEBUG(post("entry_drawme: firsttime %d canvas %zx glist %zx", firsttime, x->x_canvas, glist);); set_tk_widget_ids(x,glist_getcanvas(glist)); if (firsttime) { @@ -321,7 +321,7 @@ static void entry_drawme(t_entry *x, t_glist *glist, int firsttime) static void entry_erase(t_entry* x,t_glist* glist) { - DEBUG(post("entry_erase: canvas %lx glist %lx", x->x_canvas, glist);); + DEBUG(post("entry_erase: canvas %zx glist %zx", x->x_canvas, glist);); set_tk_widget_ids(x,glist_getcanvas(glist)); erase_inlets(x); @@ -348,7 +348,7 @@ static void entry_getrect(t_gobj *z, t_glist *owner, static void entry_displace(t_gobj *z, t_glist *glist, int dx, int dy) { t_entry *x = (t_entry *)z; - DEBUG(post("entry_displace: canvas %lx glist %lx", x->x_canvas, glist);); + DEBUG(post("entry_displace: canvas %zx glist %zx", x->x_canvas, glist);); x->x_obj.te_xpix += dx; x->x_obj.te_ypix += dy; if (glist_isvisible(glist)) @@ -369,7 +369,7 @@ static void entry_displace(t_gobj *z, t_glist *glist, int dx, int dy) static void entry_select(t_gobj *z, t_glist *glist, int state) { t_entry *x = (t_entry *)z; - DEBUG(post("entry_select: canvas %lx glist %lx state %d", x->x_canvas, glist, state);); + DEBUG(post("entry_select: canvas %zx glist %zx state %d", x->x_canvas, glist, state);); if( (state) && (!x->x_selected)) { @@ -422,7 +422,7 @@ static void entry_activate(t_gobj *z, t_glist *glist, int state) static void entry_delete(t_gobj *z, t_glist *glist) { - DEBUG(post("entry_delete: glist %lx", glist);); + DEBUG(post("entry_delete: glist %zx", glist);); t_text *x = (t_text *)z; canvas_deletelinesfor(glist, x); } @@ -431,7 +431,7 @@ static void entry_delete(t_gobj *z, t_glist *glist) static void entry_vis(t_gobj *z, t_glist *glist, int vis) { t_entry *x = (t_entry*)z; - DEBUG(post("entry_vis: vis %d canvas %lx glist %lx", vis, x->x_canvas, glist);); + DEBUG(post("entry_vis: vis %d canvas %zx glist %zx", vis, x->x_canvas, glist);); if (vis) { entry_drawme(x, glist, 1); } @@ -760,7 +760,7 @@ static void *entry_new(t_symbol *s, int argc, t_atom *argv) x->x_data_outlet = outlet_new(&x->x_obj, &s_float); x->x_status_outlet = outlet_new(&x->x_obj, &s_symbol); - sprintf(buf,"entry%lx",(long unsigned int)x); + sprintf(buf,"entry%zx",(t_uint)x); x->tcl_namespace = getbytes(strlen(buf) + 1); strcpy(x->tcl_namespace, buf); diff --git a/externals/bbogart/popup/popup.c b/externals/bbogart/popup/popup.c index 1ea98a37d0851da9be5d6b2a2c170d497031a4c2..e47611709f7c52bf14f8fe3ddcd72ead06e980ee 100644 --- a/externals/bbogart/popup/popup.c +++ b/externals/bbogart/popup/popup.c @@ -76,13 +76,13 @@ static void draw_inlets(t_popup *x, t_glist *glist, int firsttime, int nin, int { int onset = text_xpix(&x->x_obj, glist) + (x->x_rect_width - IOWIDTH) * i / nplus; if (firsttime) - sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%lxo%d %lxo}\n", + sys_vgui(".x%zx.c create rectangle %d %d %d %d -tags {%zxo%d %zxo}\n", glist_getcanvas(glist), onset, text_ypix(&x->x_obj, glist) + x->x_rect_height - 2, onset + IOWIDTH, text_ypix(&x->x_obj, glist) + x->x_rect_height-1, x, i, x); else - sys_vgui(".x%lx.c coords %lxo%d %d %d %d %d\n", + sys_vgui(".x%zx.c coords %zxo%d %d %d %d %d\n", glist_getcanvas(glist), x, i, onset, text_ypix(&x->x_obj, glist) + x->x_rect_height - 2, onset + IOWIDTH, text_ypix(&x->x_obj, glist) + x->x_rect_height-1); @@ -94,13 +94,13 @@ static void draw_inlets(t_popup *x, t_glist *glist, int firsttime, int nin, int { int onset = text_xpix(&x->x_obj, glist) + (x->x_rect_width - IOWIDTH) * i / nplus; if (firsttime) - sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%lxi%d %lxi}\n", + sys_vgui(".x%zx.c create rectangle %d %d %d %d -tags {%zxi%d %zxi}\n", glist_getcanvas(glist), onset, text_ypix(&x->x_obj, glist)-2, onset + IOWIDTH, text_ypix(&x->x_obj, glist)-1, x, i, x); else - sys_vgui(".x%lx.c coords %lxi%d %d %d %d %d\n", + sys_vgui(".x%zx.c coords %zxi%d %d %d %d %d\n", glist_getcanvas(glist), x, i, onset, text_ypix(&x->x_obj, glist), onset + IOWIDTH, text_ypix(&x->x_obj, glist)-1); @@ -116,14 +116,14 @@ static void draw_handle(t_popup *x, t_glist *glist, int firsttime) { int onset = text_xpix(&x->x_obj, glist) + (x->x_rect_width - IOWIDTH); if (firsttime) { - sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags %lxhandle\n", + sys_vgui(".x%zx.c create rectangle %d %d %d %d -tags %zxhandle\n", glist_getcanvas(glist), onset, text_ypix(&x->x_obj, glist) + x->x_rect_height - 12, onset + IOWIDTH-2, text_ypix(&x->x_obj, glist) + x->x_rect_height-4, x); } else { - sys_vgui(".x%lx.c coords %lxhandle %d %d %d %d\n", + sys_vgui(".x%zx.c coords %zxhandle %d %d %d %d\n", glist_getcanvas(glist), x, onset, text_ypix(&x->x_obj, glist) + x->x_rect_height - 12, onset + IOWIDTH-2, text_ypix(&x->x_obj, glist) + x->x_rect_height-4); @@ -155,19 +155,19 @@ static void create_widget(t_popup *x, t_glist *glist) /* Seems we have to delete the widget in case it already exists (Provided by Guenter)*/ if(x->initialized) { - sys_vgui("destroy .x%lx.c.s%lx\n",glist_getcanvas(glist),x); + sys_vgui("destroy .x%zx.c.s%zx\n",glist_getcanvas(glist),x); - sys_vgui("set %lxw .x%lx.c.s%lx ; menubutton $%lxw -relief raised -background \"%s\" -text \"%s\" -direction flush -menu $%lxw.menu ; menu $%lxw.menu -tearoff 0\n", + sys_vgui("set %zxw .x%zx.c.s%zx ; menubutton $%zxw -relief raised -background \"%s\" -text \"%s\" -direction flush -menu $%zxw.menu ; menu $%zxw.menu -tearoff 0\n", x,canvas,x,x,x->x_colour->s_name,temp_name->s_name,x,x); for(i=0 ; i<x->x_num_options ; i++) { - sys_vgui(".x%lx.c.s%lx.menu add command -label \"%s\" -command {.x%lx.c.s%lx configure -text \"%s\" ; popup_sel%lx \"%d\"} \n", + sys_vgui(".x%zx.c.s%zx.menu add command -label \"%s\" -command {.x%zx.c.s%zx configure -text \"%s\" ; popup_sel%zx \"%d\"} \n", canvas, x, x->x_options[i]->s_name, canvas, x, x->x_options[i]->s_name, x, i); } } - DEBUG(post("id: .x%lx.c.s%lx", canvas, x);) + DEBUG(post("id: .x%zx.c.s%zx", canvas, x);) DEBUG(post("create_widget end");) } @@ -181,21 +181,21 @@ static void popup_drawme(t_popup *x, t_glist *glist, int firsttime) DEBUG(post("drawme %d",firsttime);) if (firsttime) { - DEBUG(post("glist %lx canvas %lx",x->x_glist,canvas);) + DEBUG(post("glist %zx canvas %zx",x->x_glist,canvas);) create_widget(x,glist); x->x_glist = canvas; - sys_vgui(".x%lx.c create window %d %d -width %d -height %d -anchor nw -window .x%lx.c.s%lx -tags %lxS\n", + sys_vgui(".x%zx.c create window %d %d -width %d -height %d -anchor nw -window .x%zx.c.s%zx -tags %zxS\n", canvas,text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist), x->x_width, x->x_height, x->x_glist,x,x); } else { - sys_vgui(".x%lx.c coords %lxS %d %d\n", + sys_vgui(".x%zx.c coords %zxS %d %d\n", canvas, x, text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist)); } draw_inlets(x, glist, firsttime, 2,2); // draw_handle(x, glist, firsttime); - sys_vgui(".x%lx.c.s%lx configure -state \"%s\"\n", canvas, x, x->x_disabled?"disabled":"active"); + sys_vgui(".x%zx.c.s%zx configure -state \"%s\"\n", canvas, x, x->x_disabled?"disabled":"active"); // Output a bang to first outlet when we're ready to receive float messages the first time!. @@ -212,15 +212,15 @@ static void popup_erase(t_popup* x,t_glist* glist) DEBUG(post("erase start");) if(x->initialized){ - sys_vgui("destroy .x%lx.c.s%lx\n",glist_getcanvas(glist),x); + sys_vgui("destroy .x%zx.c.s%zx\n",glist_getcanvas(glist),x); - sys_vgui(".x%lx.c delete %lxS\n",glist_getcanvas(glist), x); + sys_vgui(".x%zx.c delete %zxS\n",glist_getcanvas(glist), x); /* inlets and outlets */ - sys_vgui(".x%lx.c delete %lxi\n",glist_getcanvas(glist),x); /* Added tag for all inlets of one instance */ - sys_vgui(".x%lx.c delete %lxo\n",glist_getcanvas(glist),x); /* Added tag for all outlets of one instance */ - sys_vgui(".x%lx.c delete %lxhandle\n",glist_getcanvas(glist),x,0); + sys_vgui(".x%zx.c delete %zxi\n",glist_getcanvas(glist),x); /* Added tag for all inlets of one instance */ + sys_vgui(".x%zx.c delete %zxo\n",glist_getcanvas(glist),x); /* Added tag for all outlets of one instance */ + sys_vgui(".x%zx.c delete %zxhandle\n",glist_getcanvas(glist),x,0); } DEBUG(post("erase end");) @@ -258,7 +258,7 @@ static void popup_displace(t_gobj *z, t_glist *glist, x->x_obj.te_ypix += dy; if (glist_isvisible(glist)) { - if(x->initialized)sys_vgui(".x%lx.c coords %lxSEL %d %d %d %d\n", + if(x->initialized)sys_vgui(".x%zx.c coords %zxSEL %d %d %d %d\n", glist_getcanvas(glist), x, text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist)-1, text_xpix(&x->x_obj, glist) + x->x_rect_width, text_ypix(&x->x_obj, glist) + x->x_rect_height-2); @@ -276,15 +276,15 @@ static void popup_select(t_gobj *z, t_glist *glist, int state) t_popup *x = (t_popup *)z; if(x->initialized){ if (state) { - sys_vgui(".x%lx.c create rectangle \ -%d %d %d %d -tags %lxSEL -outline blue\n", + sys_vgui(".x%zx.c create rectangle \ +%d %d %d %d -tags %zxSEL -outline blue\n", glist_getcanvas(glist), text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist)-1, text_xpix(&x->x_obj, glist) + x->x_rect_width, text_ypix(&x->x_obj, glist) + x->x_rect_height-2, x); } else { - sys_vgui(".x%lx.c delete %lxSEL\n", + sys_vgui(".x%zx.c delete %zxSEL\n", glist_getcanvas(glist), x); } } @@ -389,7 +389,7 @@ static void popup_options(t_popup* x, t_symbol *s, int argc, t_atom *argv) x->x_num_options = argc; /* delete old menu items */ - if(visible)sys_vgui(".x%lx.c.s%lx.menu delete 0 end \n", x->x_glist, x); + if(visible)sys_vgui(".x%zx.c.s%zx.menu delete 0 end \n", x->x_glist, x); if(argc>x->x_maxoptions){ /* resize the options-array */ @@ -401,7 +401,7 @@ static void popup_options(t_popup* x, t_symbol *s, int argc, t_atom *argv) for(i=0 ; i<argc ; i++) { x->x_options[i] = atom_getsymbol(argv+i); - if(visible)sys_vgui(".x%lx.c.s%lx.menu add command -label \"%s\" -command {.x%lx.c.s%lx configure -text \"%s\" ; popup_sel%lx \"%d\"} \n", + if(visible)sys_vgui(".x%zx.c.s%zx.menu add command -label \"%s\" -command {.x%zx.c.s%zx configure -text \"%s\" ; popup_sel%zx \"%d\"} \n", x->x_glist, x, x->x_options[i]->s_name, x->x_glist, x, x->x_options[i]->s_name, x, i); } @@ -415,7 +415,7 @@ static void popup_bgcolour(t_popup* x, t_symbol* col) DEBUG(post("bgcolour start");) x->x_colour = col; - if(visible)sys_vgui(".x%lx.c.s%lx configure -background \"%s\"\n", x->x_glist, x, col->s_name); + if(visible)sys_vgui(".x%zx.c.s%zx configure -background \"%s\"\n", x->x_glist, x, col->s_name); } /* Function to change name of popup */ @@ -425,7 +425,7 @@ static void popup_name(t_popup* x, t_symbol *name) DEBUG(post("name start");) x->x_name = name; - if(visible)sys_vgui(".x%lx.c.s%lx configure -text \"%s\"\n", x->x_glist, x, name->s_name); + if(visible)sys_vgui(".x%zx.c.s%zx configure -text \"%s\"\n", x->x_glist, x, name->s_name); } /* Function to select a menu option by inlet */ @@ -437,7 +437,7 @@ static void popup_iselect(t_popup* x, t_floatarg item) int i=(int)item; if( i<x->x_num_options && i>=0) { - if(visible)sys_vgui(".x%lx.c.s%lx configure -text \"%s\" ; popup_sel%lx \"%d\" \n", + if(visible)sys_vgui(".x%zx.c.s%zx configure -text \"%s\" ; popup_sel%zx \"%d\" \n", glist_getcanvas(x->x_glist), x, x->x_options[i]->s_name,x, i); else popup_output(x, i); @@ -459,7 +459,7 @@ static void popup_symselect(t_popup* x, t_symbol *s) { if(x->x_options[i]->s_name == s->s_name) { - if(visible)sys_vgui(".x%lx.c.s%lx configure -text \"%s\" ; popup_sel%lx \"%d\" \n", + if(visible)sys_vgui(".x%zx.c.s%zx configure -text \"%s\" ; popup_sel%zx \"%d\" \n", glist_getcanvas(x->x_glist), x, x->x_options[i]->s_name,x, i); else popup_output(x, i); match = 1; @@ -485,7 +485,7 @@ static void popup_set(t_popup* x, t_symbol *S, int argc, t_atom*argv) { x->current_selection = i; if(visible) - sys_vgui(".x%lx.c.s%lx configure -text \"%s\"\n", + sys_vgui(".x%zx.c.s%zx configure -text \"%s\"\n", glist_getcanvas(x->x_glist), x, x->x_options[i]->s_name); } else { error("popup: Valid menu selections are from %d to %d\npopup: You entered %d.", 0, x->x_num_options-1, i); @@ -500,7 +500,7 @@ static void popup_set(t_popup* x, t_symbol *S, int argc, t_atom*argv) if(x->x_options[i]->s_name == s->s_name) { x->current_selection = i; - if(visible)sys_vgui(".x%lx.c.s%lx configure -text \"%s\"\n", + if(visible)sys_vgui(".x%zx.c.s%zx configure -text \"%s\"\n", glist_getcanvas(x->x_glist), x, x->x_options[i]->s_name); return; } @@ -541,7 +541,7 @@ static void popup_append(t_popup* x, t_symbol *s, int argc, t_atom *argv) for(i=x->x_num_options ; i<new_limit ; i++) { x->x_options[i] = atom_getsymbol(argv+i-x->x_num_options); - if(visible)sys_vgui(".x%lx.c.s%lx.menu add command -label \"%s\" -command {.x%lx.c.s%lx configure -text \"%s\" ; popup_sel%lx \"%d\"} \n", + if(visible)sys_vgui(".x%zx.c.s%zx.menu add command -label \"%s\" -command {.x%zx.c.s%zx configure -text \"%s\" ; popup_sel%zx \"%d\"} \n", x->x_glist, x, x->x_options[i]->s_name, x->x_glist, x, x->x_options[i]->s_name, x, i); } @@ -554,7 +554,7 @@ static void popup_disable(t_popup*x, t_float f){ x->x_disabled=(f>0.f); if(x->x_glist && glist_isvisible(x->x_glist)){ t_canvas *canvas=glist_getcanvas(x->x_glist); - sys_vgui(".x%lx.c.s%lx configure -state \"%s\"\n", canvas, x, x->x_disabled?"disabled":"active"); + sys_vgui(".x%zx.c.s%zx configure -state \"%s\"\n", canvas, x, x->x_disabled?"disabled":"active"); } } @@ -620,13 +620,13 @@ static void *popup_new(t_symbol *s, int argc, t_atom *argv) break; } - /* Bind the recieve "popup%lx" to the widget outlet*/ - sprintf(buf,"popup%lx", (long unsigned int)x); + /* Bind the recieve "popup%zx" to the widget outlet*/ + sprintf(buf,"popup%zx", (t_uint)x); x->x_sym = gensym(buf); pd_bind(&x->x_obj.ob_pd, x->x_sym); /* define proc in tcl/tk where "popup%p" is the receive, "output" is the method, and "$index" is an argument. */ - sys_vgui("proc popup_sel%lx {index} {\n pd [concat %s output $index \\;]\n }\n", + sys_vgui("proc popup_sel%zx {index} {\n pd [concat %s output $index \\;]\n }\n", x, buf); /* Add symbol inlet (hard to say how this actually works?? */ diff --git a/externals/bendinfix/LICENSE b/externals/bendinfix/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..da48c4f142060537638223b6d3afedc2a629e1ce --- /dev/null +++ b/externals/bendinfix/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Albert Gräf + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/externals/bendinfix/Makefile b/externals/bendinfix/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..7e0519376ef5ce444708fa39f73279c61a5a5ece --- /dev/null +++ b/externals/bendinfix/Makefile @@ -0,0 +1,8 @@ + +lib.name = bendinfix + +class.sources = bendinfix.c + +datafiles = bendinfix-help.pd LICENSE README.md + +include Makefile.pdlibbuilder.revised diff --git a/externals/bendinfix/Makefile.pdlibbuilder.revised b/externals/bendinfix/Makefile.pdlibbuilder.revised new file mode 100644 index 0000000000000000000000000000000000000000..c2da4e48d8390f5eb0324f874d76e95f33d4949a --- /dev/null +++ b/externals/bendinfix/Makefile.pdlibbuilder.revised @@ -0,0 +1,1210 @@ +# Makefile.pdlibbuilder dated 2016-06-26 + +version = 0.2.5 + +# 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. +# +# 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 +# - <classname>.class.sources +# - <classname>.class.ldflags +# - <classname>.class.ldlibs +# - cflags +# - ldflags +# - ldlibs +# - datafiles +# - datadirs +# - makefiles +# - makefiledirs +# - externalsdir +# +# Optional multiline defines evaluated per operating system: +# +# - forLinux +# - forDarwin +# - forWindows +# +# +# Variables avaialable for (re)definition via command arguments: +# +# - pdbinpath (Windows only) +# - pdincludepath +# - DESTDIR +# - prefix +# - libdir +# - pkglibdir +# - CPPFLAGS +# - CFLAGS +# - LDFLAGS +# - CC +# - CXX +# - INSTALL +# - INSTALL_PROGRAM +# - INSTALL_DATA +# - INSTALL_DIR +# +# Variables available for your makefile or as command argument: +# +# - objectsdir +# - make-lib-executable +# - suppress-wunused +# +# +#=== 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. +# +# <classname>.class.sources: +# Source file(s) (C or C++) specific to class <classname>. 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. +# +# <classname>.class.ldflags and <classname>.class.ldlibs: +# Define ldflags resp. ldlibs specific to class <classname>. 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. +# +# externalsdir: +# Relative path to directory 'externals' in the context of pd-extended SVN, or +# any other centralized build layout for multiple libraries. Default value +# is '..', meaning the direct parent. The value is used in search paths for +# pd core components (header files, and executable in the case of Windows). +# +# 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. +# +# pdbinpath: +# For Windows only. Directory where pd.dll can be found for linking. +# +# pdincludepath: +# Directory where Pd API m_pd.h can be found, and other Pd header files. +# +# DESTDIR, prefix, libdir: +# Components of the path for installation as conventionally used on Linux. +# +# pkglibdir: +# Base path for installation of Pd library directories. Default is specified +# per OS, see section about paths below. +# +# objectsdir: +# Alias of pkglibdir. Can be defined in your makefile to enable project- +# dependent relative install locations. +# +# 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, INSTALL_PROGRAM, INSTALL_DATA, INSTALL_DIR: +# Definitions of install program, may be overriden via command argument. +# +# 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 overriden 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. +# +# +#=== 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. +# +# Variable 'pdincludepath' stores a location where m_pd.h is expected to reside. +# Locations where Makefile.pdlibbuilder tries to find it, in order of priority: +# +# any OS: $(externalsdir)../pd/src +# +# Linux: /usr/include/pdextended +# /usr/include/pd +# +# OSX: /Applications/Pd-extended.app/Contents/Resources/include/pdextended +# /Applications/Pd.app/Contents/Resources/src +# +# Windows: %PROGRAMFILES%/pd/include/pdextended +# %PROGRAMFILES%/pd/src +# +# The path for installation of all library components is constructed as: +# +# installpath := $(DESTDIR)$(objectsdir)/$(lib.name) +# +# Default for 'objectsdir' is defined per platform and follows this convention: +# https://puredata.info/docs/faq/how-do-i-install-externals-and-help-files +# +# Linux: /usr/local/lib/pd-externals +# OSX: ~/Library/Pd +# Windows: %APPDATA%/Pd +# +# 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 +# <classname>: force clean build of an individual class +# <sourcefile>.pre: make preprocessor output file in current working directory +# <sourcefile>.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 +# 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 <lib.name>-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 <target>' to print debug details of the make process. +# Use 'make -p <target>' to print make's database. +# +# +#=== TODO ====================================================================== +# +# +# - decide whether to use -static-libgcc or shared dll in MinGW +# - cygwin support +# - android support +# - Windows 64 bit 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. This variable is used to probe for +# paths. +externalsdir ?= .. + +# variable you can use to check if Makefile.pdlibbuilder is already included +Makefile.pdlibbuilder = true + + +################################################################################ +### 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 ########################################################### +################################################################################ + + +#=== sources =================================================================== + + +# (re)define <classname>.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 <classname>.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 .o, $(basename $(classes.sources))) +common.objects := $(addsuffix .o, $(basename $(common.sources))) +shared.objects := $(addsuffix .o, $(basename $(shared.sources))) +lib.setup.objects := $(addsuffix .o, $(basename $(lib.setup.sources))) +all.objects = $(classes.objects) $(common.objects) $(shared.objects) \ + $(lib.setup.objects) + + +#=== executables =============================================================== + + +# use recursive variables here because executable extension is not yet known + +# construct class executable names from class names +classes.executables = $(addsuffix .$(extension), $(classes)) + +# construct shared lib executable name if shared sources are defined +ifdef shared.sources + shared.lib = lib$(lib.name).$(shared.extension) +else + shared.lib = +endif + + +################################################################################ +### variables per platform ##################################################### +################################################################################ + + +#=== flags per architecture ==================================================== + + +# Set architecture-dependent cflags, mainly for Linux. For Mac and Windows, +# arch.c.flags are overriden below. + +machine := $(shell uname -m) + +# Raspberry Pi 1st generation +ifeq ($(machine), armv6l) + arch.c.flags = -march=armv6 -mfpu=vfp -mfloat-abi=hard +endif + +# Beagle, Udoo, RPi2 etc. +ifeq ($(machine), armv7l) + arch.c.flags = -march=armv7-a -mfpu=vfpv3 -mfloat-abi=hard +endif + +# Intel 32 bit, build with SSE and SSE2 instructions +ifeq ($(findstring $(machine), i386 i686), $(machine)) + arch.c.flags = -march=pentium4 -mfpmath=sse -msse -msse2 +endif + +# Intel/AMD 64 bit, build with SSE, SSE2 and SSE3 instructions +ifeq ($(findstring $(machine), ia64 x86_64), $(machine)) + arch.c.flags = -march=core2 -mfpmath=sse -msse -msse2 -msse3 +endif + + +#=== operating system ========================================================== + + +# The following systems are defined: Linux, Darwin, Windows. GNU and +# GNU/kFreeBSD are treated as Linux to get the same options. System-specific +# multiline defines (optionally set in library makefile) are conditionally +# evaluated here. + +uname := $(shell uname) + +ifeq ($(findstring $(uname), Linux GNU GNU/kFreeBSD), $(uname)) + system = Linux + $(eval $(forLinux)) +endif + +ifeq ($(uname), Darwin) + system = Darwin + $(eval $(forDarwin)) +endif + +ifeq ($(findstring MINGW, $(uname)), MINGW) + system = Windows + $(eval $(forWindows)) +endif + +# TODO: Cygwin, Android + + +#=== flags and paths for Linux ================================================= + + +ifeq ($(system), Linux) + prefix = /usr/local + libdir := $(prefix)/lib + pkglibdir = $(libdir)/pd-externals + pdincludepath := $(firstword $(wildcard \ + $(externalsdir)/../pd/src \ + /usr/include/pdextended \ + /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) + stripflags = --strip-unneeded -R .note -R .comment +endif + + +#=== flags and paths for Darwin ================================================ + + +# On OSX we try to build fat binaries by default. It is assumed that OSX i386 +# can build for ppc and OSX x86_64 can't. TODO: try to refine this condition. +# LLVM-clang doesn't support -fcheck-new, therefore this flag is omitted for +# OSX x86_64. + +ifeq ($(system), Darwin) + ifeq ($(macos_target),) + macos_target = 10.9 + endif + pkglibdir = $(HOME)/Library/Pd + pdincludepath := $(firstword $(wildcard \ + $(externalsdir)/../pd/src \ + /Applications/Pd-extended*.app/Contents/Resources/include/pdextended \ + /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 + stripflags = -x + ifeq ($(machine), i386) + cxx.flags := -fcheck-new + arch.c.flags := -arch ppc -arch i386 -arch x86_64 -mmacosx-version-min=$(macos_target) + arch.ld.flags := -arch ppc -arch i386 -arch x86_64 -mmacosx-version-min=$(macos_target) + endif + ifeq ($(machine), x86_64) + arch.c.flags := -arch x86_64 -mmacosx-version-min=$(macos_target) + arch.ld.flags := -arch x86_64 -mmacosx-version-min=$(macos_target) + endif +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, and probe for each standard path individually. +# Using double quotes around paths with spaces is obligatory. Since some path +# variables are assembled or re-expanded later, great care must be taken to put +# quotes at appropriate points throughout the makefile. Thanks, Bill. + +# paths for 32-bit executables on 64-bit Windows aren't yet defined here (TODO) +ifeq ($(system), Windows) + pkglibdir := $(APPDATA)/Pd + pdbinpath := $(wildcard $(externalsdir)/../pd/bin) + pdincludepath := $(wildcard $(externalsdir)/../pd/src) + ifndef pdbinpath + pdbinpath := $(shell ls -d "$(PROGRAMFILES)/pd/bin") + endif + ifndef pdincludepath + pdincludepath := $(shell ls -d "$(PROGRAMFILES)/pd/include/pdextended") + endif + ifndef pdincludepath + pdincludepath := $(shell ls -d "$(PROGRAMFILES)/pd/src") + endif +endif + +# On Windows we build 32 bit by default to match Pd(-extended) binary +# distributions. This may change in the future. +# TODO: decide whether -mms-bitfields should be specified. +ifeq ($(system), Windows) + extension = dll + CC = gcc + CXX = g++ + arch.c.flags := -march=pentium4 -msse -msse2 -mfpmath=sse + cpp.flags := -DMSW -DNT + c.flags := + c.ldflags := -static-libgcc -shared \ + -Wl,--enable-auto-import "$(pdbinpath)/pd.dll" + c.ldlibs := + cxx.flags := -fcheck-new + cxx.ldflags := -static-libstdc++ -shared \ + -Wl,--enable-auto-import "$(pdbinpath)/pd.dll" + cxx.ldlibs := + shared.extension = dll + shared.ldflags := -static-libgcc -shared "$(pdbinpath)/pd.dll" + stripflags = --strip-unneeded -R .note -R .comment +endif + + +#=== paths ===================================================================== + + +# Default pkglibdir is specified above per operating system. It is aliased as +# 'objectsdir' to retain compatibility with pd-extended template. Assignment +# operator '?=' is used to enable a project-relative path definition in the +# including makefile. +objectsdir ?= $(pkglibdir) + +# base path where all components of the lib will be installed by default +installpath := $(DESTDIR)$(objectsdir)/$(lib.name) + +# check if pdincludepath 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, $(pdincludepath)), $(pdincludepath)) + + +#=== 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 "$(pdincludepath)" $(CPPFLAGS) + +# architecture specifications for linker are overridable by LDFLAGS +LDFLAGS := $(arch.ld.flags) + +# now add the same ld flags to shared dynamic lib +shared.ldflags := $(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: 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. + +# '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 pdincludepath + mpdh := $(shell ls "$(pdincludepath)/m_pd.h") +endif + +# print Makefile.pdlibbuilder version +$(info ++++ info: using Makefile.pdlibbuilder version $(version)) + +# 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 .o, $(basename $($2.class.sources))) \ + $(addsuffix .o, $(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 lib$(lib.name).$(shared.extension) $(shared.objects) \ + $($1.ldlibs) $(shared.ldlibs) +endef + +# rule for linking objects in shared executable +# build recipe is in macro 'link-shared' +lib$(lib.name).$(shared.extension): $(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. + +%.o:: %.c + $(call make-object-file,c) + +%.o:: %.cc + $(call make-object-file,cxx) + +%.o:: %.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 .o, $(basename $($v.class.sources))) \ + $(addsuffix .o, $(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. Also it is known that multiple arch flags are +# incompatible with preprocessor option -MM on OSX <= 10.5. Dependency +# tracking must be disabled in those cases. + +oldfat := $(and $(filter ppc i386, $(machine)), \ + $(filter-out 0 1, $(words $(filter -arch, $(c.flags))))) + +disable-dependency-tracking := $(strip $(pdincludepathwithspaces) $(oldfat)) + +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)$(filter %.o: %.h, $(shell $(CPP) $(c.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 ################################################ +################################################################################ + + +# 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)" + $(INSTALL_PROGRAM) $(executables) "$(installpath)" + $(info ++++ info: executables of lib $(lib.name) installed \ + from $(CURDIR) to $(installpath)) + +install-datafiles: all + $(INSTALL_DIR) -v "$(installpath)" + $(INSTALL_DATA) $(datafiles) "$(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(-extended) 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 path as argument to" + @echo " the make command, like 'pdincludepath=path/to/pd/src'." + @echo + @echo " Path for installation of your libdir(s):" + @echo " $(objectsdir)" + @echo " Alternatively you may specify your path for installation as argument" + @echo " to the make command, like 'objectsdir=path/to/pd-externals'." + @echo + @echo " Default paths are listed in the doc sections in Makefile.pdlibbuilder." + @echo + + +#=== 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: + diff --git a/externals/bendinfix/README.md b/externals/bendinfix/README.md new file mode 100644 index 0000000000000000000000000000000000000000..215fdaacb5b242bd3a236a61d3a02e1d4e3f9eb8 --- /dev/null +++ b/externals/bendinfix/README.md @@ -0,0 +1,42 @@ + +# bendinfix + +This external provides a helper object to maintain compatibility between the bendin value ranges of different Pd flavors (specifically, vanilla Pd, pd-l2ork version 1, and purr-data a.k.a. pd-l2ork version 2+). + +Pd has a long-standing [bug](https://sourceforge.net/p/pure-data/bugs/1262/) in that its bendin object produces an unsigned value range of 0 thru 16383, while the bendout object expects a signed range of -8192 thru +8191. Which means that you have to translate the values when routing pitch bends from MIDI input to MIDI output. It also makes it harder to translate pitch bend input to frequency offsets. This bug has been there for such a long time that it now can't be fixed any more, to maintain backwards compatibility. + +However, other Pd flavors have in fact fixed this bug, specifically pd-l2ork and its successor purr-data. This actually made matters worse, though, since now Pd programmers have to cope with a variety of bendin implementations, which makes it hard to maintain interoperability between the different flavors if you need to process MIDI pitch bend events. + +The bendinfix external provides a solution that (1) provides a quick way to check which bendin implementation you have, (2) takes the output of the bendin object and translates it to the correct (signed) range, and (3) is binary-compatible with all modern Pd flavors. + +## Synopsis + +`[bendin]` takes signed or unsigned pitch bend values and translates them to signed values. + +- inlet #1: signed or unsigned pitch bend values, depending on your Pd flavor + +- outlet #1: output values are always signed, in the -8192 ... 8191 range + +- arguments: none + +## Usage + +(1) Passing 0 to bendinfix yields the value -8192 for a vanilla-compatible bendin, and 0 otherwise. Thus comparing the result against 0 gives you a flag determining whether you have a signed implementation: + + `[0( --- [bendinfix] --- [== 0]` yields 1 if signed, 0 if unsigned bendin implementation + +You can then use the computed flag in a patch to set it up for the pitch bend implementation at hand. + +(2) Simply routing the output of bendin into bendinfix yields the correct signed pitch bend values: + + `[bendin] --- [bendinfix]` yields signed bendin values in the -8192 ... 8191 range + +These can then be routed to bendout without further translation, or you can divide, e.g., by 4096, add a MIDI note number, and route the result through mtof to get a pitch bend range of +/- 2 semitones. + +Or, if you prefer to work with unsigned values, just add 8192 to the result of bendinfix. This will always give you unsigned values, even if your Pd flavor has a signed bendin implementation. + +## See Also + +- the infamous [bug #1262](https://sourceforge.net/p/pure-data/bugs/1262/) + +- doc/5.reference, midi (and bendin) help patches diff --git a/externals/bendinfix/bendinfix-help.pd b/externals/bendinfix/bendinfix-help.pd new file mode 100644 index 0000000000000000000000000000000000000000..323774ce2f25bdf013d24bb960e189c1a9ffaf94 --- /dev/null +++ b/externals/bendinfix/bendinfix-help.pd @@ -0,0 +1,34 @@ +#N canvas 696 372 460 365 12; +#X obj 22 263 bendinfix; +#X floatatom 22 292 5 0 0 0 - - -, f 5; +#X msg 78 233 0; +#X obj 22 233 bendin; +#X text 21 321 corrected pitch bend value (-8192 - 8191 range); +#X text 22 206 pitch bend input; +#X text 113 234 Passing 0 as input gives the amount by which the result +is shifted. This will be -8192 for a vanilla-compatible bendin implementation +\, 0 otherwise., f 46; +#N canvas 477 282 494 344 META 0; +#X text 12 5 KEYWORDS control MIDI; +#X text 12 25 LICENSE MIT; +#X text 12 85 INLET_0 float; +#X text 12 105 OUTLET_0 float; +#X text 12 129 AUTHOR Albert Gräf; +#X text 12 149 WEBSITE https://agraef.github.io/purr-data/; +#X text 12 169 RELEASE_DATE 2020; +#X text 12 192 HELP_PATCH_AUTHORS Albert Gräf; +#X text 12 45 DESCRIPTION translate bendin output to signed values +for all Pd flavors; +#X restore 380 335 pd META; +#X text 18 2 bendinfix - correct bendin values for all Pd flavors; +#X text 17 41 Background: Pd has a long-standing bug (which won't be +fixed due to backward compatibility concerns) in that its bendin range +(0 - 16383) doesn't match its bendout range (-8192 - 8191). The former +is what MIDI readily yields \, while the latter is more convenient +for translating pitch bends into frequency offsets. The bendinfix object +translates bendin's output to the correct (signed) range \, and works +across all Pd flavors \, including Pd-L2ork and Purr Data where bendin +returns a signed result by default.; +#X connect 0 0 1 0; +#X connect 2 0 0 0; +#X connect 3 0 0 0; diff --git a/externals/bendinfix/bendinfix.c b/externals/bendinfix/bendinfix.c new file mode 100644 index 0000000000000000000000000000000000000000..943ca87ea4e065de5c125f7db4889196589c0c59 --- /dev/null +++ b/externals/bendinfix/bendinfix.c @@ -0,0 +1,67 @@ + +// To compile on Linux: gcc --shared -fPIC -o bendinfix.pd_linux bendinfix.c + +#include <m_pd.h> + +static t_class *bendinfix_class; +static int *legacy, *legacy_bendin; +static void (*nw_gui_vmess)(const char *sel, char *fmt, ...); + +typedef struct _bendinfix { + t_object x_obj; +} t_bendinfix; + +void bendinfix_float(t_bendinfix *x, t_floatarg f) +{ + // vanilla default: + t_float g = 8192; + // exported symbols by the different Pd flavors: + // nw_gui_vmess => purr-data only + // legacy => pd-l2ork and purr-data + // legacy_bendin => purr-data with revised bendin implementation + if (legacy_bendin) + // signed bendin unless legacy_bendin is set + g = *legacy_bendin?8192:0; + else if (legacy) + // we always have a signed bendin with classic pd-l2ork (!nw_gui_vmess), + // whereas for purr-data without the revised bendin implementation + // (!legacy_bendin) bendin is signed, unless legacy is set + g = !nw_gui_vmess?0:*legacy?8192:0; + outlet_float(x->x_obj.ob_outlet, f-g); +} + +void *bendinfix_new(void) +{ + t_bendinfix *x = (t_bendinfix *)pd_new(bendinfix_class); + outlet_new(&x->x_obj, &s_float); + return (void *)x; +} + +#ifdef WIN32 +#include <windows.h> +#else +#define __USE_GNU // to get RTLD_DEFAULT +#include <dlfcn.h> // for dlsym +#ifndef RTLD_DEFAULT +/* If RTLD_DEFAULT still isn't defined then just passing NULL will hopefully + do the trick. */ +#define RTLD_DEFAULT NULL +#endif +#endif + +void bendinfix_setup(void) { + bendinfix_class = class_new(gensym("bendinfix"), + (t_newmethod)bendinfix_new, + 0, sizeof(t_bendinfix), + CLASS_DEFAULT, 0); + class_addfloat(bendinfix_class, bendinfix_float); +#ifdef WIN32 + legacy = (void*)GetProcAddress(GetModuleHandle("pd.dll"), "sys_legacy"); + legacy_bendin = (void*)GetProcAddress(GetModuleHandle("pd.dll"), "sys_legacy_bendin"); + nw_gui_vmess = (void*)GetProcAddress(GetModuleHandle("pd.dll"), "gui_vmess"); +#else + legacy = dlsym(RTLD_DEFAULT, "sys_legacy"); + legacy_bendin = dlsym(RTLD_DEFAULT, "sys_legacy_bendin"); + nw_gui_vmess = dlsym(RTLD_DEFAULT, "gui_vmess"); +#endif +} diff --git a/externals/fluid~/fluid~-help.pd b/externals/fluid~/fluid~-help.pd index 1587a76282feedfc934fb05ce5859c6b58346af1..ab98aa274d8bea304e3dddb89fff2e032bcf0cfa 100644 --- a/externals/fluid~/fluid~-help.pd +++ b/externals/fluid~/fluid~-help.pd @@ -1,109 +1,141 @@ -#N canvas 8 25 1015 671 10; -#X text 35 71 A soundfont player using If I Were You \, from www.iiwu.org +#N canvas 645 66 561 627 10; +#X obj 0 595 cnv 15 552 21 empty \$0-pddp.cnv.footer empty 20 12 0 +14 #dcdcdc #404040 0; +#X obj 0 0 cnv 15 552 40 empty \$0-pddp.cnv.header fluid~ 3 12 0 18 +#c4dcdc #000000 0; +#X obj 0 294 cnv 3 550 3 empty \$0-pddp.cnv.inlets inlets 8 12 0 13 +#dcdcdc #000000 0; +#N canvas 484 286 496 371 META 0; +#X text 12 5 KEYWORDS synthesizer soundfont; +#X text 12 25 LICENSE GPLv2+; +#X text 12 75 AUTHOR Frank Barknecht \, Jonathan Wilkes \, Albert Gräf ; -#X text 170 296 fluid~ wants channel # first: should I change this? +#X text 12 115 RELEASE_DATE 2003 \, 2016 \, 2020; +#X text 12 45 DESCRIPTION MIDI synthesizer using fluidsynth; +#X text 12 95 WEBSITE http://www.fluidsynth.org/; +#X text 12 135 HELP_PATCH_AUTHORS Albert Gräf \, based on an earlier +help patch by Frank Barknecht and others.; +#X restore 500 597 pd META; +#X obj 0 441 cnv 3 550 3 empty \$0-pddp.cnv.outlets outlets 8 12 0 +13 #dcdcdc #000000 0; +#X obj 0 510 cnv 3 550 3 empty \$0-pddp.cnv.argument arguments 8 12 +0 13 #dcdcdc #000000 0; +#X obj 0 568 cnv 3 550 3 empty \$0-pddp.cnv.more_info more_info 8 12 +0 13 #dcdcdc #000000 0; +#X obj 78 303 cnv 17 3 130 empty \$0-pddp.cnv.let.0 0 5 9 0 16 #dcdcdc +#9c9c9c 0; +#X obj 78 450 cnv 17 3 17 empty \$0-pddp.cnv.let.n l 5 9 0 16 #dcdcdc +#9c9c9c 0; +#X obj 78 472 cnv 17 3 17 empty \$0-pddp.cnv.let.r r 5 9 0 16 #dcdcdc +#9c9c9c 0; +#X text 98 450 signal; +#X obj 4 597 pddp/pddplink all_about_help_patches.pd -text Usage Guide ; -#X text 287 518 Program change ( prog or p + chan + value); -#X text 170 246 Note messages start with note \, n or with nothing -(pure list input): chan + note + velocity; -#X obj 36 34 cnv 15 102 32 empty empty empty 20 12 1 14 -1 -66577 0 +#X obj 492 12 fluid~; +#X text 11 23 soundfont synthesizer based on fluidsynth; +#X obj 14 118 output~; +#X obj 14 89 fluid~ -smmf TimGM6mb; +#X text 164 61 Download Tim Brechbill's small (~6MB) GM soundfont here: ; -#X obj 37 35 cnv 15 100 30 empty empty fluid~ 20 15 1 14 -257472 -66577 -0; -#X obj 593 18 cnv 15 374 160 empty empty empty 20 12 1 14 -1 -66577 -0; -#X text 181 120 load soundfonts. Creation argument is possible as well: +#X obj 164 91 pddp/pddplink https://musescore.org/en/handbook/soundfonts-and-sfz-files#list +-text More soundfonts here (musescore.org); +#X obj 14 60 r \$0-fluid; +#X msg 90 60 help; +#X text 98 473 signal; +#X text 168 449 - [fluid~] outputs a stereo signal to its two signal +outlets.; +#X text 79 519 1) -smmf; +#X text 79 536 2) symbol; +#X text 168 519 - (optional) enables SMMF mode.; +#X text 98 303 sym f f f; +#X text 180 390 - load the given soundfont file (automatic .sf2 extension). ; -#X obj 594 19 cnv 15 372 158 empty Notes Soundfonts 20 12 1 14 -228992 --66577 0; -#X msg 650 109 load /usr/lib/awe/sfbank/2gmgsmt.sf2; -#X msg 644 89 load \$1; -#X obj 644 67 openpanel; -#X obj 644 47 bng 15 250 50 0 empty empty empty 0 -6 0 8 -260818 -1 --1; -#X obj 629 134 s \$0-iiwu; -#X obj 375 146 fluid~ notavail.sf2; -#X obj 593 182 cnv 15 374 160 empty empty empty 20 12 1 14 -1 -66577 -0; -#X obj 594 183 cnv 15 372 158 empty Notes Notes 20 12 1 14 -228992 --66577 0; -#X obj 837 224 notein; -#X obj 837 246 pack 0 0 0; -#X msg 695 288 n 1 60 0; -#X obj 640 311 s \$0-iiwu; -#X obj 695 244 bang; -#X msg 837 268 \$3 \$1 \$2; -#X obj 837 290 s \$0-iiwu; -#X obj 593 345 cnv 15 374 160 empty empty empty 20 12 1 14 -1 -66577 -0; -#X text 159 413 Controller Change: control or c or cc + chan + cc# -+ value; -#X obj 594 346 cnv 15 372 158 empty Notes Controller_Change/Pitch_Bend -20 12 1 14 -228992 -66577 0; -#X obj 632 473 s \$0-iiwu; -#X floatatom 632 388 5 0 0 0 - - -, f 5; -#X msg 649 441 c 2 \$1; -#X msg 632 407 control 1 2 \$1; -#X obj 593 509 cnv 15 374 160 empty empty empty 20 12 1 14 -1 -66577 +#X text 168 536 - (optional) any other symbol specifies a soundfont +file to be loaded at creation time.; +#X text 216 415 - reinitialize \, load the given soundfont file if +any.; +#X obj 15 196 notein; +#X obj 15 221 pack 0 0 0; +#X msg 15 246 \$3 \$1 \$2; +#X text 15 172 MIDI input (legacy mode):; +#X obj 95 221 pack 0 0 0; +#X obj 95 196 ctlin; +#X obj 175 196 bendin 0 1; +#X obj 175 221 pack 0 0; +#X msg 95 246 cc \$3 \$2 \$1; +#X floatatom 264 221 5 0 0 0 - - -, f 5; +#X msg 264 245 prog 1 \$1; +#X floatatom 341 221 5 0 0 0 - - -, f 5; +#X msg 341 245 bank 1 \$1; +#X text 261 200 prog change; +#X text 339 200 bank select; +#X msg 175 246 b \$2 \$1; +#X obj 15 271 s \$0-legacy; +#N canvas 769 250 453 354 switch 0; +#X obj 40 110 r \$0-legacy; +#X obj 40 135 spigot 1; +#X obj 121 110 r \$0-smmf; +#X obj 121 135 spigot; +#X obj 85 15 inlet; +#X obj 85 40 t f f; +#X obj 85 65 == 0; +#X obj 154 65 != 0; +#X obj 40 160 outlet; +#X connect 0 0 1 0; +#X connect 1 0 8 0; +#X connect 2 0 3 0; +#X connect 3 0 8 0; +#X connect 4 0 5 0; +#X connect 5 0 6 0; +#X connect 5 1 7 0; +#X connect 6 0 1 1; +#X connect 7 0 3 1; +#X restore 460 159 pd switch; +#X obj 460 134 tgl 15 0 empty empty smmf-mode 17 7 0 10 #fcfcfc #000000 +#000000 0 1; +#X obj 460 184 s \$0-fluid; +#X obj 460 86 midi-input; +#X obj 460 111 s \$0-smmf; +#X text 182 113 SMMF mode supports all voice messages and sysex (useful +for transmitting MTS tuning data). This is usually to be preferred +because it offers more capabilities. See:, f 42; +#X text 168 303 - MIDI message. In "legacy" mode (default) \, args +are channel \, first and second data byte (if any) \, and the supported +message selectors are (shortcuts in parentheses): note (n \, list) +\, control (c \, cc) \, prog (p). In SMMF mode (-smmf) \, all SMMF +voice messages and sysex are supported (most legacy messages still +continue to work as well)., f 62; +#X obj 264 270 s \$0-fluid; +#N canvas 1990 266 450 302 generators 0; +#X obj 22 64 cnv 15 302 110 empty empty empty 20 12 1 14 #000000 #404040 0; -#X obj 594 510 cnv 15 372 158 empty Notes Program_Change 20 12 1 14 --228992 -66577 0; -#X obj 703 627 s \$0-iiwu; -#X msg 703 580 prog 1 \$1; -#X msg 783 580 p 2 \$1; -#X floatatom 703 550 5 0 0 0 - - -, f 5; -#X obj 695 202 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 --1; -#X floatatom 783 550 5 0 0 0 - - -, f 5; -#X floatatom 673 388 5 0 0 0 - - -, f 5; -#X msg 695 222 note 1 60 120; -#X obj 741 388 ctlin; -#X obj 741 410 pack 0 0 0; -#X obj 856 396 bendin; -#X obj 856 418 pack 0 0; -#X obj 856 462 s \$0-iiwu; -#X msg 856 440 bend \$2 \$1; -#X text 159 445 Pitch Bend works the same: bend or b + chan + val; -#X msg 857 574 bank 1 \$1; -#X floatatom 857 555 5 0 0 0 - - -, f 5; -#X text 857 595 bank select; -#X obj 789 187 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; -#X obj 715 187 metro 1000; -#X obj 40 261 cnv 15 102 32 empty empty empty 20 12 1 14 -1 -66577 -0; -#X obj 41 262 cnv 15 100 30 empty empty empty 20 15 1 14 -257472 -66577 -0; -#X obj 66 199 r \$0-iiwu; -#X msg 66 233 help; -#X msg 146 217 init /usr/lib/awe/sfbank/2gmgsmt.sf2; -#X obj 66 269 fluid~; -#X text 145 185 init [soundfont] can (re)initialize fluid~ for example -to adapt to new samplerates.; -#X msg 741 432 cc \$3 \$2 \$1; -#X obj 203 617 cnv 15 302 110 empty empty empty 20 12 1 14 -1 -66577 -0; -#X obj 204 618 cnv 15 300 108 empty Notes generators 20 12 1 14 -228992 --66577 0; -#X msg 231 682 gen 1 \$2 \$1; -#X obj 231 704 s \$0-iiwu; -#X floatatom 289 642 5 0 60 0 - - -, f 5; -#X floatatom 231 642 5 0 0 0 - - -, f 5; -#X obj 231 662 pack 0 17; -#X text 78 607 gen 17 is "pan".; -#X text 78 594 Setting generators like for example:; -#X obj 695 266 del 1000; -#X symbolatom 343 684 20 0 0 0 - - -, f 20; -#X obj 343 656 fluid.gen2sym; -#X text 345 700 a little helper; -#N canvas 402 274 605 444 dust 0; +#X obj 23 65 cnv 15 300 108 empty Notes generators 20 12 1 14 #dce4fc +#404040 0; +#X msg 50 129 gen 1 \$2 \$1; +#X floatatom 108 89 5 0 60 0 - - -, f 5; +#X floatatom 50 89 5 0 0 0 - - -, f 5; +#X obj 50 109 pack 0 17; +#X text 23 32 gen 17 is "pan".; +#X text 23 19 Setting generators like for example:; +#X symbolatom 162 131 20 0 0 0 - - -, f 20; +#X obj 162 103 fluid.gen2sym; +#X text 164 147 a little helper; +#X obj 50 151 s \$0-fluid; +#X connect 2 0 11 0; +#X connect 3 0 5 1; +#X connect 3 0 9 0; +#X connect 4 0 5 0; +#X connect 5 0 2 0; +#X connect 9 0 8 0; +#X restore 435 214 pd generators; +#X text 435 239 A composition:; +#N canvas 400 273 610 524 dust 0; #X obj 119 135 del 10; -#X obj 119 41 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 -; +#X obj 119 41 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 +0 1; #X floatatom 386 66 5 0 0 1 dustiness - -, f 5; #X floatatom 386 164 5 0 0 1 note_range - -, f 5; #X floatatom 387 198 5 0 0 1 note_center - -, f 5; -#X obj 237 417 s \$0-iiwu; #X obj 387 242 / 2; #X floatatom 387 223 5 0 0 1 pan_mod - -, f 5; #X msg 237 281 gen 1 17 \$1; @@ -112,7 +144,6 @@ to adapt to new samplerates.; #X obj 119 273 pack 0 0; #X obj 119 63 metro; #X obj 126 339 pack 0 0; -#X msg 126 371 note 1 \$1 \$2; #X obj 119 251 makenote 100 2; #X obj 119 212 + 60; #X obj 119 178 random 24; @@ -121,80 +152,61 @@ to adapt to new samplerates.; #X obj 198 108 t f f; #X text 98 11 Inspired by Hans-Christoph Steiner and Derek Holzer; #X text 15 11 __Dust__; -#X connect 0 0 9 0; -#X connect 0 0 17 0; -#X connect 1 0 12 0; -#X connect 2 0 18 1; -#X connect 3 0 17 1; -#X connect 4 0 16 1; -#X connect 6 0 10 1; -#X connect 7 0 6 0; -#X connect 7 0 9 1; -#X connect 8 0 5 0; -#X connect 9 0 10 0; -#X connect 10 0 8 0; -#X connect 11 0 19 0; -#X connect 12 0 0 0; -#X connect 12 0 18 0; -#X connect 13 0 14 0; -#X connect 14 0 5 0; -#X connect 15 0 11 0; -#X connect 15 1 11 1; -#X connect 16 0 15 0; -#X connect 17 0 16 0; -#X connect 18 0 20 0; -#X connect 19 1 13 0; -#X connect 19 2 13 1; -#X connect 20 0 0 1; -#X restore 709 715 pd dust; -#X text 601 716 A composition:; -#X msg 705 87 load /home/ico/Downloads/Soundfonts/jRhodes3.sf2; -#X obj 66 320 output~; -#X connect 9 0 13 0; -#X connect 10 0 13 0; -#X connect 11 0 10 0; -#X connect 12 0 11 0; -#X connect 17 0 18 0; -#X connect 17 1 18 1; -#X connect 17 2 18 2; -#X connect 18 0 22 0; -#X connect 19 0 20 0; -#X connect 21 0 70 0; -#X connect 22 0 23 0; -#X connect 28 0 30 0; -#X connect 29 0 27 0; -#X connect 30 0 27 0; +#X obj 237 417 s \$0-fluid; +#X msg 126 371 1 \$1 \$2; +#X connect 0 0 8 0; +#X connect 0 0 15 0; +#X connect 1 0 11 0; +#X connect 2 0 16 1; +#X connect 3 0 15 1; +#X connect 4 0 14 1; +#X connect 5 0 9 1; +#X connect 6 0 5 0; +#X connect 6 0 8 1; +#X connect 7 0 21 0; +#X connect 8 0 9 0; +#X connect 9 0 7 0; +#X connect 10 0 17 0; +#X connect 11 0 0 0; +#X connect 11 0 16 0; +#X connect 12 0 22 0; +#X connect 13 0 10 0; +#X connect 13 1 10 1; +#X connect 14 0 13 0; +#X connect 15 0 14 0; +#X connect 16 0 18 0; +#X connect 17 1 12 0; +#X connect 17 2 12 1; +#X connect 18 0 0 1; +#X connect 22 0 21 0; +#X restore 435 259 pd dust; +#X obj 182 169 pddp/pddplink https://bitbucket.org/agraef/pd-smmf; +#X text 86 390 load sf-file; +#X text 86 415 init [-smmf] sf-file; +#X obj 164 78 pddp/pddplink http://sourceforge.net/p/mscore/code/HEAD/tree/trunk/mscore/share/sound/TimGM6mb.sf2?format=raw +-text TimGM6mb.sf2 (sf.net); +#X connect 15 0 14 0; +#X connect 15 1 14 1; +#X connect 18 0 15 0; +#X connect 19 0 15 0; +#X connect 29 0 30 0; +#X connect 29 1 30 1; +#X connect 29 2 30 2; +#X connect 30 0 31 0; +#X connect 31 0 45 0; +#X connect 33 0 37 0; #X connect 34 0 33 0; -#X connect 35 0 33 0; -#X connect 36 0 34 0; -#X connect 37 0 40 0; -#X connect 38 0 35 0; -#X connect 39 0 29 0; -#X connect 40 0 20 0; -#X connect 40 0 21 0; -#X connect 41 0 42 0; -#X connect 41 1 42 1; -#X connect 41 2 42 2; -#X connect 42 0 60 0; -#X connect 43 0 44 0; -#X connect 43 1 44 1; -#X connect 44 0 46 0; -#X connect 46 0 45 0; -#X connect 48 0 33 0; -#X connect 49 0 48 0; -#X connect 51 0 52 0; -#X connect 52 0 37 0; -#X connect 55 0 58 0; -#X connect 56 0 58 0; -#X connect 57 0 58 0; -#X connect 58 0 77 0; -#X connect 58 1 77 1; -#X connect 60 0 27 0; -#X connect 63 0 64 0; -#X connect 65 0 67 1; -#X connect 65 0 72 0; -#X connect 66 0 67 0; -#X connect 67 0 63 0; -#X connect 70 0 19 0; -#X connect 72 0 71 0; -#X connect 76 0 13 0; +#X connect 34 1 33 1; +#X connect 34 2 33 2; +#X connect 35 0 36 0; +#X connect 35 1 36 1; +#X connect 36 0 44 0; +#X connect 37 0 45 0; +#X connect 38 0 39 0; +#X connect 39 0 53 0; +#X connect 40 0 41 0; +#X connect 41 0 53 0; +#X connect 44 0 45 0; +#X connect 46 0 48 0; +#X connect 47 0 46 0; +#X connect 49 0 50 0; diff --git a/externals/fluid~/fluid~.c b/externals/fluid~/fluid~.c index 8aca760cf1553c87f14a5bd4d53030be6f16341d..f9ab423a55521006bd0fa25d418e0a961bbf148f 100644 --- a/externals/fluid~/fluid~.c +++ b/externals/fluid~/fluid~.c @@ -1,4 +1,11 @@ +// Original version by Frank Barknecht (fbar@footils.org) 2003 +// Ported from Flext/C++ to plain C/pdlibbuilder by Jonathan Wilkes 2016 +// SMMF mode and various other little improvements by Albert Gräf 2020 +// Distributed under the GPLv2+, please check the LICENSE file for details. + #include <fluidsynth.h> +#include <string.h> +#include <unistd.h> #include "m_pd.h" @@ -10,8 +17,10 @@ typedef struct _fluid_tilde { fluid_settings_t *x_settings; t_outlet *x_out_left; t_outlet *x_out_right; + t_canvas *x_canvas; + int smmf_mode; } t_fluid_tilde; - + t_int *fluid_tilde_perform(t_int *w) { t_fluid_tilde *x = (t_fluid_tilde *)(w[1]); @@ -33,18 +42,20 @@ static void fluid_tilde_dsp(t_fluid_tilde *x, t_signal **sp) static void fluid_tilde_free(t_fluid_tilde *x) { - outlet_free(x->x_out_left); - outlet_free(x->x_out_right); + if (x->x_synth) delete_fluid_synth(x->x_synth); + if (x->x_settings) delete_fluid_settings(x->x_settings); } static void fluid_help(void) { const char * helptext = - "_ __fluid~_ _ a soundfont external for Pd and Max/MSP \n" - "_ argument: \"/path/to/soundfont.sf\" to load on object creation\n" - "_ messages: \n" - "load /path/to/soundfont.sf2 --- Loads a Soundfont \n" - "note 0 0 0 --- Play note. Arguments: \n" + "fluid~: a soundfont external for Pd and Max/MSP\n" + "options:\n" + "-smmf: enable SMMF mode (https://bitbucket.org/agraef/pd-smmf)\n" + "any other symbol: soundfont file to load on object creation\n" + "messages:\n" + "load /path/to/soundfont.sf2 --- Loads a Soundfont\n" + "note 0 0 0 --- Play note, arguments:\n" " channel-# note-# veloc-#\n" "n 0 0 0 --- Play note, same as above\n" "0 0 0 --- Play note, same as above\n" @@ -57,7 +68,7 @@ static void fluid_help(void) post("%s", helptext); } -static void fluid_note(t_fluid_tilde *x, t_symbol *s, int argc, t_atom *argv) +static void fluid_legacy_note(t_fluid_tilde *x, t_symbol *s, int argc, t_atom *argv) { if (x->x_synth == NULL) return; if (argc == 3) @@ -70,7 +81,7 @@ static void fluid_note(t_fluid_tilde *x, t_symbol *s, int argc, t_atom *argv) } } -static void fluid_program_change(t_fluid_tilde *x, t_symbol *s, int argc, +static void fluid_legacy_program_change(t_fluid_tilde *x, t_symbol *s, int argc, t_atom *argv) { if (x->x_synth == NULL) return; @@ -79,11 +90,11 @@ static void fluid_program_change(t_fluid_tilde *x, t_symbol *s, int argc, int chan, prog; chan = atom_getintarg(0, argc, argv); prog = atom_getintarg(1, argc, argv); - fluid_synth_program_change(x->x_synth, chan - 1, prog); + fluid_synth_program_change(x->x_synth, chan - 1, prog - 1); } } -static void fluid_control_change(t_fluid_tilde *x, t_symbol *s, int argc, +static void fluid_legacy_control_change(t_fluid_tilde *x, t_symbol *s, int argc, t_atom *argv) { if (x->x_synth == NULL) return; @@ -97,7 +108,7 @@ static void fluid_control_change(t_fluid_tilde *x, t_symbol *s, int argc, } } -static void fluid_pitch_bend(t_fluid_tilde *x, t_symbol *s, int argc, +static void fluid_legacy_pitch_bend(t_fluid_tilde *x, t_symbol *s, int argc, t_atom *argv) { if (x->x_synth == NULL) return; @@ -110,7 +121,7 @@ static void fluid_pitch_bend(t_fluid_tilde *x, t_symbol *s, int argc, } } -static void fluid_bank(t_fluid_tilde *x, t_symbol *s, int argc, t_atom *argv) +static void fluid_legacy_bank(t_fluid_tilde *x, t_symbol *s, int argc, t_atom *argv) { if (x->x_synth == NULL) return; if (argc == 2) @@ -122,7 +133,7 @@ static void fluid_bank(t_fluid_tilde *x, t_symbol *s, int argc, t_atom *argv) } } -static void fluid_gen(t_fluid_tilde *x, t_symbol *s, int argc, t_atom *argv) +static void fluid_legacy_gen(t_fluid_tilde *x, t_symbol *s, int argc, t_atom *argv) { if (x->x_synth == NULL) return; if (argc == 3) @@ -136,27 +147,160 @@ static void fluid_gen(t_fluid_tilde *x, t_symbol *s, int argc, t_atom *argv) } } +// Note that in all the SMMF methods we allow the channel to be omitted, in +// which case it defaults to 1. Also note that the channel argument *always* +// comes last, and that the argument order, being in 1-1 correspondence with +// the Pd MIDI objects, is a bit different from the legacy message format +// above which follows the MIDI standard instead. + +// The system realtime messages start, stop, and cont are in SMMF, but not +// recognized by fluidsynth, so we don't support them here either. (MTS) sysex +// messages (which fluidsynth recognizes) are supported, however. + +// Please check https://bitbucket.org/agraef/pd-smmf for details. + +static void fluid_note(t_fluid_tilde *x, t_symbol *s, int argc, t_atom *argv) +{ + if (!x->smmf_mode) + { + fluid_legacy_note(x, s, argc, argv); return; + } + if (x->x_synth == NULL) return; + if (argc == 2 || argc == 3) + { + int key = atom_getintarg(0, argc, argv); + int vel = atom_getintarg(1, argc, argv); + int chan = argc>2 ? atom_getintarg(2, argc, argv) : 1; + fluid_synth_noteon(x->x_synth, chan - 1, key, vel); + } +} + +static void fluid_ctl(t_fluid_tilde *x, t_symbol *s, int argc, t_atom *argv) +{ + if (!x->smmf_mode || x->x_synth == NULL) return; + if (argc == 2 || argc == 3) + { + int val = atom_getintarg(0, argc, argv); + int ctrl = atom_getintarg(1, argc, argv); + int chan = argc>2 ? atom_getintarg(2, argc, argv) : 1; + fluid_synth_cc(x->x_synth, chan - 1, ctrl, val); + } +} + +static void fluid_pgm(t_fluid_tilde *x, t_symbol *s, int argc, t_atom *argv) +{ + if (!x->smmf_mode || x->x_synth == NULL) return; + if (argc == 1 || argc == 2) + { + int prog = atom_getintarg(0, argc, argv); + int chan = argc>1 ? atom_getintarg(1, argc, argv) : 1; + fluid_synth_program_change(x->x_synth, chan - 1, prog - 1); + } +} + +static void fluid_polytouch(t_fluid_tilde *x, t_symbol *s, int argc, t_atom *argv) +{ + if (!x->smmf_mode || x->x_synth == NULL) return; + if (argc == 2 || argc == 3) + { + int val = atom_getintarg(0, argc, argv); + int key = atom_getintarg(1, argc, argv); + int chan = argc>2 ? atom_getintarg(2, argc, argv) : 1; + fluid_synth_key_pressure(x->x_synth, chan - 1, key, val); + } +} + +static void fluid_touch(t_fluid_tilde *x, t_symbol *s, int argc, t_atom *argv) +{ + if (!x->smmf_mode || x->x_synth == NULL) return; + if (argc == 1 || argc == 2) + { + int val = atom_getintarg(0, argc, argv); + int chan = argc>1 ? atom_getintarg(1, argc, argv) : 1; + fluid_synth_channel_pressure(x->x_synth, chan - 1, val); + } +} + +static void fluid_bend(t_fluid_tilde *x, t_symbol *s, int argc, t_atom *argv) +{ + if (!x->smmf_mode) + { + fluid_legacy_pitch_bend(x, s, argc, argv); return; + } + if (x->x_synth == NULL) return; + if (argc == 1 || argc == 2) + { + int val = atom_getintarg(0, argc, argv); + int chan = argc>1 ? atom_getintarg(1, argc, argv) : 1; + fluid_synth_pitch_bend(x->x_synth, chan - 1, val); + } +} + +// Maximum size of sysex data (excluding the f0 and f7 bytes) that we can +// handle. The size below should be plenty to handle any kind of MTS message, +// which at the time of this writing is the only kind of sysex message +// recognized by fluidsynth. +#define MAXSYSEXSIZE 1024 + +static void fluid_sysex(t_fluid_tilde *x, t_symbol *s, int argc, t_atom *argv) +{ + if (!x->smmf_mode || x->x_synth == NULL) return; + if (argc > 0) + { + char buf[MAXSYSEXSIZE]; + int len = 0; + while (len < MAXSYSEXSIZE && len < argc) { + buf[len] = atom_getintarg(len, argc, argv); + len++; + } + // TODO: In order to handle bulk dump requests in the future, we will + // have to pick up fluidsynth's response here and output that to a + // control outlet (which doesn't exist at present). + fluid_synth_sysex(x->x_synth, buf, len, NULL, NULL, NULL, 0); + } +} + static void fluid_load(t_fluid_tilde *x, t_symbol *s, int argc, t_atom *argv) { if (x->x_synth == NULL) { - post("No fluidsynth"); + pd_error(x, "fluid~: no fluidsynth"); return; } if (argc >= 1 && argv->a_type == A_SYMBOL) { const char* filename = atom_getsymbolarg(0, argc, argv)->s_name; - if (fluid_synth_sfload(x->x_synth, filename, 0) >= 0) + const char* ext = strrchr(filename, '.'); + if (ext && !strchr(ext, '/')) + // extension already supplied, no default extension + ext = ""; + else + ext = ".sf2"; + char realdir[MAXPDSTRING], *realname = NULL; + int fd = canvas_open(x->x_canvas, filename, ext, realdir, + &realname, MAXPDSTRING, 0); + if (fd < 0) { + pd_error(x, "fluid~: can't find soundfont %s", filename); + return; + } + // Save the current working directory. + char buf[MAXPDSTRING], *cwd = getcwd(buf, MAXPDSTRING); + sys_close(fd); + if (chdir(realdir)) {} + if (fluid_synth_sfload(x->x_synth, realname, 0) >= 0) { - post("Loaded Soundfont: %s", filename); + post("fluid~: loaded soundfont %s", realname); fluid_synth_program_reset(x->x_synth); } + // Restore the working directory. + cwd && chdir(cwd); } } static void fluid_init(t_fluid_tilde *x, t_symbol *s, int argc, t_atom *argv) { if (x->x_synth) delete_fluid_synth(x->x_synth); + if (x->x_settings) delete_fluid_settings(x->x_settings); float sr = sys_getsr(); @@ -164,7 +308,7 @@ static void fluid_init(t_fluid_tilde *x, t_symbol *s, int argc, t_atom *argv) if (x->x_settings == NULL) { - post("fluid~: couldn't create synth settings\n"); + pd_error(x, "fluid~: couldn't create synth settings\n"); } else { @@ -186,24 +330,31 @@ static void fluid_init(t_fluid_tilde *x, t_symbol *s, int argc, t_atom *argv) x->x_synth = new_fluid_synth(x->x_settings); if (x->x_synth == NULL ) { - post("fluid~: couldn't create synth\n"); + pd_error(x, "fluid~: couldn't create synth"); + } + // check for SMMF mode + const char* arg = atom_getsymbolarg(0, argc, argv)->s_name; + if (strcmp(arg, "-smmf") == 0) + { + x->smmf_mode = 1; argc--; argv++; } // try to load argument as soundfont fluid_load(x, gensym("load"), argc, argv); - //if (settings != NULL ) - // delete_fluid_settings(settings); // We're done constructing: if (x->x_synth) - post("-- fluid~ for Pd ---"); + post("-- fluid~ for Pd%s --", x->smmf_mode?" (SMMF mode)":""); } } static void *fluid_tilde_new(t_symbol *s, int argc, t_atom *argv) { t_fluid_tilde *x = (t_fluid_tilde *)pd_new(fluid_tilde_class); + x->x_synth = NULL; x->x_settings = NULL; x->x_out_left = outlet_new(&x->x_obj, &s_signal); x->x_out_right = outlet_new(&x->x_obj, &s_signal); + x->smmf_mode = 0; + x->x_canvas = canvas_getcurrent(); fluid_init(x, gensym("init"), argc, argv); return (void *)x; } @@ -211,38 +362,67 @@ static void *fluid_tilde_new(t_symbol *s, int argc, t_atom *argv) void fluid_tilde_setup(void) { fluid_tilde_class = class_new(gensym("fluid~"), - (t_newmethod)fluid_tilde_new, 0, sizeof(t_fluid_tilde), + (t_newmethod)fluid_tilde_new, (t_method)fluid_tilde_free, + sizeof(t_fluid_tilde), CLASS_DEFAULT, A_GIMME, 0); class_addmethod(fluid_tilde_class, (t_method)fluid_init, gensym("init"), A_GIMME, 0); class_addmethod(fluid_tilde_class, (t_method)fluid_load, gensym("load"), A_GIMME, 0); - class_addmethod(fluid_tilde_class, (t_method)fluid_note, gensym("note"), + + // "legacy" methods. These are 100% backwards-compatible, and are all + // enabled by default. NOTE: When in SMMF mode (-smmf), the "note" and + // "bend" messages actually invoke the corresponding SMMF methods below, + // while all other legacy methods still work (in particular, the "note" + // and "bend" shortcuts are still available). +#if 0 + class_addmethod(fluid_tilde_class, (t_method)fluid_legacy_note, gensym("note"), A_GIMME, 0); - class_addmethod(fluid_tilde_class, (t_method)fluid_program_change, +#endif + class_addmethod(fluid_tilde_class, (t_method)fluid_legacy_program_change, gensym("prog"), A_GIMME, 0); - class_addmethod(fluid_tilde_class, (t_method)fluid_control_change, + class_addmethod(fluid_tilde_class, (t_method)fluid_legacy_control_change, gensym("control"), A_GIMME, 0); - class_addmethod(fluid_tilde_class, (t_method)fluid_pitch_bend, +#if 0 + class_addmethod(fluid_tilde_class, (t_method)fluid_legacy_pitch_bend, gensym("bend"), A_GIMME, 0); - class_addmethod(fluid_tilde_class, (t_method)fluid_bank, gensym("bank"), +#endif + class_addmethod(fluid_tilde_class, (t_method)fluid_legacy_bank, gensym("bank"), A_GIMME, 0); - class_addmethod(fluid_tilde_class, (t_method)fluid_gen, gensym("gen"), + class_addmethod(fluid_tilde_class, (t_method)fluid_legacy_gen, gensym("gen"), A_GIMME, 0); - // list input calls fluid_note(...) - class_addlist(fluid_tilde_class, (t_method)fluid_note); + // list input calls fluid_legacy_note(...) + class_addlist(fluid_tilde_class, (t_method)fluid_legacy_note); // some alias shortcuts: - class_addmethod(fluid_tilde_class, (t_method)fluid_note, gensym("n"), + class_addmethod(fluid_tilde_class, (t_method)fluid_legacy_note, gensym("n"), A_GIMME, 0); - class_addmethod(fluid_tilde_class, (t_method)fluid_program_change, + class_addmethod(fluid_tilde_class, (t_method)fluid_legacy_program_change, gensym("p"), A_GIMME, 0); - class_addmethod(fluid_tilde_class, (t_method)fluid_control_change, + class_addmethod(fluid_tilde_class, (t_method)fluid_legacy_control_change, gensym("c"), A_GIMME, 0); - class_addmethod(fluid_tilde_class, (t_method)fluid_control_change, + class_addmethod(fluid_tilde_class, (t_method)fluid_legacy_control_change, gensym("cc"), A_GIMME, 0); - class_addmethod(fluid_tilde_class, (t_method)fluid_pitch_bend, gensym("b"), + class_addmethod(fluid_tilde_class, (t_method)fluid_legacy_pitch_bend, gensym("b"), + A_GIMME, 0); + + // SMMF methods (new interface methods for MIDI, enabled with -smmf) + // NOTE: When in the default legacy mode, fluid_note and fluid_bend + // actually invoke the corresponding legacy methods above. + class_addmethod(fluid_tilde_class, (t_method)fluid_note, gensym("note"), + A_GIMME, 0); + class_addmethod(fluid_tilde_class, (t_method)fluid_ctl, gensym("ctl"), + A_GIMME, 0); + class_addmethod(fluid_tilde_class, (t_method)fluid_pgm, gensym("pgm"), + A_GIMME, 0); + class_addmethod(fluid_tilde_class, (t_method)fluid_polytouch, gensym("polytouch"), + A_GIMME, 0); + class_addmethod(fluid_tilde_class, (t_method)fluid_touch, gensym("touch"), + A_GIMME, 0); + class_addmethod(fluid_tilde_class, (t_method)fluid_bend, gensym("bend"), + A_GIMME, 0); + class_addmethod(fluid_tilde_class, (t_method)fluid_sysex, gensym("sysex"), A_GIMME, 0); // Simulate Flext's help message diff --git a/externals/fluid~/makefile b/externals/fluid~/makefile index 1ff4c32fc0432589e3bad2b1ddc9b97f2db2cb46..6d425af85a8716a14103d0b48f7c343704ec9e97 100755 --- a/externals/fluid~/makefile +++ b/externals/fluid~/makefile @@ -6,6 +6,6 @@ class.sources = fluid~.c ldlibs = -lfluidsynth -datafiles = fluid~-help.pd fluid.gen2sym.pd simple_onthego_synth.pd fluid.gen.txt LICENSE README +datafiles = fluid~-help.pd fluid.gen2sym.pd midi-input.pd mts-tuning.pd simple_onthego_synth.pd fluid.gen.txt LICENSE README include Makefile.pdlibbuilder.revised diff --git a/externals/fluid~/midi-input.pd b/externals/fluid~/midi-input.pd new file mode 100644 index 0000000000000000000000000000000000000000..f436fbfd83aa7fbb6b23a9463d2b8568e11ce638 --- /dev/null +++ b/externals/fluid~/midi-input.pd @@ -0,0 +1,103 @@ +#N canvas 542 308 583 345 10; +#X obj 24 50 ctlin; +#X obj 24 71 pack f f f; +#X msg 24 92 ctl \$1 \$2 \$3; +#X obj 126 70 pack f f f; +#X obj 223 70 pack f f f; +#X obj 126 49 notein; +#X msg 126 91 note \$1 \$2 \$3; +#X obj 223 49 polytouchin; +#X msg 223 91 polytouch \$1 \$2 \$3; +#X obj 22 121 pgmin; +#X obj 22 142 pack f f; +#X msg 22 163 pgm \$1 \$2; +#X obj 126 142 pack f f; +#X obj 223 142 pack f f; +#X obj 126 121 bendin 0 1; +#X msg 126 163 bend \$1 \$2; +#X obj 223 121 touchin; +#X msg 223 163 touch \$1 \$2; +#X obj 21 193 midiin; +#X obj 21 214 sel 250 251 252; +#X msg 21 235 start; +#X msg 50 257 cont; +#X msg 79 237 stop; +#X obj 222 259 outlet; +#X obj 410 21 sysexin; +#X obj 410 51 sel 240; +#X msg 410 75 1; +#X obj 410 172 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 +1; +#X obj 449 76 spigot; +#X obj 449 103 moses 128; +#X msg 500 156 0; +#X obj 449 216 list prepend; +#X obj 410 194 swap 1; +#X obj 410 216 -; +#X obj 410 241 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 +1; +#X obj 300 254 spigot; +#X obj 500 128 t b b b; +#X obj 300 281 list prepend sysex; +#X obj 300 302 list trim; +#X text 320 316 sysex input - this is a bit tricky; +#X obj 536 241 t l; +#X text 20 7 This is a little helper patch which encodes MIDI messages +in a symbolic format used by some pd-pure plugins.; +#X connect 0 0 1 0; +#X connect 0 1 1 1; +#X connect 0 2 1 2; +#X connect 1 0 2 0; +#X connect 2 0 23 0; +#X connect 3 0 6 0; +#X connect 4 0 8 0; +#X connect 5 0 3 0; +#X connect 5 1 3 1; +#X connect 5 2 3 2; +#X connect 6 0 23 0; +#X connect 7 0 4 0; +#X connect 7 1 4 1; +#X connect 7 2 4 2; +#X connect 8 0 23 0; +#X connect 9 0 10 0; +#X connect 9 1 10 1; +#X connect 10 0 11 0; +#X connect 11 0 23 0; +#X connect 12 0 15 0; +#X connect 13 0 17 0; +#X connect 14 0 12 0; +#X connect 14 1 12 1; +#X connect 15 0 23 0; +#X connect 16 0 13 0; +#X connect 16 1 13 1; +#X connect 17 0 23 0; +#X connect 18 0 19 0; +#X connect 19 0 20 0; +#X connect 19 1 21 0; +#X connect 19 2 22 0; +#X connect 20 0 23 0; +#X connect 21 0 23 0; +#X connect 22 0 23 0; +#X connect 24 0 25 0; +#X connect 25 0 26 0; +#X connect 25 1 28 0; +#X connect 26 0 27 0; +#X connect 27 0 28 1; +#X connect 27 0 32 0; +#X connect 28 0 29 0; +#X connect 29 0 31 0; +#X connect 29 1 36 0; +#X connect 30 0 27 0; +#X connect 31 0 35 0; +#X connect 31 0 40 0; +#X connect 32 0 33 0; +#X connect 32 1 33 1; +#X connect 33 0 34 0; +#X connect 34 0 35 1; +#X connect 35 0 37 0; +#X connect 36 0 31 1; +#X connect 36 1 31 0; +#X connect 36 2 30 0; +#X connect 37 0 38 0; +#X connect 38 0 23 0; +#X connect 40 0 31 1; diff --git a/externals/fluid~/mts-tuning.pd b/externals/fluid~/mts-tuning.pd new file mode 100644 index 0000000000000000000000000000000000000000..a5feb0eed3bd6655408acea8d97e53bd83687a91 --- /dev/null +++ b/externals/fluid~/mts-tuning.pd @@ -0,0 +1,24 @@ +#N canvas 513 180 490 406 12; +#X obj 90 183 midi-input; +#X obj 33 262 output~; +#X obj 33 233 fluid~ -smmf TimGM6mb; +#X text 20 327 Download Tim Brechbill's small (~6MB) GM soundfont here: +; +#X obj 19 375 pddp/pddplink https://musescore.org/en/handbook/soundfonts-and-sfz-files#list +-text More soundfonts here (musescore.org); +#X obj 19 351 pddp/pddplink http://sourceforge.net/p/mscore/code/HEAD/tree/trunk/mscore/share/sound/TimGM6mb.sf2?format=raw +-text TimGM6mb.sf2 (sf.net); +#X msg 219 184 pgm 20 1 \, pgm 20 2 \, pgm 20 3; +#X msg 33 41 sysex 127 127 8 8 3 127 127 64 64 64 64 64 64 64 64 64 +64 64 64, f 33; +#X msg 33 91 sysex 127 127 8 8 3 127 127 74 50 67 85 61 78 54 71 47 64 81 57, f 33; +#X text 218 157 church organ on channels 1-3; +#X text 288 48 12-tet (default tuning); +#X text 286 91 quarter-comma meantone (has wolf fifth at Ab - Eb), +f 27; +#X connect 0 0 2 0; +#X connect 2 0 1 0; +#X connect 2 1 1 1; +#X connect 6 0 2 0; +#X connect 7 0 2 0; +#X connect 8 0 2 0; diff --git a/externals/fluid~/simple_onthego_synth.pd b/externals/fluid~/simple_onthego_synth.pd index f4227d17e52ce022e49d0c505e1a98beb86b4630..19de30e5201604ce3756c671d12e3e094a07ea5f 100644 --- a/externals/fluid~/simple_onthego_synth.pd +++ b/externals/fluid~/simple_onthego_synth.pd @@ -1,5 +1,4 @@ -#N canvas 480 117 389 508 10; -#X declare -lib maxlib; +#N canvas 480 116 390 511 10; #X obj 25 197 notein; #X obj 25 222 + 0; #X obj 25 20 key; @@ -7,16 +6,20 @@ #X msg 25 64 -12; #X msg 50 85 12; #X obj 25 117 +; -#X obj 109 134 nbx 3 88 -60 60 0 0 empty empty empty 0 -8 0 70 -262144 --1 -1 0 256 1; +#X obj 109 134 nbx 3 88 -60 60 0 0 empty empty empty 0 -8 0 70 #fcfcfc +#000000 #000000 0 256 1; #X obj 25 253 pack 0 0 0; #X msg 25 275 \$3 \$1 \$2; -#X obj 25 296 fluid~ /home/l2orkist/Downloads/Soundfonts/jRhodes3.sf2 +#X obj 139 295 loadbang; +#X obj 25 296 fluid~ TimGM6mb; +#X obj 25 357 output~; +#X msg 139 320 1; +#X text 24 431 Download Tim Brechbill's small (~6MB) GM soundfont here: ; -#X obj 26 377 l2ork_output~; -#X obj 105 334 loadbang; -#X obj 36 350 freeverb~; -#X obj 105 355 t 50 1; +#X obj 23 479 pddp/pddplink https://musescore.org/en/handbook/soundfonts-and-sfz-files#list +-text More soundfonts here (musescore.org); +#X obj 23 455 pddp/pddplink http://sourceforge.net/p/mscore/code/HEAD/tree/trunk/mscore/share/sound/TimGM6mb.sf2?format=raw +-text TimGM6mb.sf2 (sf.net); #X connect 0 0 1 0; #X connect 0 1 8 1; #X connect 0 2 8 2; @@ -30,10 +33,8 @@ #X connect 7 0 6 1; #X connect 7 0 1 1; #X connect 8 0 9 0; -#X connect 9 0 10 0; +#X connect 9 0 11 0; #X connect 10 0 13 0; -#X connect 10 0 11 0; -#X connect 12 0 14 0; -#X connect 13 0 11 0; -#X connect 14 0 11 6; -#X connect 14 1 11 7; +#X connect 11 0 12 0; +#X connect 11 1 12 1; +#X connect 13 0 12 2; diff --git a/externals/footils/knob/knob.c b/externals/footils/knob/knob.c index bdb953e032ee15222f3ef2b3190c766c9a899c0e..78b8ce140f11e5dc1778bd1fd83ce98d8160e4eb 100644 --- a/externals/footils/knob/knob.c +++ b/externals/footils/knob/knob.c @@ -528,7 +528,7 @@ static void knob_click(t_knob *x, t_floatarg xpos, t_floatarg ypos, (*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE); knob_bang(x); glist_grab(x->x_gui.x_glist, &x->x_gui.x_obj.te_g, (t_glistmotionfn)knob_motion, - 0, xpos, ypos); + 0, 0, xpos, ypos); } static int knob_newclick(t_gobj *z, struct _glist *glist, diff --git a/externals/ggee/gui/button.c b/externals/ggee/gui/button.c index 883e89f48d9f1913d6d501c62c9f287ae9eaeb80..78f0e92f732bef7a4e5888e54b1e44ad61d63fe8 100644 --- a/externals/ggee/gui/button.c +++ b/externals/ggee/gui/button.c @@ -44,13 +44,13 @@ static void draw_inlets(t_button *x, t_glist *glist, int firsttime, int nin, int { int onset = text_xpix(&x->x_obj, glist) + (x->x_rect_width - IOWIDTH) * i / nplus; if (firsttime) - sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags { %lxo%d %lxS }\n", + sys_vgui(".x%zx.c create rectangle %d %d %d %d -tags { %zxo%d %zxS }\n", glist_getcanvas(glist), onset, text_ypix(&x->x_obj, glist) + x->x_rect_height - 2, onset + IOWIDTH, text_ypix(&x->x_obj, glist) + x->x_rect_height-1, x, i, x); else - sys_vgui(".x%lx.c coords %lxo%d %d %d %d %d\n", + sys_vgui(".x%zx.c coords %zxo%d %d %d %d %d\n", glist_getcanvas(glist), x, i, onset, text_ypix(&x->x_obj, glist) + x->x_rect_height - 2, onset + IOWIDTH, text_ypix(&x->x_obj, glist) + x->x_rect_height-1); @@ -61,13 +61,13 @@ static void draw_inlets(t_button *x, t_glist *glist, int firsttime, int nin, int { int onset = text_xpix(&x->x_obj, glist) + (x->x_rect_width - IOWIDTH) * i / nplus; if (firsttime) - sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags { %lxi%d %lxS }\n", + sys_vgui(".x%zx.c create rectangle %d %d %d %d -tags { %zxi%d %zxS }\n", glist_getcanvas(glist), onset, text_ypix(&x->x_obj, glist), onset + IOWIDTH, text_ypix(&x->x_obj, glist)+5, x, i, x); else - sys_vgui(".x%lx.c coords %lxi%d %d %d %d %d\n", + sys_vgui(".x%zx.c coords %zxi%d %d %d %d %d\n", glist_getcanvas(glist), x, i, onset, text_ypix(&x->x_obj, glist), onset + IOWIDTH, text_ypix(&x->x_obj, glist)+5); @@ -81,13 +81,13 @@ static void draw_handle(t_button *x, t_glist *glist, int firsttime) { int onset = text_xpix(&x->x_obj, glist) + (x->x_rect_width - IOWIDTH+2); if (firsttime) - sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags { %lxhandle %lxS }\n", + sys_vgui(".x%zx.c create rectangle %d %d %d %d -tags { %zxhandle %zxS }\n", glist_getcanvas(glist), onset, text_ypix(&x->x_obj, glist) + x->x_rect_height - 12, onset + IOWIDTH-2, text_ypix(&x->x_obj, glist) + x->x_rect_height-4, x, x); else - sys_vgui(".x%lx.c coords %lxhandle %d %d %d %d\n", + sys_vgui(".x%zx.c coords %zxhandle %d %d %d %d\n", glist_getcanvas(glist), x, onset, text_ypix(&x->x_obj, glist) + x->x_rect_height - 12, onset + IOWIDTH-2, text_ypix(&x->x_obj, glist) + x->x_rect_height-4); @@ -107,8 +107,8 @@ static void create_widget(t_button *x, t_glist *glist) if (text[i] == '_') text[i] = ' '; } - sys_vgui("destroy .x%lx.c.s%lx\n",glist_getcanvas(glist),x); - sys_vgui("button .x%lx.c.s%lx -height %d -text \"%s\" -command button_cb%lx\n",canvas,x, + sys_vgui("destroy .x%zx.c.s%zx\n",glist_getcanvas(glist),x); + sys_vgui("button .x%zx.c.s%zx -height %d -text \"%s\" -command button_cb%zx\n",canvas,x, x->x_height,text, x); } @@ -122,17 +122,17 @@ static void button_drawme(t_button *x, t_glist *glist, int firsttime) t_canvas *canvas=glist_getcanvas(glist); DEBUG(post("drawme %d",firsttime);) if (firsttime) { - DEBUG(post("glist %lx canvas %lx",x->x_glist,canvas);) + DEBUG(post("glist %zx canvas %zx",x->x_glist,canvas);) // if (x->x_glist != canvas) { create_widget(x,glist); x->x_glist = canvas; // } - sys_vgui(".x%lx.c create window %d %d -anchor nw -window .x%lx.c.s%lx -tags %lxS\n", + sys_vgui(".x%zx.c create window %d %d -anchor nw -window .x%zx.c.s%zx -tags %zxS\n", canvas,text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist),x->x_glist,x,x); } else { - sys_vgui(".x%lx.c coords %lxS \ + sys_vgui(".x%zx.c coords %zxS \ %d %d\n", canvas, x, text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist)); @@ -148,15 +148,15 @@ static void button_erase(t_button* x,t_glist* glist) int n; DEBUG(post("erase");) - sys_vgui("destroy .x%lx.c.s%lx\n",glist_getcanvas(glist),x); + sys_vgui("destroy .x%zx.c.s%zx\n",glist_getcanvas(glist),x); - sys_vgui(".x%lx.c delete %lxS\n",glist_getcanvas(glist), x); + sys_vgui(".x%zx.c delete %zxS\n",glist_getcanvas(glist), x); /* inlets and outlets */ - sys_vgui(".x%lx.c delete %lxi%d\n",glist_getcanvas(glist),x,0); - sys_vgui(".x%lx.c delete %lxo%d\n",glist_getcanvas(glist),x,0); - sys_vgui(".x%lx.c delete %lxhandle\n",glist_getcanvas(glist),x,0); + sys_vgui(".x%zx.c delete %zxi%d\n",glist_getcanvas(glist),x,0); + sys_vgui(".x%zx.c delete %zxo%d\n",glist_getcanvas(glist),x,0); + sys_vgui(".x%zx.c delete %zxhandle\n",glist_getcanvas(glist),x,0); } @@ -187,7 +187,7 @@ static void button_displace(t_gobj *z, t_glist *glist, x->x_obj.te_ypix += dy; if (glist_isvisible(glist)) { - sys_vgui(".x%lx.c coords %lxSEL %d %d %d %d\n", + sys_vgui(".x%zx.c coords %zxSEL %d %d %d %d\n", glist_getcanvas(glist), x, text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist)-1, text_xpix(&x->x_obj, glist) + x->x_rect_width, text_ypix(&x->x_obj, glist) + x->x_rect_height-2); @@ -202,18 +202,18 @@ static void button_select(t_gobj *z, t_glist *glist, int state) { t_button *x = (t_button *)z; if (state) { - sys_vgui(".x%lx.c create rectangle \ -%d %d %d %d -tags { %lxSEL %lxS } -outline $select_color\n", + sys_vgui(".x%zx.c create rectangle \ +%d %d %d %d -tags { %zxSEL %zxS } -outline $select_color\n", glist_getcanvas(glist), text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist)-1, text_xpix(&x->x_obj, glist) + x->x_rect_width, text_ypix(&x->x_obj, glist) + x->x_rect_height-2, x, x); - sys_vgui(".x%x.c addtag selected withtag %lxS\n", glist_getcanvas(glist), x); + sys_vgui(".x%x.c addtag selected withtag %zxS\n", glist_getcanvas(glist), x); } else { - sys_vgui(".x%lx.c delete %lxSEL\n", + sys_vgui(".x%zx.c delete %zxSEL\n", glist_getcanvas(glist), x); - sys_vgui(".x%lx.c dtag %lxS selected\n", glist_getcanvas(glist), x); + sys_vgui(".x%zx.c dtag %zxS selected\n", glist_getcanvas(glist), x); } @@ -268,7 +268,7 @@ void button_color(t_button* x,t_symbol* col) static void button_bang(t_button* x) { - sys_vgui(".x%lx.c.s%lx flash\n",x->x_glist,x); + sys_vgui(".x%zx.c.s%zx flash\n",x->x_glist,x); outlet_bang(x->x_obj.ob_outlet); } @@ -313,13 +313,13 @@ static void *button_new(t_symbol* text) /* TODO .. ask the button for its width */ x->x_width += strlen(x->x_text->s_name)*5.2; - sprintf(buf,"button%lx", (long unsigned int)x); + sprintf(buf,"button%zx", (t_uint)x); x->x_sym = gensym(buf); pd_bind(&x->x_obj.ob_pd, x->x_sym); /* pipe startup code to tk */ - sys_vgui("proc button_cb%lx {} {pd [concat %s b \\;]}\n", x, buf); + sys_vgui("proc button_cb%zx {} {pd [concat %s b \\;]}\n", x, buf); outlet_new(&x->x_obj, &s_float); return (x); diff --git a/externals/ggee/gui/envgen.c b/externals/ggee/gui/envgen.c index ab95281aeacd96a82f709b25cca72cb68ccd5333..6412d4b90d02065d8eafafc43f3efc20dfa9608f 100644 --- a/externals/ggee/gui/envgen.c +++ b/externals/ggee/gui/envgen.c @@ -259,7 +259,7 @@ static void *envgen_new(t_symbol *s,int argc,t_atom* argv) x->args = STATES; x->finalvalues = getbytes( x->args*sizeof(t_float)); x->duration = getbytes( x->args*sizeof(t_float)); - DEBUG(post("finalvalues %lx",x->finalvalues);); + DEBUG(post("finalvalues %zx",x->finalvalues);); /* widget */ diff --git a/externals/ggee/gui/image.c b/externals/ggee/gui/image.c index 719a9d3df3073596c0fbee45aa3df82e40622669..f0b9c7915ad087237b3a9a62add5b36b15168a83 100644 --- a/externals/ggee/gui/image.c +++ b/externals/ggee/gui/image.c @@ -56,11 +56,24 @@ t_symbol *image_trytoopen(t_image* x) } } +// defined in s_main.c and used to offset object at creation time +// in case it is being autopatched +extern int glob_autopatch_connectme; + static void image_drawme(t_image *x, t_glist *glist, int firstime) { if (firstime) { t_symbol *fname = image_trytoopen(x); + // check if we are autopatching and offset for the default + // image only. Since we need to wait for the callback from + // the GUI to determine the custom image size, we can only + // compensate for the default image + if (glob_autopatch_connectme) + { + x->x_obj.te_xpix += 12; + x->x_obj.te_ypix += 12; + } // make a new gobj, border, etc. gui_vmess("gui_gobj_new", "xxsiii", glist_getcanvas(glist), @@ -84,7 +97,7 @@ static void image_drawme(t_image *x, t_glist *glist, int firstime) x, x, "center"); - //sys_vgui("catch {.x%lx.c delete %xS}\n", glist_getcanvas(glist), x); + //sys_vgui("catch {.x%zx.c delete %xS}\n", glist_getcanvas(glist), x); //sys_vgui(".x%x.c create image %d %d -tags %xS\n", // glist_getcanvas(glist),text_xpix(&x->x_obj, glist), // text_ypix(&x->x_obj, glist), x); @@ -102,6 +115,12 @@ static void image_drawme(t_image *x, t_glist *glist, int firstime) x, text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist)); + if (glist_isselected(x->x_glist, (t_gobj *)x) && glist_getcanvas(x->x_glist) == x->x_glist) + { + image_select((t_gobj *)x, glist_getcanvas(x->x_glist), 0); + image_select((t_gobj *)x, glist_getcanvas(x->x_glist), 1); + } + canvas_fixlinesfor(x->x_glist, (t_text*)x); } } @@ -186,31 +205,6 @@ static void image_displace(t_gobj *z, t_glist *glist, t_image *x = (t_image *)z; x->x_obj.te_xpix += dx; x->x_obj.te_ypix += dy; - if (!x->x_gop_spill && (x->x_img_width + x->x_img_height) >= 2) - { - sys_vgui(".x%x.c coords %xSEL %d %d %d %d\n", - glist_getcanvas(glist), x, - text_xpix(&x->x_obj, glist) - x->x_img_width/2, - text_ypix(&x->x_obj, glist) - x->x_img_height/2, - text_xpix(&x->x_obj, glist) + x->x_img_width/2, - text_ypix(&x->x_obj, glist) + x->x_img_height/2); - } - else - { - sys_vgui(".x%x.c coords %xSEL %d %d %d %d\n", - glist_getcanvas(glist), x, - text_xpix(&x->x_obj, glist) - x->x_width/2, - text_ypix(&x->x_obj, glist) - x->x_height/2, - text_xpix(&x->x_obj, glist) + x->x_width/2, - text_ypix(&x->x_obj, glist) + x->x_height/2); - /*if (x->x_img_width + x->x_img_height == 0) - sys_vgui(".x%x.c coords %xMT %d %d %d %d\n", - glist_getcanvas(glist), x, - text_xpix(&x->x_obj, glist) - x->x_width/2, - text_ypix(&x->x_obj, glist) - x->x_height/2, - text_xpix(&x->x_obj, glist) + x->x_width/2, - text_ypix(&x->x_obj, glist) + x->x_height/2);*/ - } image_drawme(x, glist, 0); canvas_fixlinesfor(glist,(t_text*) x); } @@ -274,8 +268,8 @@ static void image_select(t_gobj *z, t_glist *glist, int state) //sys_vgui("catch {.x%x.c delete %xSEL}\n", //glist_getcanvas(glist), x); //if (glist->gl_owner && !glist_istoplevel(glist)) - //sys_vgui(".x%lx.c dtag %xS selected\n", glist_getcanvas(glist), x); - //sys_vgui(".x%lx.c dtag %xMT selected\n", glist_getcanvas(glist), x); + //sys_vgui(".x%zx.c dtag %xS selected\n", glist_getcanvas(glist), x); + //sys_vgui(".x%zx.c dtag %xMT selected\n", glist_getcanvas(glist), x); gui_vmess("gui_image_toggle_border", "xxi", glist_getcanvas(glist), x, 0); gui_vmess("gui_gobj_deselect", "xx", glist_getcanvas(glist), x); @@ -435,6 +429,8 @@ static void image_imagesize_callback(t_image *x, t_float w, t_float h) { //sys_vgui("catch {.x%x.c delete %xMT}\n", glist_getcanvas(x->x_glist), x); // reselect if we are on a toplevel canvas to adjust the selection rectangle, if necessary + /* ico@vt.edu: this does not work for the spill mode, so we will have to + draw the select box on demand gui_vmess("gui_image_draw_border", "xxiiii", glist_getcanvas(x->x_glist), x, @@ -442,6 +438,7 @@ static void image_imagesize_callback(t_image *x, t_float w, t_float h) { 0 - x->x_img_height/2, x->x_img_width, x->x_img_height); + */ if (glist_isselected(x->x_glist, (t_gobj *)x) && glist_getcanvas(x->x_glist) == x->x_glist) { @@ -505,7 +502,7 @@ static void *image_new(t_symbol *s, t_int argc, t_atom *argv) } // Create default receiver char buf[MAXPDSTRING]; - sprintf(buf, "#%lx", (long)x); + sprintf(buf, "#%zx", (t_uint)x); x->x_receive = gensym(buf); pd_bind(&x->x_obj.ob_pd, x->x_receive); outlet_new(&x->x_obj, &s_bang); diff --git a/externals/ggee/gui/w_envgen.h b/externals/ggee/gui/w_envgen.h index b457ed96c006303081a3bb93bca601559fe30dd1..76cd4aa1f52dbc95b508fd103b8db8cc0930bb5e 100644 --- a/externals/ggee/gui/w_envgen.h +++ b/externals/ggee/gui/w_envgen.h @@ -541,7 +541,7 @@ static int envgen_newclick(t_envgen *x, struct _glist *glist, envgen_next_doodle(x, glist, xpos, ypos); glist_grab(x->w.glist, &x->x_obj.te_g, (t_glistmotionfn) envgen_motion, - (t_glistkeyfn) envgen_key, xpos, ypos); + (t_glistkeyfn) envgen_key, 0, xpos, ypos); x->resizing = 0; if (x->resizeable && (xpos > wxpos + x->w.width) && diff --git a/externals/hcs/canvas_name.c b/externals/hcs/canvas_name.c index d8fa11ae025fa97fc17d58e892784561e7ab98f3..75d4772c624744cb024117f9abd043a1139ac50e 100644 --- a/externals/hcs/canvas_name.c +++ b/externals/hcs/canvas_name.c @@ -18,7 +18,7 @@ typedef struct _canvas_name static t_symbol* make_canvas_symbol(t_canvas* canvas) { char buf[MAXPDSTRING]; - snprintf(buf, MAXPDSTRING, ".x%lx.c", (long unsigned int)canvas); + snprintf(buf, MAXPDSTRING, ".x%zx.c", (t_uint)canvas); return gensym(buf); } diff --git a/externals/hcs/colorpanel.c b/externals/hcs/colorpanel.c index b7874085b61a9ac433579f966a3a47bee92e3be3..eea10433991b8ba559a604e5d4c8ddbe5b8aee5d 100644 --- a/externals/hcs/colorpanel.c +++ b/externals/hcs/colorpanel.c @@ -80,7 +80,7 @@ static void *colorpanel_new( void) { char buf[MAXPDSTRING]; t_colorpanel *x = (t_colorpanel *)pd_new(colorpanel_class); - sprintf(buf, "#%lx", (t_int)x); + sprintf(buf, "#%zx", (t_uint)x); x->x_s = gensym(buf); pd_bind(&x->x_obj.ob_pd, x->x_s); outlet_new(&x->x_obj, &s_list); diff --git a/externals/hcs/cursor.c b/externals/hcs/cursor.c index c9e6b1c498a43168fac5b8b9ed257b0aa2d1f75c..d802c77f4b6034edd44f65d3077110fb97b64753 100644 --- a/externals/hcs/cursor.c +++ b/externals/hcs/cursor.c @@ -110,7 +110,7 @@ static void *cursor_new(void) x->parent_canvas = canvas_getcurrent(); - sprintf(buf, "#%lx", (t_int)x); + sprintf(buf, "#%zx", (t_uint)x); x->receive_symbol = gensym(buf); pd_bind(&x->x_obj.ob_pd, x->receive_symbol); x->data_outlet = outlet_new(&x->x_obj, 0); diff --git a/externals/hcs/screensize.c b/externals/hcs/screensize.c index e742ea6930d7b8c6f3831e627413ef84552c203c..69402e546f76097f5c7da88d41347675644e176e 100644 --- a/externals/hcs/screensize.c +++ b/externals/hcs/screensize.c @@ -29,7 +29,7 @@ static void *screensize_new(void) char buf[MAXPDSTRING]; t_screensize *x = (t_screensize *)pd_new(screensize_class); - sprintf(buf, "#%lx", (t_int)x); + sprintf(buf, "#%zx", (t_uint)x); x->receive_symbol = gensym(buf); pd_bind(&x->x_obj.ob_pd, x->receive_symbol); diff --git a/externals/hcs/sys_gui.c b/externals/hcs/sys_gui.c index 753c19027de5401c1a05bf74a4ed080b30b3ccfe..8b14532e11489095270573f3bdbef9fd1ed42351 100644 --- a/externals/hcs/sys_gui.c +++ b/externals/hcs/sys_gui.c @@ -65,7 +65,7 @@ static void *sys_gui_new(t_symbol *s) x->x_outlet = outlet_new(&x->x_obj, &s_anything); char buf[MAXPDSTRING]; - sprintf(buf, "#%lx", (t_int)x); + sprintf(buf, "#%zx", (t_uint)x); x->x_receive_symbol = gensym(buf); pd_bind(&x->x_obj.ob_pd, x->x_receive_symbol); diff --git a/externals/hcs/window_name.c b/externals/hcs/window_name.c index 0528e9fa294e307df74162dfe30c47018096d033..20c99906affe9653def789f325e32301516d597d 100644 --- a/externals/hcs/window_name.c +++ b/externals/hcs/window_name.c @@ -18,7 +18,7 @@ typedef struct _window_name static t_symbol* make_canvas_symbol(t_canvas* canvas) { char buf[MAXPDSTRING]; - snprintf(buf, MAXPDSTRING, ".x%lx", (long unsigned int)canvas); + snprintf(buf, MAXPDSTRING, ".x%zx", (t_uint)canvas); return gensym(buf); } diff --git a/externals/iem/iemgui/src/cube_sphere.c b/externals/iem/iemgui/src/cube_sphere.c index c1292ef5c7a03b1747dcf5ca61267c0975e56d53..dea32cbcdf5f3efacac048dbcb4b02ce0506a793 100644 --- a/externals/iem/iemgui/src/cube_sphere.c +++ b/externals/iem/iemgui/src/cube_sphere.c @@ -366,7 +366,7 @@ static void cube_sphere_click(t_cube_sphere *x, t_floatarg xpos, t_floatarg ypos x->x_sel_index = sel; x->x_pos_x = x->x_pix_src_x[sel]; x->x_pos_y = x->x_pix_src_y[sel]; - glist_grab(x->x_gui.x_glist, &x->x_gui.x_obj.te_g, (t_glistmotionfn)cube_sphere_motion, 0, xpos, ypos); + glist_grab(x->x_gui.x_glist, &x->x_gui.x_obj.te_g, (t_glistmotionfn)cube_sphere_motion, 0, 0, xpos, ypos); } } } diff --git a/externals/iem/iemgui/src/iem_event.c b/externals/iem/iemgui/src/iem_event.c index e8353775c8ff713a92c9bae97867c161adca99da..d0a82969004a439d112e51376794b7747a376ee5 100644 --- a/externals/iem/iemgui/src/iem_event.c +++ b/externals/iem/iemgui/src/iem_event.c @@ -232,7 +232,7 @@ static int iem_event_click(t_gobj *z, struct _glist *glist, int xpix, int ypix, if(doit) { glist_grab(x->x_gui.x_glist, &x->x_gui.x_obj.te_g, - (t_glistmotionfn)iem_event_motion, iem_event_key, (t_float)xpix, (t_float)ypix); + (t_glistmotionfn)iem_event_motion, iem_event_key, 0, (t_float)xpix, (t_float)ypix); outlet_anything(x->x_gui.x_obj.ob_outlet, x->x_dragg_x_y, 2, x->x_at_out); if(x->x_gui.x_fsf.x_snd_able && x->x_gui.x_snd->s_thing) diff --git a/externals/iem/iemgui/src/numberbox_matrix.c b/externals/iem/iemgui/src/numberbox_matrix.c index c71f2f5a29fedd0c72216e6f00e220e9667d5b47..f6e41b9a46965ba535b7ac0cd44c83bc1b07b8ce 100644 --- a/externals/iem/iemgui/src/numberbox_matrix.c +++ b/externals/iem/iemgui/src/numberbox_matrix.c @@ -716,7 +716,7 @@ static void numberbox_matrix_click(t_numberbox_matrix *x, t_floatarg xpos, t_flo t_floatarg shift, t_floatarg ctrl, t_floatarg alt) { glist_grab(x->x_gui.x_glist, &x->x_gui.x_obj.te_g, - (t_glistmotionfn)numberbox_matrix_motion, numberbox_matrix_key, xpos, ypos); + (t_glistmotionfn)numberbox_matrix_motion, numberbox_matrix_key, 0, xpos, ypos); } static int numberbox_matrix_newclick(t_gobj *z, struct _glist *glist, int xpix, int ypix, int shift, int alt, int dbl, int doit) diff --git a/externals/iem/iemgui/src/room_sim_2d.c b/externals/iem/iemgui/src/room_sim_2d.c index 7f57c69296527284c511a119488afb5a8d2798ec..4dc9535b3263113c28d45c5f44b82b05e3d69d73 100644 --- a/externals/iem/iemgui/src/room_sim_2d.c +++ b/externals/iem/iemgui/src/room_sim_2d.c @@ -440,7 +440,7 @@ static void room_sim_2d_click(t_room_sim_2d *x, t_floatarg xpos, t_floatarg ypos x->x_pos_x = x->x_pix_src_x[sel]; x->x_pos_y = x->x_pix_src_y[sel]; glist_grab(x->x_gui.x_glist, &x->x_gui.x_obj.te_g, - (t_glistmotionfn)room_sim_2d_motion, 0, xpos, ypos); + (t_glistmotionfn)room_sim_2d_motion, 0, 0, xpos, ypos); } } diff --git a/externals/iem/iemgui/src/room_sim_3d.c b/externals/iem/iemgui/src/room_sim_3d.c index 7b845683760bd0e0aabcabc774872bbdf52bef70..11d9dad5367cd42cbdc4776d029ad0e6e4c5eb83 100644 --- a/externals/iem/iemgui/src/room_sim_3d.c +++ b/externals/iem/iemgui/src/room_sim_3d.c @@ -532,7 +532,7 @@ static void room_sim_3d_click(t_room_sim_3d *x, t_floatarg xpos, t_floatarg ypos x->x_pos_x = x->x_pix_src_x[sel]; x->x_pos_y = x->x_pix_src_y[sel]; x->x_pos_z = x->x_pix_src_z[sel]; - glist_grab(x->x_gui.x_glist, &x->x_gui.x_obj.te_g, (t_glistmotionfn)room_sim_3d_motion, 0, xpos, ypos); + glist_grab(x->x_gui.x_glist, &x->x_gui.x_obj.te_g, (t_glistmotionfn)room_sim_3d_motion, 0, 0, xpos, ypos); } } diff --git a/externals/iem/iemguts/src/receivecanvas.c b/externals/iem/iemguts/src/receivecanvas.c index 1fc10eac61fc202bd380ab5d995e71b04218edde..c369bdf7e89f024c050a093771222704a270007b 100644 --- a/externals/iem/iemguts/src/receivecanvas.c +++ b/externals/iem/iemguts/src/receivecanvas.c @@ -122,7 +122,7 @@ static void *receivecanvas_new(t_floatarg f) if(canvas) { char buf[MAXPDSTRING]; - snprintf(buf, MAXPDSTRING-1, "x%lx", (long unsigned int)canvas); + snprintf(buf, MAXPDSTRING-1, "x%zx", (t_uint)canvas); buf[MAXPDSTRING-1]=0; x->x_proxy=receivecanvas_proxy_new(x, gensym(buf)); diff --git a/externals/lyonpotpourri/m_pd.h b/externals/lyonpotpourri/m_pd.h index 02030a7796b5325b3013b1a73f266b9276bc81e2..c29bc79b63f8dcb3175444af243e6abc7debd341 100755 --- a/externals/lyonpotpourri/m_pd.h +++ b/externals/lyonpotpourri/m_pd.h @@ -81,8 +81,12 @@ typedef unsigned __int64 uint64_t; /* signed and unsigned integer types the size of a pointer: */ #if !defined(PD_LONGINTTYPE) +#if defined(_WIN32) && defined(_WIN64) +#define PD_LONGINTTYPE long long +#else #define PD_LONGINTTYPE long #endif +#endif #if !defined(PD_FLOATSIZE) /* normally, our floats (t_float, t_sample,...) are 32bit */ diff --git a/externals/miXed/cyclone/hammer/active.c b/externals/miXed/cyclone/hammer/active.c index ccaf2d96146068f405408c43c90206a771d54ad7..878f7739bd3b9be1e16523f638ef521dbe1e62f6 100644 --- a/externals/miXed/cyclone/hammer/active.c +++ b/externals/miXed/cyclone/hammer/active.c @@ -36,7 +36,7 @@ static void *active_new(void) { t_active *x = (t_active *)pd_new(active_class); char buf[32]; - sprintf(buf, ".x%lx.c", (unsigned long)canvas_getcurrent()); + sprintf(buf, ".x%zx.c", (t_uint)canvas_getcurrent()); x->x_cvname = gensym(buf); x->x_on = 0; outlet_new((t_object *)x, &s_float); diff --git a/externals/miXed/cyclone/hammer/comment.c b/externals/miXed/cyclone/hammer/comment.c index 634bc969504aedbd1aab3d3f4e801610d9613439..25a71b7f4431be699d0251f45393cc759bfef83a 100644 --- a/externals/miXed/cyclone/hammer/comment.c +++ b/externals/miXed/cyclone/hammer/comment.c @@ -195,7 +195,7 @@ static void comment_dograb(t_comment *x) Here we use it just to prevent backspace from erasing entire text. This has to be done also when we are already active, because after being clicked at we have lost our previous grab. */ - glist_grab(x->x_glist, (t_gobj *)x, 0, comment_grabbedkey, 0, 0); + glist_grab(x->x_glist, (t_gobj *)x, 0, comment_grabbedkey, 0, 0, 0); } static void comment__bboxhook(t_comment *x, t_symbol *bindsym, @@ -463,10 +463,10 @@ static void comment_select(t_gobj *z, t_glist *glist, int state) sys_vgui(".x%x.c itemconfigure %s -fill %s\n", x->x_canvas, x->x_texttag, (state ? "$select_color" : x->x_color)); if (state && !x->x_dragon) - sys_vgui(".x%lx.c addtag selected withtag %s\n", + sys_vgui(".x%zx.c addtag selected withtag %s\n", glist_getcanvas(glist), x->x_texttag); else if (!x->x_dragon) - sys_vgui(".x%lx.c dtag %s selected\n", + sys_vgui(".x%zx.c dtag %s selected\n", glist_getcanvas(glist), x->x_texttag); /* A regular rtext should now set 'canvas_editing' variable to its canvas, but we do not do that, because we get the keys through a global binding @@ -743,9 +743,9 @@ static void *comment_new(t_symbol *s, int ac, t_atom *av) t->te_type = T_TEXT; x->x_glist = canvas_getcurrent(); x->x_canvas = 0; - sprintf(x->x_tag, "all%lx", (t_int)x); - sprintf(x->x_texttag, "t%lx", (t_int)x); - sprintf(x->x_outlinetag, "h%lx", (t_int)x); + sprintf(x->x_tag, "all%zx", (t_uint)x); + sprintf(x->x_texttag, "t%zx", (t_uint)x); + sprintf(x->x_outlinetag, "h%zx", (t_uint)x); x->x_pixwidth = 0; x->x_fontsize = 0; x->x_fontfamily = 0; @@ -826,7 +826,7 @@ textpart: x->x_transclock = clock_new(x, (t_method)comment_transtick); x->x_bbset = 0; x->x_bbpending = 0; - sprintf(buf, "miXed%lx", (t_int)x); + sprintf(buf, "miXed%zx", (t_uint)x); x->x_bindsym = gensym(buf); pd_bind((t_pd *)x, x->x_bindsym); if (!commentsink) diff --git a/externals/miXed/cyclone/hammer/pv.c b/externals/miXed/cyclone/hammer/pv.c index 81feebf0e852ba0331cee4046594a2be33d70f91..10c813716f094bdbd440fdcf8589536ec4eec67d 100644 --- a/externals/miXed/cyclone/hammer/pv.c +++ b/externals/miXed/cyclone/hammer/pv.c @@ -358,11 +358,11 @@ static void pv_objstatus(t_pv *x, t_glist *glist) for (g = glist->gl_list; g; g = g->g_next) { if (g == (t_gobj *)x) - post("%lx (this object) owning patcher [%s]", - (unsigned long)g, glist->gl_name->s_name); + post("%zx (this object) owning patcher [%s]", + (t_int)g, glist->gl_name->s_name); else if (pd_class(&g->g_pd) == pv_class && ((t_pv *)g)->x_name == x->x_name) - post("%lx owning patcher [%s]", (unsigned long)g, glist->gl_name->s_name); + post("%zx owning patcher [%s]", (t_uint)g, glist->gl_name->s_name); } } diff --git a/externals/miXed/shared/hammer/file.c b/externals/miXed/shared/hammer/file.c index fe41e5e9ee5eb40826b7a8cf6a2cace906b42995..193059a8569779a1b891886dfed2a7cc26f5cf31 100644 --- a/externals/miXed/shared/hammer/file.c +++ b/externals/miXed/shared/hammer/file.c @@ -188,7 +188,9 @@ void hammereditor_open(t_hammerfile *f, char *title, char *owner) static void hammereditor_tick(t_hammerfile *f) { - sys_vgui("hammereditor_close .%x 1\n", (int)f); + // ico@vt.edu 20200923: disabling all legacy commands that keep + // spamming the console and otherwise have no effect + //sys_vgui("hammereditor_close .%x 1\n", (int)f); } void hammereditor_close(t_hammerfile *f, int ask) @@ -197,8 +199,8 @@ void hammereditor_close(t_hammerfile *f, int ask) /* hack: deferring modal dialog creation in order to allow for a message box redraw to happen -- LATER investigate */ clock_delay(f->f_editorclock, 0); - else - sys_vgui("hammereditor_close .%x 0\n", (int)f); + //else + //sys_vgui("hammereditor_close .%x 0\n", (int)f); } void hammereditor_append(t_hammerfile *f, char *contents) diff --git a/externals/moocow/common/m4/ax_pd_external.m4 b/externals/moocow/common/m4/ax_pd_external.m4 index e30a48d9fc11c1cde92feaf42421691a26691e4c..a50b18ff49782acb091122232a4baf1d750ca289 100644 --- a/externals/moocow/common/m4/ax_pd_external.m4 +++ b/externals/moocow/common/m4/ax_pd_external.m4 @@ -278,7 +278,7 @@ AC_DEFUN([AX_PD_EXTERNAL], Darwin) AC_MSG_RESULT(darwin) ;; - MINGW32_NT-*) + MINGW*_NT-*) ##-- build farm: `uname -s` = MINGW32_NT-5.1 AC_MSG_RESULT(win32) uname_s="MINGW32_NT" ##-- normalize diff --git a/externals/moocow/deque/configure b/externals/moocow/deque/configure index f9ac07dd1697c4d0c28e1a385b225f6127b43b3e..606ca5af5a53ac8c01837c06346007aca6aa2f66 100755 --- a/externals/moocow/deque/configure +++ b/externals/moocow/deque/configure @@ -3779,7 +3779,7 @@ echo "${ECHO_T}linux" >&6; } { echo "$as_me:$LINENO: result: darwin" >&5 echo "${ECHO_T}darwin" >&6; } ;; - MINGW32_NT-*) + MINGW*_NT-*) ##-- build farm: `uname -s` = MINGW32_NT-5.1 { echo "$as_me:$LINENO: result: win32" >&5 echo "${ECHO_T}win32" >&6; } diff --git a/externals/moocow/flite/configure b/externals/moocow/flite/configure index c7ba9b268f2e243df1f0bb386afecff518f06b46..b9f8437782f8cdfc956df9ddb24ee0772d664ce2 100755 --- a/externals/moocow/flite/configure +++ b/externals/moocow/flite/configure @@ -4319,7 +4319,7 @@ $as_echo "linux" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: darwin" >&5 $as_echo "darwin" >&6; } ;; - MINGW32_NT-*) + MINGW*_NT-*) ##-- build farm: `uname -s` = MINGW32_NT-5.1 { $as_echo "$as_me:${as_lineno-$LINENO}: result: win32" >&5 $as_echo "win32" >&6; } diff --git a/externals/moocow/gfsm/configure b/externals/moocow/gfsm/configure index 6e00fd2f5687cf5806e2936d57c44dcffabbc7f2..4bc08d93549bb4f0828413a284c54c73e1258297 100755 --- a/externals/moocow/gfsm/configure +++ b/externals/moocow/gfsm/configure @@ -20441,7 +20441,7 @@ echo "${ECHO_T}linux" >&6; } { echo "$as_me:$LINENO: result: darwin" >&5 echo "${ECHO_T}darwin" >&6; } ;; - MINGW32_NT-*) + MINGW*_NT-*) ##-- build farm: `uname -s` = MINGW32_NT-5.1 { echo "$as_me:$LINENO: result: win32" >&5 echo "${ECHO_T}win32" >&6; } diff --git a/externals/moocow/locale/configure b/externals/moocow/locale/configure index 5b813cf01cc75f89d5aec07d7a5c490be2f3902a..2511b03c7491037b271d9b84f6f9c1293946cc19 100755 --- a/externals/moocow/locale/configure +++ b/externals/moocow/locale/configure @@ -3779,7 +3779,7 @@ echo "${ECHO_T}linux" >&6; } { echo "$as_me:$LINENO: result: darwin" >&5 echo "${ECHO_T}darwin" >&6; } ;; - MINGW32_NT-*) + MINGW*_NT-*) ##-- build farm: `uname -s` = MINGW32_NT-5.1 { echo "$as_me:$LINENO: result: win32" >&5 echo "${ECHO_T}win32" >&6; } diff --git a/externals/moocow/pdstring/configure b/externals/moocow/pdstring/configure index 9f3722c92c5317fc28c43980f3bbd6128ff27312..066e2e2098da5b2a61fc855114271c3d0eb6cfc8 100755 --- a/externals/moocow/pdstring/configure +++ b/externals/moocow/pdstring/configure @@ -3782,7 +3782,7 @@ echo "${ECHO_T}linux" >&6; } { echo "$as_me:$LINENO: result: darwin" >&5 echo "${ECHO_T}darwin" >&6; } ;; - MINGW32_NT-*) + MINGW*_NT-*) ##-- build farm: `uname -s` = MINGW32_NT-5.1 { echo "$as_me:$LINENO: result: win32" >&5 echo "${ECHO_T}win32" >&6; } diff --git a/externals/moocow/readdir/configure b/externals/moocow/readdir/configure index 79ec056127198843aa946666dbcf2a77849b0328..7752e6c328775be940670326cb9d3a72e6412613 100755 --- a/externals/moocow/readdir/configure +++ b/externals/moocow/readdir/configure @@ -3781,7 +3781,7 @@ echo "${ECHO_T}linux" >&6; } { echo "$as_me:$LINENO: result: darwin" >&5 echo "${ECHO_T}darwin" >&6; } ;; - MINGW32_NT-*) + MINGW*_NT-*) ##-- build farm: `uname -s` = MINGW32_NT-5.1 { echo "$as_me:$LINENO: result: win32" >&5 echo "${ECHO_T}win32" >&6; } diff --git a/externals/moocow/sprinkler/configure b/externals/moocow/sprinkler/configure index 3efc47fca23ab3f1265426bee1c8970fe0264d24..877b160893ee09c66843206ccc5b5dc4ade1e058 100755 --- a/externals/moocow/sprinkler/configure +++ b/externals/moocow/sprinkler/configure @@ -3789,7 +3789,7 @@ echo "${ECHO_T}linux" >&6; } { echo "$as_me:$LINENO: result: darwin" >&5 echo "${ECHO_T}darwin" >&6; } ;; - MINGW32_NT-*) + MINGW*_NT-*) ##-- build farm: `uname -s` = MINGW32_NT-5.1 { echo "$as_me:$LINENO: result: win32" >&5 echo "${ECHO_T}win32" >&6; } diff --git a/externals/moocow/weightmap/configure b/externals/moocow/weightmap/configure index 678ea59c6c5f3eae5a12f6929b87c92d30372e6e..02fdf0b349913faa9ee7705d05c689779c374dd4 100755 --- a/externals/moocow/weightmap/configure +++ b/externals/moocow/weightmap/configure @@ -3781,7 +3781,7 @@ echo "${ECHO_T}linux" >&6; } { echo "$as_me:$LINENO: result: darwin" >&5 echo "${ECHO_T}darwin" >&6; } ;; - MINGW32_NT-*) + MINGW*_NT-*) ##-- build farm: `uname -s` = MINGW32_NT-5.1 { echo "$as_me:$LINENO: result: win32" >&5 echo "${ECHO_T}win32" >&6; } diff --git a/externals/moonlib/image.c b/externals/moonlib/image.c index 0146cdf9b9352914a3f3ef1c6fe49380c6bd3993..2873e539e93d95ae3e857925004d52e54317771c 100644 --- a/externals/moonlib/image.c +++ b/externals/moonlib/image.c @@ -64,8 +64,8 @@ static void image_drawme(t_image *x, t_glist *glist, int firsttime) glist_istoplevel(glist)); if (x->x_image == &s_) // if we have a blank image name, use the included filler { - sprintf(key, "x%lx", (long unsigned int)pd_class(&x->x_obj.te_pd)); - sprintf(key2, "x%lx", (long unsigned int)pd_class(&x->x_obj.te_pd)); + sprintf(key, "x%zx", (t_uint)pd_class(&x->x_obj.te_pd)); + sprintf(key2, "x%zx", (t_uint)pd_class(&x->x_obj.te_pd)); strcat(key, key2); strcat(key, "default"); //x->x_image = gensym("::moonlib::image::noimage"); @@ -75,12 +75,12 @@ static void image_drawme(t_image *x, t_glist *glist, int firsttime) } if (x->x_type) { - //sys_vgui(".x%lx.c create image %d %d -tags %xS\n", + //sys_vgui(".x%zx.c create image %d %d -tags %xS\n", // glist_getcanvas(glist), // text_xpix(&x->x_obj, glist), // text_ypix(&x->x_obj, glist), // x); - //sys_vgui(".x%lx.c itemconfigure %xS -image %s\n", + //sys_vgui(".x%zx.c itemconfigure %xS -image %s\n", // glist_getcanvas(glist), x, x->x_image->s_name); gui_vmess("gui_gobj_draw_image", "xxss", glist_getcanvas(glist), @@ -90,7 +90,7 @@ static void image_drawme(t_image *x, t_glist *glist, int firsttime) } else { - sprintf(key, "x%lx", (long unsigned int)x); + sprintf(key, "x%zx", (t_uint)x); const char *fname = image_get_filename(x, x->x_image->s_name); if (!x->x_localimage) { @@ -100,12 +100,12 @@ static void image_drawme(t_image *x, t_glist *glist, int firsttime) if (fname) { /* associate a filename with the image */ - //sys_vgui("::moonlib::image::configure .x%lx img%x {%s}\n", + //sys_vgui("::moonlib::image::configure .x%zx img%x {%s}\n", // x, x, fname); gui_vmess("gui_load_image", "xss", glist_getcanvas(glist), key, fname); } - //sys_vgui(".x%lx.c create image %d %d -image img%x -tags %xS\n", + //sys_vgui(".x%zx.c create image %d %d -image img%x -tags %xS\n", // glist_getcanvas(glist), // text_xpix(&x->x_obj, glist), // text_ypix(&x->x_obj, glist), @@ -131,7 +131,7 @@ static void image_drawme(t_image *x, t_glist *glist, int firsttime) } else { - //sys_vgui(".x%lx.c coords %xS %d %d\n", + //sys_vgui(".x%zx.c coords %xS %d %d\n", // glist_getcanvas(glist), x, // text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist)); gui_vmess("gui_image_coords", "xxii", @@ -144,7 +144,7 @@ static void image_drawme(t_image *x, t_glist *glist, int firsttime) static void image_erase(t_image *x, t_glist *glist) { - //sys_vgui(".x%lx.c delete %xS\n", glist_getcanvas(glist), x); + //sys_vgui(".x%zx.c delete %xS\n", glist_getcanvas(glist), x); gui_vmess("gui_gobj_erase", "xx", glist_getcanvas(glist), x); } @@ -170,7 +170,7 @@ static void image_displace(t_gobj *z, t_glist *glist, int dx, int dy) t_image *x = (t_image *)z; x->x_obj.te_xpix += dx; x->x_obj.te_ypix += dy; - //sys_vgui(".x%lx.c coords %xSEL %d %d %d %d\n", + //sys_vgui(".x%zx.c coords %xSEL %d %d %d %d\n", // glist_getcanvas(glist), x, // text_xpix(&x->x_obj, glist), // text_ypix(&x->x_obj, glist), @@ -185,7 +185,7 @@ static void image_displace_wtag(t_gobj *z, t_glist *glist, int dx, int dy) t_image *x = (t_image *)z; x->x_obj.te_xpix += dx; x->x_obj.te_ypix += dy; - //sys_vgui(".x%lx.c coords %xSEL %d %d %d %d\n", + //sys_vgui(".x%zx.c coords %xSEL %d %d %d %d\n", // glist_getcanvas(glist), x, // text_xpix(&x->x_obj, glist), // text_ypix(&x->x_obj, glist), @@ -200,7 +200,7 @@ static void image_select(t_gobj *z, t_glist *glist, int state) t_image *x = (t_image *)z; //if (state) //{ - // sys_vgui(".x%lx.c create rectangle " + // sys_vgui(".x%zx.c create rectangle " // "%d %d %d %d -tags %xSEL -outline blue\n", // glist_getcanvas(glist), // text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist), @@ -210,7 +210,7 @@ static void image_select(t_gobj *z, t_glist *glist, int state) //} //else //{ - // sys_vgui(".x%lx.c delete %xSEL\n", + // sys_vgui(".x%zx.c delete %xSEL\n", // glist_getcanvas(glist), x); //} gui_vmess("gui_image_toggle_border", "xxi", @@ -283,7 +283,7 @@ static void image_open(t_gobj *z, t_symbol *file) fname = image_get_filename(x, file->s_name); if (fname) { - sprintf(key, "x%lx", (long unsigned int)x); + sprintf(key, "x%zx", (t_uint)x); x->x_image = gensym(fname); x->x_key = gensym(key); x->x_type = 0; @@ -295,13 +295,13 @@ static void image_open(t_gobj *z, t_symbol *file) x->x_localimage = 1; } //sys_vgui("img%x blank\n", x); - //sys_vgui("::moonlib::image::configure .x%lx img%x {%s}\n", + //sys_vgui("::moonlib::image::configure .x%zx img%x {%s}\n", // x, x, fname); gui_vmess("gui_load_image", "xss", glist_getcanvas(x->x_glist), key, fname); if (oldtype == 0) { - //sys_vgui(".x%lx.c itemconfigure %xS -image img%x\n", + //sys_vgui(".x%zx.c itemconfigure %xS -image img%x\n", // glist_getcanvas(x->x_glist), x, x); gui_vmess("gui_image_configure", "xxss", glist_getcanvas(x->x_glist), @@ -323,11 +323,11 @@ static void image_load(t_gobj *z, t_symbol *image, t_symbol *file) fname = image_get_filename(x, file->s_name); if (fname) { - //sys_vgui("::moonlib::image::create_photo .x%lx %s {%s}\n", + //sys_vgui("::moonlib::image::create_photo .x%zx %s {%s}\n", // x, image->s_name, fname); /* For these class-accessible names, we prefix the user-provided name with a class pointer. */ - sprintf(key, "x%lx", (long unsigned int)pd_class(&x->x_obj.te_pd)); + sprintf(key, "x%zx", (t_uint)pd_class(&x->x_obj.te_pd)); strcat(key, image->s_name); gui_vmess("gui_load_image", "xss", glist_getcanvas(x->x_glist), key, fname); @@ -343,14 +343,14 @@ static void image_set(t_gobj *z, t_symbol *image) char key[MAXPDSTRING]; t_image *x = (t_image *)z; /* key is the class address followed by the user-supplied string */ - sprintf(key, "x%lx", (long unsigned int)pd_class(&x->x_obj.te_pd)); + sprintf(key, "x%zx", (t_uint)pd_class(&x->x_obj.te_pd)); strcat(key, image->s_name); x->x_image = image; x->x_key = gensym(key); x->x_type = 1; if (glist_isvisible(x->x_glist)) { - //sys_vgui(".x%lx.c itemconfigure %xS -image %s\n", + //sys_vgui(".x%zx.c itemconfigure %xS -image %s\n", // glist_getcanvas(x->x_glist), x, x->x_image->s_name); gui_vmess("gui_image_configure", "xxss", glist_getcanvas(x->x_glist), @@ -394,7 +394,7 @@ static void *image_new(t_symbol *image, t_float type) { if (x->x_type) { - sprintf(key, "x%lx", (long unsigned int)pd_class(&x->x_obj.te_pd)); + sprintf(key, "x%zx", (t_uint)pd_class(&x->x_obj.te_pd)); strcat(key, image->s_name); x->x_image = image; x->x_key = gensym(key); @@ -434,13 +434,13 @@ void image_setup(void) class_setsavefn(image_class, &image_save); #endif /* cache a default image (question mark) for case where no image argument - is given. The key is ("x%lxx%lxdefault", image_class, image_class), + is given. The key is ("x%zxx%zxdefault", image_class, image_class), to protect against namespace clashes with the complicated interface of moonlib/image */ char key[MAXPDSTRING]; char key2[MAXPDSTRING]; - sprintf(key, "x%lx", (long unsigned int)image_class); - sprintf(key2, "x%lx", (long unsigned int)image_class); + sprintf(key, "x%zx", (t_uint)image_class); + sprintf(key2, "x%zx", (t_uint)image_class); strcat(key, key2); strcat(key, "default"); gui_vmess("gui_load_default_image", "ss", "dummy", key); diff --git a/externals/moonlib/mknob.c b/externals/moonlib/mknob.c index f12edcf074f1e1726cf0b65bf2ab5c49113ce996..d8430ffd9a82dda7841619e81bb89f9b941560e7 100644 --- a/externals/moonlib/mknob.c +++ b/externals/moonlib/mknob.c @@ -450,13 +450,13 @@ static void mknob_click(t_mknob *x, t_floatarg xpos, t_floatarg ypos, if (x->x_gui.x_h<0) glist_grab(x->x_gui.x_glist, &x->x_gui.x_obj.te_g, - (t_glistmotionfn)mknob_motion_fullcircular, 0, xpos, ypos); + (t_glistmotionfn)mknob_motion_fullcircular, 0, 0, xpos, ypos); else if (x->x_gui.x_h==0) glist_grab(x->x_gui.x_glist, &x->x_gui.x_obj.te_g, - (t_glistmotionfn)mknob_motion_circular, 0, xpos, ypos); + (t_glistmotionfn)mknob_motion_circular, 0, 0, xpos, ypos); else glist_grab(x->x_gui.x_glist, &x->x_gui.x_obj.te_g, - (t_glistmotionfn)mknob_motion, 0, xpos, ypos); + (t_glistmotionfn)mknob_motion, 0, 0, xpos, ypos); } static int mknob_newclick(t_gobj *z, struct _glist *glist, diff --git a/externals/mrpeach/net/udpreceive.c b/externals/mrpeach/net/udpreceive.c index 231c99f5ce1b8140ac901fce4a5a0075ffb44901..df907c743c004316a04fac1df5858d82440f524d 100644 --- a/externals/mrpeach/net/udpreceive.c +++ b/externals/mrpeach/net/udpreceive.c @@ -271,7 +271,7 @@ static void udpreceive_sock_err(t_udpreceive *x, char *err_string) break; } } - pd_error(x, "%s: %s (%d)", err_string, lpMsgBuf, dwRetVal); + pd_error(x, "%s: %s (%ld)", err_string, lpMsgBuf, dwRetVal); LocalFree(lpMsgBuf); } #else diff --git a/externals/mrpeach/net/udpreceive~.c b/externals/mrpeach/net/udpreceive~.c index 9768baa540db6fd3a0dfcc552e3c210c60ffea35..b3f835b1508f7e34ca9da2a745e622797d8ea20f 100644 --- a/externals/mrpeach/net/udpreceive~.c +++ b/externals/mrpeach/net/udpreceive~.c @@ -223,7 +223,7 @@ static void udpreceive_tilde_datapoll(t_udpreceive_tilde *x) if (!((tag_ptr->tag[0] == 'T')&&(tag_ptr->tag[1] == 'A')&&(tag_ptr->tag[2] == 'G')&&(tag_ptr->tag[3] == '!'))) { ++x->x_tag_errors; - if (x->x_sync) error("udpreceive~: bad header tag (%d)", x->x_tag_errors); + if (x->x_sync) error("udpreceive~: bad header tag (%ld)", x->x_tag_errors); x->x_sync = 0; /* tag length is 16 bytes, a multiple of the data frame size, so eventually we should resync on a tag */ return; @@ -849,7 +849,7 @@ static void udpreceive_tilde_sock_err(t_udpreceive_tilde *x, char *err_string) break; } } - pd_error(x, "%s: %s (%d)", err_string, lpMsgBuf, dwRetVal); + pd_error(x, "%s: %s (%ld)", err_string, lpMsgBuf, dwRetVal); LocalFree(lpMsgBuf); } #else diff --git a/externals/mrpeach/net/udpsend.c b/externals/mrpeach/net/udpsend.c index cbef2f874eb7fb4881d992013dedae55147cee46..1e06f304d3cd08bdd9a3ca281886cb94d5128f39 100644 --- a/externals/mrpeach/net/udpsend.c +++ b/externals/mrpeach/net/udpsend.c @@ -414,7 +414,7 @@ static void udpsend_sock_err(t_udpsend *x, char *err_string) break; } } - pd_error(x, "%s: %s (%d)", err_string, lpMsgBuf, errornumber); + pd_error(x, "%s: %s (%ld)", err_string, lpMsgBuf, errornumber); LocalFree(lpMsgBuf); } #else diff --git a/externals/mrpeach/net/udpsend~.c b/externals/mrpeach/net/udpsend~.c index 77b514c0f3b83b263c6eb1df0067bdce1d2b98b7..ebdbbed3495d4a5c0abbaa865421d72bdf250588 100644 --- a/externals/mrpeach/net/udpsend~.c +++ b/externals/mrpeach/net/udpsend~.c @@ -970,7 +970,7 @@ static void udpsend_tilde_sock_err(t_udpsend_tilde *x, char *err_string) break; } } - pd_error(x, "%s: %s (%d)", err_string, lpMsgBuf, errornumber); + pd_error(x, "%s: %s (%ld)", err_string, lpMsgBuf, errornumber); LocalFree(lpMsgBuf); } #else diff --git a/externals/pd-lua b/externals/pd-lua index 8eaaaa3c39af8968248fab5659d4a4d2da4f1ed7..b767c65b6607a1b2b80798a5ff4fb3e3c1d752a5 160000 --- a/externals/pd-lua +++ b/externals/pd-lua @@ -1 +1 @@ -Subproject commit 8eaaaa3c39af8968248fab5659d4a4d2da4f1ed7 +Subproject commit b767c65b6607a1b2b80798a5ff4fb3e3c1d752a5 diff --git a/externals/pddp/pddplink.c b/externals/pddp/pddplink.c index 847cf1f6a364a95456829f7841cc3fd5cf944387..7120241ca2f17d3710202265d3815e1208916542 100644 --- a/externals/pddp/pddplink.c +++ b/externals/pddp/pddplink.c @@ -110,39 +110,6 @@ static void pddplink_select(t_gobj *z, t_glist *glist, int state) } } -static void pddplink_activate(t_gobj *z, t_glist *glist, int state) -{ - t_pddplink *x = (t_pddplink *)z; - t_rtext *y = glist_findrtext(glist, (t_text *)x); - rtext_activate(y, state); - x->x_rtextactive = state; - if (!state) { - /* Big workaround for pddplink without the -box option... - - After this call, Pd calls text_setto to see if it needs to - instantiate the object. For nearly all t_text objects, the - object doesn't get rebuilt if the text inside the box remains - the same. Instead, it just calls rtext_senditup which (eventually) - sends a message to the GUI to simply supply new text for the - current object. (It shouldn't do this if the text hasn't actually - changed, but that's another story...). - - Anyway, since pddplink has this weird widget behavior, the text - displayed is different than the text we typed in the box-- hence - the x->x_vistext member here. So if we happened to edit the box - without changing the text, rtext_senditup would update the link - to be "pddplink foo" instead of just "foo". - - To prevent this, we just zero out the object's te_binbuf to ensure - that text_setto re-instantiates. That ensures the correct text is - printed for the link */ - t_binbuf *b = binbuf_new(); - t_binbuf *old = x->x_ob.te_binbuf; - x->x_ob.te_binbuf = b; - binbuf_free(old); - } -} - static void pddplink_vis(t_gobj *z, t_glist *glist, int vis) { t_pddplink *x = (t_pddplink *)z; @@ -188,6 +155,45 @@ static void pddplink_vis(t_gobj *z, t_glist *glist, int vis) } } +static void pddplink_activate(t_gobj *z, t_glist *glist, int state) +{ + t_pddplink *x = (t_pddplink *)z; + t_rtext *y = glist_findrtext(glist, (t_text *)x); + rtext_activate(y, state); + x->x_rtextactive = state; + if (!state) { + /* Big workaround for pddplink without the -box option... + + After this call, Pd calls text_setto to see if it needs to + instantiate the object. For nearly all t_text objects, the + object doesn't get rebuilt if the text inside the box remains + the same. Instead, it just calls rtext_senditup which (eventually) + sends a message to the GUI to simply supply new text for the + current object. (It shouldn't do this if the text hasn't actually + changed, but that's another story...). + + Anyway, since pddplink has this weird widget behavior, the text + displayed is different than the text we typed in the box-- hence + the x->x_vistext member here. So if we happened to edit the box + without changing the text, rtext_senditup would update the link + to be "pddplink foo" instead of just "foo". + + To prevent this, we just zero out the object's te_binbuf to ensure + that text_setto re-instantiates. That ensures the correct text is + printed for the link */ + t_binbuf *b = binbuf_new(); + t_binbuf *old = x->x_ob.te_binbuf; + x->x_ob.te_binbuf = b; + binbuf_free(old); + /* ico@vt.edu 20200906: this is ugly but necessary because otherwise + the object only activates correctly (reverts to its active link) + every other time when being deselected + */ + pddplink_vis(z, glist, 0); + pddplink_vis(z, glist, 1); + } +} + static int pddplink_wbclick(t_gobj *z, t_glist *glist, int xpix, int ypix, int shift, int alt, int dbl, int doit); diff --git a/externals/pidip/modules/pdp_colorgrid.c b/externals/pidip/modules/pdp_colorgrid.c index b60be7238206fc050a10405bb8d17f6534881bf1..c47b16fb43a514bc96da8a088e74c1964f698aba 100755 --- a/externals/pidip/modules/pdp_colorgrid.c +++ b/externals/pidip/modules/pdp_colorgrid.c @@ -1481,7 +1481,7 @@ static int pdp_colorgrid_click(t_gobj *z, struct _glist *glist, pdp_colorgrid_output_current(x); pdp_colorgrid_draw_update(x, glist); glist_grab(glist, &x->x_obj.te_g, (t_glistmotionfn)pdp_colorgrid_motion, - 0, xpix, ypix); + 0, 0, xpix, ypix); } return (1); } diff --git a/externals/tof/src/folderpanel.c b/externals/tof/src/folderpanel.c index e4a5a8fee83dbb3f0a1ce0250bb73b879e8b18c7..ce6349f52873eeb36c3e04d2fdb2bca2cb85a9ac 100644 --- a/externals/tof/src/folderpanel.c +++ b/externals/tof/src/folderpanel.c @@ -57,7 +57,7 @@ static void *folderpanel_new( void) { char buf[50]; t_folderpanel *x = (t_folderpanel *)pd_new(folderpanel_class); - sprintf(buf, "d%lx", (t_int)x); + sprintf(buf, "d%zx", (t_uint)x); x->x_s = gensym(buf); pd_bind(&x->x_obj.ob_pd, x->x_s); outlet_new(&x->x_obj, &s_symbol); diff --git a/externals/tof/src/imagebang.c b/externals/tof/src/imagebang.c index 501991b398c37a75a7792d7fd80ef3ff63007752..107fe7386d022dbf03a165a5079bd11c938fd658 100644 --- a/externals/tof/src/imagebang.c +++ b/externals/tof/src/imagebang.c @@ -46,7 +46,7 @@ static void imagebang_bang(t_imagebang *x) clock_delay(x->clock_brk, 50); //x->flashed = 1; // key_a: - sprintf(image_key, "%lx_a", (long unsigned int)x); + sprintf(image_key, "%zx_a", (t_uint)x); gui_vmess("gui_image_configure", "xxss", glist_getcanvas(x->glist), x, @@ -58,7 +58,7 @@ static void imagebang_bang(t_imagebang *x) sys_vgui(".x%x.c itemconfigure %ximage -image %x_imagebang \n", glist, x,x->image_b); // key_b: - sprintf(image_key, "%lx_b", (long unsigned int)x); + sprintf(image_key, "%zx_b", (t_uint)x); gui_vmess("gui_image_configure", "xxss", glist_getcanvas(x->glist), x, @@ -78,7 +78,7 @@ static void imagebang_flash_timeout(t_imagebang *x) t_glist* glist = glist_getcanvas(x->glist); char key_a[MAXPDSTRING]; x->flashing = 0; - sprintf(key_a, "%lx_a", (long unsigned int)x); + sprintf(key_a, "%zx_a", (t_uint)x); gui_vmess("gui_image_configure", "xxss", glist_getcanvas(x->glist), x, @@ -97,7 +97,7 @@ static void imagebang_brk_timeout(t_imagebang *x) x->flashing = 1; //sys_vgui(".x%x.c itemconfigure %ximage -image %x_imagebang \n", // glist, x,x->image_b); - sprintf(key_b, "%lx_b", (long unsigned int)x); + sprintf(key_b, "%zx_b", (t_uint)x); gui_vmess("gui_image_configure", "xxss", glist_getcanvas(x->glist), x, @@ -153,7 +153,7 @@ static void imagebang_drawme(t_imagebang *x, t_glist *glist, int firsttime) text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist), glist_istoplevel(glist)); - sprintf(key_a, "%lx_a", (long unsigned int)x); + sprintf(key_a, "%zx_a", (t_uint)x); gui_vmess("gui_gobj_draw_image", "xxss", glist_getcanvas(glist), x, @@ -303,8 +303,8 @@ static void imagebang_free(t_imagebang *x) { DEBUG(sys_vgui("pd [concat DEBUG b exists [info exists %x_imagebang] \\;]\n",x->image_b);) DEBUG(sys_vgui("pd [concat DEBUG a exists [info exists %x_imagebang] \\;]\n",x->image_a);) - sprintf(key_a, "%lx_a", (long unsigned int)x); - sprintf(key_b, "%lx_b", (long unsigned int)x); + sprintf(key_a, "%zx_a", (t_uint)x); + sprintf(key_b, "%zx_b", (t_uint)x); gui_vmess("gui_image_free", "s", key_a); gui_vmess("gui_image_free", "s", key_b); if (x->receive) { @@ -352,7 +352,7 @@ static void *imagebang_new(t_symbol *s, int argc, t_atom *argv) if ( argc && (argv)->a_type == A_SYMBOL ) { image_a= atom_getsymbol(argv); - sprintf(key_a, "%lx_a", (long unsigned int)x); + sprintf(key_a, "%zx_a", (t_uint)x); // Get image file path fname = imagebang_get_filename(x,image_a->s_name); @@ -385,7 +385,7 @@ static void *imagebang_new(t_symbol *s, int argc, t_atom *argv) if ( argc > 1 && (argv+1)->a_type == A_SYMBOL ) { image_b= atom_getsymbol(argv+1); - sprintf(key_b, "%lx_b", (long unsigned int)x); + sprintf(key_b, "%zx_b", (t_uint)x); // Get image file path fname = imagebang_get_filename(x,image_b->s_name); @@ -436,7 +436,7 @@ static void *imagebang_new(t_symbol *s, int argc, t_atom *argv) { // Create default receiver if none set char buf[MAXPDSTRING]; - sprintf(buf, "#%lx", (long)x); + sprintf(buf, "#%zx", (long)x); x->receive = gensym(buf); } diff --git a/externals/tof/src/w_breakpoints.h b/externals/tof/src/w_breakpoints.h index b747672bc0d9f182871351c6eec5303f15f8fd76..24defdb2b036e566659596b106f9eecd029e2d00 100644 --- a/externals/tof/src/w_breakpoints.h +++ b/externals/tof/src/w_breakpoints.h @@ -518,7 +518,7 @@ static int breakpoints_newclick(t_breakpoints *x, struct _glist *glist, breakpoints_next_doodle(x,glist,xpos,ypos); glist_grab(x->w.glist, &x->x_obj.te_g, (t_glistmotionfn) breakpoints_motion, - (t_glistkeyfn) breakpoints_key, xpos, ypos); + (t_glistkeyfn) breakpoints_key, 0, xpos, ypos); x->w.shift = shift; breakpoints_followpointer(x,glist); @@ -544,7 +544,7 @@ static int breakpoints_newclick(t_breakpoints *x, struct _glist *glist, breakpoints_next_doodle(x,glist,xpos,ypos); glist_grab(x->w.glist, &x->x_obj.te_g, (t_glistmotionfn) breakpoints_motion, - (t_glistkeyfn) breakpoints_key, xpos, ypos); + (t_glistkeyfn) breakpoints_key, 0, xpos, ypos); x->resizing = 0; if (x->resizeable && (xpos > wxpos + x->w.width) && diff --git a/externals/tof/test/imagebutton.c b/externals/tof/test/imagebutton.c index 2e2bddd19847bd5107c7c6fe64c9cc526d76c71c..2c1a1ab129a2ac3ecbf661de93901486877507ea 100644 --- a/externals/tof/test/imagebutton.c +++ b/externals/tof/test/imagebutton.c @@ -345,7 +345,7 @@ static void *imagebutton_new(t_symbol *s, int argc, t_atom *argv) return NULL; } char buf[MAXPDSTRING]; - sprintf(buf, "#%lx", (long)x); + sprintf(buf, "#%zx", (long)x); x->receive = gensym(buf); pd_bind(&x->x_obj.ob_pd, x->receive ); diff --git a/externals/unauthorized/audience~.c b/externals/unauthorized/audience~.c index 237a70d69dc9ed63fd702c1450adcac0bfc7a7ca..87081724544af13a3fa6611942def8e0cceda186 100644 --- a/externals/unauthorized/audience~.c +++ b/externals/unauthorized/audience~.c @@ -670,7 +670,7 @@ static int audience_click(t_gobj *z, struct _glist *glist, } audience_draw_update(x, glist); glist_grab(glist, &x->x_obj.te_g, (t_glistmotionfn)audience_motion, - 0, xpix, ypix); + 0, 0, xpix, ypix); } return (1); } diff --git a/externals/unauthorized/cooled~.c b/externals/unauthorized/cooled~.c index c09ba4c4e427386ba5af332df3040d60a695b0a0..b234b7c179049938100a75f4d4646fa2baf845fd 100644 --- a/externals/unauthorized/cooled~.c +++ b/externals/unauthorized/cooled~.c @@ -238,7 +238,7 @@ static void cooled_update_block(t_cooled *x, t_glist *glist, int bnumber) for ( i=0; i<x->x_zoom; i++ ) { - sprintf( x->x_guicommand, "COOLEDIMAGE%lx put {%s} -to %d 0\n", (long unsigned int)x, x->x_gifdata, (bnumber*x->x_zoom)+i ); + sprintf( x->x_guicommand, "COOLEDIMAGE%zx put {%s} -to %d 0\n", (t_uint)x, x->x_gifdata, (bnumber*x->x_zoom)+i ); if ( glist_isvisible( x->x_glist ) ) sys_gui( x->x_guicommand ); } @@ -880,7 +880,7 @@ static int cooled_click(t_gobj *z, struct _glist *glist, x->x_alted = alt; // activate motion callback glist_grab( glist, &x->x_obj.te_g, (t_glistmotionfn)cooled_motion, - 0, xpix, ypix ); + 0, 0, xpix, ypix ); // draw insertion line if ( glist_isvisible( x->x_glist ) ) diff --git a/externals/unauthorized/grid.c b/externals/unauthorized/grid.c index ad67e504c0c1a39eb217e39aa9bf0a488eeb39dd..9a423dbe070e573cd2895fabf429b394db504cbf 100644 --- a/externals/unauthorized/grid.c +++ b/externals/unauthorized/grid.c @@ -510,7 +510,7 @@ static int grid_click(t_gobj *z, struct _glist *glist, grid_output_current(x); grid_draw_update(x, glist); glist_grab(glist, &x->x_obj.te_g, (t_glistmotionfn)grid_motion, - 0, xpix, ypix); + 0, 0, xpix, ypix); } return (1); } diff --git a/externals/unauthorized/pianoroll.c b/externals/unauthorized/pianoroll.c index 887b13fad2b9c6c6e782a393851416a7a23f4f48..2c9145ab65e208fd78b2ceeecbcc35d7f87bff10 100644 --- a/externals/unauthorized/pianoroll.c +++ b/externals/unauthorized/pianoroll.c @@ -732,7 +732,7 @@ static void pianoroll_load(t_pianoroll *x, t_symbol *ffile) freebytes( x->x_ipeaches, x->x_nbsteps*sizeof( t_int ) ); freebytes( x->x_ivolumes, x->x_nbsteps*sizeof( t_int ) ); - if ( fscanf(tmph, "%d %d %f %f %d %d %d %f %d", + if ( fscanf(tmph, "%d %d %f %f %zd %zd %zd %f %d", &x->x_width, &x->x_height, &x->x_pmin, &x->x_pmax, &x->x_nbgrades, &x->x_nbsteps, diff --git a/externals/unauthorized/playlist.c b/externals/unauthorized/playlist.c index f663152b09f8ace73d760d33d292aa7ca392c1bd..d9e869e7fbadb9886ec27b012dfbe8c41bd5e29c 100644 --- a/externals/unauthorized/playlist.c +++ b/externals/unauthorized/playlist.c @@ -640,7 +640,7 @@ static int playlist_click(t_gobj *z, struct _glist *glist, } x->x_glist = glist; glist_grab( glist, &x->x_obj.te_g, (t_glistmotionfn)playlist_motion, - NULL, xpix, ypix ); + NULL, NULL, xpix, ypix ); } return (1); } diff --git a/externals/unauthorized/scratcher~.c b/externals/unauthorized/scratcher~.c index e4c5c168d8daa2472c188f45d0c5e6b07ed57a44..14b5088fb030f9c79fc45da3f5f5656a749e387f 100644 --- a/externals/unauthorized/scratcher~.c +++ b/externals/unauthorized/scratcher~.c @@ -417,7 +417,7 @@ static int scratcher_click(t_gobj *z, struct _glist *glist, { // activate motion callback glist_grab( glist, &x->x_obj.te_g, (t_glistmotionfn)scratcher_motion, - 0, xpix, ypix ); + 0, 0, xpix, ypix ); x->x_readspeed=0.; x->x_motioned = 1; if ( x->x_showspeed ) diff --git a/externals/unauthorized/scrolllist.c b/externals/unauthorized/scrolllist.c index cb4f0a0680ddbf504d9b9f692f209452222a5084..5a85c2fbdb9bd287ee6fe1051e404a0b8fbb3756 100644 --- a/externals/unauthorized/scrolllist.c +++ b/externals/unauthorized/scrolllist.c @@ -426,7 +426,7 @@ static int scrolllist_click(t_gobj *z, struct _glist *glist, } x->x_glist = glist; glist_grab( glist, &x->x_obj.te_g, (t_glistmotionfn)scrolllist_motion, - NULL, xpix, ypix ); + NULL, NULL, xpix, ypix ); } return (1); } diff --git a/externals/unauthorized/sonogram~.c b/externals/unauthorized/sonogram~.c index 9d3b1aeff0a3ad81917b6b1b519fe2494f686a04..30efb5c2acd502cc538994817efc688639dced40 100644 --- a/externals/unauthorized/sonogram~.c +++ b/externals/unauthorized/sonogram~.c @@ -1116,7 +1116,7 @@ static int sonogram_click(t_gobj *z, struct _glist *glist, x->x_alted = alt; // activate motion callback glist_grab( glist, &x->x_obj.te_g, (t_glistmotionfn)sonogram_motion, - 0, xpix, ypix ); + 0, 0, xpix, ypix ); if ( shift && alt && (x->x_xstartcapture != x->x_xendcapture ) ) { diff --git a/externals/zexy/AUTHORS b/externals/zexy/AUTHORS index cd9c307009304bf21484b77ce898052feccb1a94..f259806f9fa52b978a138a662b50dd2b795fb4d1 100644 --- a/externals/zexy/AUTHORS +++ b/externals/zexy/AUTHORS @@ -1,4 +1,4 @@ -Copyright 1999-2011 IOhannes m zmoelnig <zmoelnig@iem.at> +Copyright 1999-2020 IOhannes m zmoelnig <zmoelnig@iem.at> contributions: Copyright 1998-2004 matt wright @@ -7,6 +7,4 @@ Copyright 1999 guenter geiger Copyright 1996-1999 miller s puckette Copyright 2005-2006 tim blechmann Copyright 2009-2010 franz zotter -Copyright 1999-2011 zexy-contributors - - +Copyright 1999-2018 zexy-contributors diff --git a/externals/zexy/BUGS.txt b/externals/zexy/BUGS.txt deleted file mode 100644 index 39bb06b5c641ef9b6570e6874ae6ef8877f72f23..0000000000000000000000000000000000000000 --- a/externals/zexy/BUGS.txt +++ /dev/null @@ -1,9 +0,0 @@ -[drip] - - sometimes crashes with small delays - . according to the backtrace this should be a memory corruption - . (actually the crashing patch was buggy by design and i haven't got a simple bug-patch yet) - = UNREPRODUCIBLE - -[s2l] - - numerically looking sub-symbols are converted wrongly to floats: e.g. "192.168.0.1" -> 192,168 - + FIXED diff --git a/externals/zexy/ChangeLog b/externals/zexy/ChangeLog index dcd448be92e13059438946812084c18df81d4576..40550ee8194cc8405e2bcd3e5910d57eef03ad73 100644 --- a/externals/zexy/ChangeLog +++ b/externals/zexy/ChangeLog @@ -1,10 +1,57 @@ +zexy (2.3.0) RELEASED; urgency=medium + + * [msgfile] new formats: + - 'csv': import/export of CSV-files (","-separated), with proper escaping + - 'fudi': "pd"-like import that handles escaped linebreaks + - 'txt': "cr"-like import that handles escaped linebreaks + * [lpt] completely new implementation for windows + * Bug-fixes + * Thin wrappers around class_new/class_addmethod for terser declarations + * Re-format entire code-base + * Switch to pd-lib-builder (drop all other build-systems) + * Switch to cerntralized iem-ci configuration + * Fix older ChangeLog entries + + -- IOhannes m zmölnig (Debian/GNU) <umlaeute@debian.org> Thu, 20 Feb 2020 22:02:20 +0200 + +zexy (2.2.8) RELEASED; urgency=medium + + * Fix typos (including limiter's "treshold") + * Drop support for Pd<0.41 + * Fix MinGW linking issues with [time]/[date] + * Use (const char*) for t_symbol->s_name + * Fix line-endings + * Continuous Integration + * linux/macOS/w32/w64 builds & deken-uploads + + -- IOhannes m zmölnig <zmoelnig@iem.at> Tue, 2 Oct 2018 21:10:42 +0200 + +zexy (2.2.7) RELEASED; urgency=medium + + * [multireceive] + * - dynamically calculate proxy names + * - added help-patch + * [demultiplex] / [multiplex] + * - use passive inlet instead of "select" method + * Turn aliases into proper clases + (Closes: https://sourceforge.net/p/pure-data/bugs/929/) + * Fix crasher bug with "dsp" methods + * Minor and major Bug-fixes + * Properly initialize variables + * More tests + * Fix typos + * Add CI-configuration + * Don't include repository-settings in release-tarballs + + -- IOhannes m zmölnig <zmoelnig@iem.at> Sun, 21 Jan 2018 22:55:11 +0100 + zexy (2.2.6) RELEASED; urgency=low - * Fixes NULL-pointer access and file handle leaks - * Fixes for autotools + * Fix NULL-pointer access and file handle leaks + * Fix for autotools * Allow to build both single-object and multiobject binaries in one go (just use "--enable-library=both") - * Allow setting the build-date string via autoconf-args + * Allow setting the build-date string via autoconf-args * Consistency fixes for objects. * Switched to git @@ -13,17 +60,17 @@ zexy (2.2.6) RELEASED; urgency=low zexy (2.2.5) RELEASED; urgency=low - * switched to autotools - * generate ChangeLog with "dch -c ChangeLog" + * Switch to autotools + * Generate ChangeLog with "dch -c ChangeLog" -- IOhannes m zmoelnig (gpg-key at iem) <zmoelnig@iem.at> Thu, 29 Sep 2011 14:19:18 +0200 zexy (2.2.4) RELEASED; urgency=low - * disable SIMD code by default (prevent crashes) + * Disable SIMD code by default (prevent crashes) * [msgfile] does not crash with [add2( on an emtpy buffer * [pack]/[unpack] now accept all messages (like their vanilla counterparts) * [limiter~] on-the-fly oversampling parameters (higher precision) - * all code is now UTF-8 + * All code is now UTF-8 -- IOhannes m zmoelnig (gpg-key at iem) <zmoelnig@iem.at> Wed, 26 Sep 2011 21:20:20 +0200 diff --git a/externals/zexy/INSTALL b/externals/zexy/INSTALL deleted file mode 100644 index 7d1c323beae76333f523f6df31c47a87f5597edb..0000000000000000000000000000000000000000 --- a/externals/zexy/INSTALL +++ /dev/null @@ -1,365 +0,0 @@ -Installation Instructions -************************* - -Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, -2006, 2007, 2008, 2009 Free Software Foundation, Inc. - - Copying and distribution of this file, with or without modification, -are permitted in any medium without royalty provided the copyright -notice and this notice are preserved. This file is offered as-is, -without warranty of any kind. - -Basic Installation -================== - - Briefly, the shell commands `./configure; make; make install' should -configure, build, and install this package. The following -more-detailed instructions are generic; see the `README' file for -instructions specific to this package. Some packages provide this -`INSTALL' file but do not implement all of the features documented -below. The lack of an optional feature in a given package is not -necessarily a bug. More recommendations for GNU packages can be found -in *note Makefile Conventions: (standards)Makefile Conventions. - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, and a -file `config.log' containing compiler output (useful mainly for -debugging `configure'). - - It can also use an optional file (typically called `config.cache' -and enabled with `--cache-file=config.cache' or simply `-C') that saves -the results of its tests to speed up reconfiguring. Caching is -disabled by default to prevent problems with accidental use of stale -cache files. - - If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can -be considered for the next release. If you are using the cache, and at -some point `config.cache' contains results you don't want to keep, you -may remove or edit it. - - The file `configure.ac' (or `configure.in') is used to create -`configure' by a program called `autoconf'. You need `configure.ac' if -you want to change it or regenerate `configure' using a newer version -of `autoconf'. - - The simplest way to compile this package is: - - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. - - Running `configure' might take a while. While running, it prints - some messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Optionally, type `make check' to run any self-tests that come with - the package, generally using the just-built uninstalled binaries. - - 4. Type `make install' to install the programs and any data files and - documentation. When installing into a prefix owned by root, it is - recommended that the package be configured and built as a regular - user, and only the `make install' phase executed with root - privileges. - - 5. Optionally, type `make installcheck' to repeat any self-tests, but - this time using the binaries in their final installed location. - This target does not install anything. Running this target as a - regular user, particularly if the prior `make install' required - root privileges, verifies that the installation completed - correctly. - - 6. You can remove the program binaries and object files from the - source code directory by typing `make clean'. To also remove the - files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is - also a `make maintainer-clean' target, but that is intended mainly - for the package's developers. If you use it, you may have to get - all sorts of other programs in order to regenerate files that came - with the distribution. - - 7. Often, you can also type `make uninstall' to remove the installed - files again. In practice, not all packages have tested that - uninstallation works correctly, even though it is required by the - GNU Coding Standards. - - 8. Some packages, particularly those that use Automake, provide `make - distcheck', which can by used by developers to test that all other - targets like `make install' and `make uninstall' work correctly. - This target is generally not run by end users. - -Compilers and Options -===================== - - Some systems require unusual options for compilation or linking that -the `configure' script does not know about. Run `./configure --help' -for details on some of the pertinent environment variables. - - You can give `configure' initial values for configuration parameters -by setting variables in the command line or in the environment. Here -is an example: - - ./configure CC=c99 CFLAGS=-g LIBS=-lposix - - *Note Defining Variables::, for more details. - -Compiling For Multiple Architectures -==================================== - - You can compile the package for more than one kind of computer at the -same time, by placing the object files for each architecture in their -own directory. To do this, you can use GNU `make'. `cd' to the -directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. This -is known as a "VPATH" build. - - With a non-GNU `make', it is safer to compile the package for one -architecture at a time in the source code directory. After you have -installed the package for one architecture, use `make distclean' before -reconfiguring for another architecture. - - On MacOS X 10.5 and later systems, you can create libraries and -executables that work on multiple system types--known as "fat" or -"universal" binaries--by specifying multiple `-arch' options to the -compiler but only a single `-arch' option to the preprocessor. Like -this: - - ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ - CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ - CPP="gcc -E" CXXCPP="g++ -E" - - This is not guaranteed to produce working output in all cases, you -may have to build one architecture at a time and combine the results -using the `lipo' tool if you have problems. - -Installation Names -================== - - By default, `make install' installs the package's commands under -`/usr/local/bin', include files under `/usr/local/include', etc. You -can specify an installation prefix other than `/usr/local' by giving -`configure' the option `--prefix=PREFIX', where PREFIX must be an -absolute file name. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -pass the option `--exec-prefix=PREFIX' to `configure', the package uses -PREFIX as the prefix for installing programs and libraries. -Documentation and other data files still use the regular prefix. - - In addition, if you use an unusual directory layout you can give -options like `--bindir=DIR' to specify different values for particular -kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. In general, the -default for these options is expressed in terms of `${prefix}', so that -specifying just `--prefix' will affect all of the other directory -specifications that were not explicitly provided. - - The most portable way to affect installation locations is to pass the -correct locations to `configure'; however, many packages provide one or -both of the following shortcuts of passing variable assignments to the -`make install' command line to change installation locations without -having to reconfigure or recompile. - - The first method involves providing an override variable for each -affected directory. For example, `make install -prefix=/alternate/directory' will choose an alternate location for all -directory configuration variables that were expressed in terms of -`${prefix}'. Any directories that were specified during `configure', -but not in terms of `${prefix}', must each be overridden at install -time for the entire installation to be relocated. The approach of -makefile variable overrides for each directory variable is required by -the GNU Coding Standards, and ideally causes no recompilation. -However, some platforms have known limitations with the semantics of -shared libraries that end up requiring recompilation when using this -method, particularly noticeable in packages that use GNU Libtool. - - The second method involves providing the `DESTDIR' variable. For -example, `make install DESTDIR=/alternate/directory' will prepend -`/alternate/directory' before all installation names. The approach of -`DESTDIR' overrides is not required by the GNU Coding Standards, and -does not work on platforms that have drive letters. On the other hand, -it does better at avoiding recompilation issues, and works well even -when some directory options were not specified in terms of `${prefix}' -at `configure' time. - -Optional Features -================= - - If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - - Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the -package recognizes. - - For packages that use the X Window System, `configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. - - Some packages offer the ability to configure how verbose the -execution of `make' will be. For these packages, running `./configure ---enable-silent-rules' sets the default to minimal output, which can be -overridden with `make V=1'; while running `./configure ---disable-silent-rules' sets the default to verbose, which can be -overridden with `make V=0'. - -Particular systems -================== - - On HP-UX, the default C compiler is not ANSI C compatible. If GNU -CC is not installed, it is recommended to use the following options in -order to use an ANSI C compiler: - - ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" - -and if that doesn't work, install pre-built binaries of GCC for HP-UX. - - On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot -parse its `<wchar.h>' header file. The option `-nodtk' can be used as -a workaround. If GNU CC is not installed, it is therefore recommended -to try - - ./configure CC="cc" - -and if that doesn't work, try - - ./configure CC="cc -nodtk" - - On Solaris, don't put `/usr/ucb' early in your `PATH'. This -directory contains several dysfunctional programs; working variants of -these programs are available in `/usr/bin'. So, if you need `/usr/ucb' -in your `PATH', put it _after_ `/usr/bin'. - - On Haiku, software installed for all users goes in `/boot/common', -not `/usr/local'. It is recommended to use the following options: - - ./configure --prefix=/boot/common - -Specifying the System Type -========================== - - There may be some features `configure' cannot figure out -automatically, but needs to determine by the type of machine the package -will run on. Usually, assuming the package is built to be run on the -_same_ architectures, `configure' can figure that out, but if it prints -a message saying it cannot guess the machine type, give it the -`--build=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name which has the form: - - CPU-COMPANY-SYSTEM - -where SYSTEM can have one of these forms: - - OS - KERNEL-OS - - See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't -need to know the machine type. - - If you are _building_ compiler tools for cross-compiling, you should -use the option `--target=TYPE' to select the type of system they will -produce code for. - - If you want to _use_ a cross compiler, that generates code for a -platform different from the build platform, you should specify the -"host" platform (i.e., that on which the generated programs will -eventually be run) with `--host=TYPE'. - -Sharing Defaults -================ - - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. - -Defining Variables -================== - - Variables not defined in a site shell script can be set in the -environment passed to `configure'. However, some packages may run -configure again during the build, and the customized values of these -variables may be lost. In order to avoid this problem, you should set -them in the `configure' command line, using `VAR=value'. For example: - - ./configure CC=/usr/local2/bin/gcc - -causes the specified `gcc' to be used as the C compiler (unless it is -overridden in the site shell script). - -Unfortunately, this technique does not work for `CONFIG_SHELL' due to -an Autoconf bug. Until the bug is fixed you can use this workaround: - - CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash - -`configure' Invocation -====================== - - `configure' recognizes the following options to control how it -operates. - -`--help' -`-h' - Print a summary of all of the options to `configure', and exit. - -`--help=short' -`--help=recursive' - Print a summary of the options unique to this package's - `configure', and exit. The `short' variant lists options used - only in the top level, while the `recursive' variant lists options - also present in any nested packages. - -`--version' -`-V' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`--cache-file=FILE' - Enable the cache: use and save the results of the tests in FILE, - traditionally `config.cache'. FILE defaults to `/dev/null' to - disable caching. - -`--config-cache' -`-C' - Alias for `--cache-file=config.cache'. - -`--quiet' -`--silent' -`-q' - Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error - messages will still be shown). - -`--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. - -`--prefix=DIR' - Use DIR as the installation prefix. *note Installation Names:: - for more details, including other options available for fine-tuning - the installation locations. - -`--no-create' -`-n' - Run the configure checks, but stop before creating any output - files. - -`configure' also accepts some other, not widely useful, options. Run -`configure --help' for more details. - diff --git a/externals/zexy/Makefile b/externals/zexy/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..ec5844546dd2f23cbc3e855aeb0b4acf7d680e0e --- /dev/null +++ b/externals/zexy/Makefile @@ -0,0 +1,226 @@ +# Makefile to build 'zexy' for Pure Data. +# Needs Makefile.pdlibbuilder as helper makefile for platform-dependent build +# settings and rules. + +# library name +lib.name = zexy + + +make-lib-executable=no +with-regex=yes +with-lpt=yes + +# input source file (class name == source file basename) +class.sources = \ + src/0x260x26_tilde.c \ + src/0x2e.c \ + src/0x3c_tilde.c \ + src/0x3d0x3d_tilde.c \ + src/0x3e_tilde.c \ + src/0x7c0x7c_tilde.c \ + src/a2l.c \ + src/abs~.c \ + src/absgn~.c \ + src/atof.c \ + src/atoi.c \ + src/avg~.c \ + src/blockmirror~.c \ + src/blockshuffle~.c \ + src/blockswap~.c \ + src/date.c \ + src/demultiplex~.c \ + src/demultiplex.c \ + src/dfreq~.c \ + src/dirac~.c \ + src/doublepole~.c \ + src/drip.c \ + src/envrms~.c \ + src/fifop.c \ + src/freadln.c \ + src/fwriteln.c \ + src/glue.c \ + src/index.c \ + src/length.c \ + src/lifop.c \ + src/limiter~.c \ + src/list2int.c \ + src/list2lists.c \ + src/list2symbol.c \ + src/lister.c \ + src/listfind.c \ + src/liststorage.c \ + src/longload.c \ + src/lpt.c \ + src/makesymbol.c \ + src/matchbox.c \ + src/mavg.c \ + src/minmax.c \ + src/msgfile.c \ + src/multiline~.c \ + src/multiplex~.c \ + src/multiplex.c \ + src/multireceive.c \ + src/niagara.c \ + src/noish~.c \ + src/noisi~.c \ + src/operating_system.c \ + src/pack~.c \ + src/pack.c \ + src/packel.c \ + src/pdf~.c \ + src/prime.c \ + src/quantize~.c \ + src/rawprint.c \ + src/regex.c \ + src/relay.c \ + src/repack.c \ + src/repeat.c \ + src/route~.c \ + src/sfplay.c \ + src/sfrecord.c \ + src/sgn~.c \ + src/sigzero~.c \ + src/sleepgrain.c \ + src/sort.c \ + src/step~.c \ + src/strcmp.c \ + src/sum.c \ + src/swap~.c \ + src/symbol2list.c \ + src/tabdump.c \ + src/tabminmax.c \ + src/tabread4~~.c \ + src/tabset.c \ + src/tavg~.c \ + src/time.c \ + src/unpack~.c \ + src/unpack.c \ + src/urn.c \ + src/wrap.c \ + src/z~.c \ + $(empty) + +lib.setup.sources = \ + src/zexy.c \ + src/z_zexy.c \ + $(empty) + +## TODO: install help-files for these aliases +l.class.sources = src/lister.c +demux~.class.sources = src/demultiplex~.c +demux.class.sources = src/demultiplex.c +mux~.class.sources = src/multiplex~.c +mux.class.sources = src/multiplex.c +l2s.class.sources = src/list2symbol.c +s2l.class.sources = src/symbol2list.c +l2i.class.sources = src/list2int.c +any2list.class.sources = src/a2l.c + +# abs-aliases: any2list, l2i + +# all extra files to be included in binary distribution of the library +datafiles = \ + AUTHORS \ + README.txt \ + LICENSE.txt \ + ChangeLog \ + zexy-meta.pd \ + $(empty) + +datafiles += \ + $(wildcard abs/*.pd) \ + $(wildcard reference/*.pd) \ + $(empty) + +cflags = -DVERSION='"$(lib.version)"' + +DATE_FMT = %Y/%m/%d at %H:%M:%S UTC +ifdef SOURCE_DATE_EPOCH + BUILD_DATE ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "+$(DATE_FMT)" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "+$(DATE_FMT)" 2>/dev/null || date -u "+$(DATE_FMT)") +endif +ifdef BUILD_DATE +cflags += -DBUILD_DATE='"$(BUILD_DATE)"' +endif + + +ifeq ($(make-lib-executable),yes) + cflags += -DZEXY_LIBRARY +endif + +ifeq ($(with-regex),yes) + cflags += -DHAVE_REGEX_H +endif + +ifneq ($(with-lpt),yes) + cflags += -DZ_WANT_LPT=0 +endif + +define forWindows + ifeq ($(with-regex),yes) + regex.class.ldlibs += -lregex + matchbox.class.ldlibs += -lregex + ifeq ($(make-lib-executable),yes) + ldlibs += -lregex + endif + endif +endef + +define forLinux + # on linux we need <sys/io.h> for the [lpt] object, so check if it is there... + ifeq ($(with-lpt),yes) + ifeq ($(shell $(CPP) -x c -include "sys/io.h" /dev/null >/dev/null 2>&1 || echo no), no) + cflags += -DZ_WANT_LPT=0 + endif + endif +endef + + + +# include Makefile.pdlibbuilder from submodule directory 'pd-lib-builder' +PDLIBBUILDER_DIR=pd-lib-builder/ +include $(PDLIBBUILDER_DIR)/Makefile.pdlibbuilder + +COPY=cp +# aliases +vpath %.pd abs reference +zexyaliases = \ + any2list.pd any2list-help.pd \ + demux-help.pd demux~-help.pd \ + mux-help.pd mux~-help.pd \ + l2i.pd l2i-help.pd \ + l2s-help.pd s2l-help.pd l-help.pd \ + $(empty) +datafiles += $(zexyaliases) + +# create aliases +$(zexyaliases): + test -e $< && $(COPY) $< $@ + +# delete aliases +.PHONY: clean_zexyalias +clean_zexyalias: + -rm -f $(zexyaliases) +clean: clean_zexyalias + +# alias dependencies +any2list.pd: a2l.pd +any2list-help.pd: a2l-help.pd +l2i.pd: list2int.pd +l2i-help.pd: list2int-help.pd +l2s-help.pd: list2symbol-help.pd +s2l-help.pd: symbol2list-help.pd +l-help.pd: lister-help.pd +mux-help.pd: multiplex-help.pd +mux~-help.pd: multiplex~-help.pd +demux-help.pd: demultiplex-help.pd +demux~-help.pd: demultiplex~-help.pd + +all: $(zexyaliases) + +.PHONY: check style + +style: + astyle --options=src/astyle.rc src/*.c src/*.h + +check: all + LIBDIR=$(CURDIR) find tests/*/ -type f -name "*.pd" -exec tests/testrunner.sh -v -Xls {} "+" diff --git a/externals/zexy/Makefile.am b/externals/zexy/Makefile.am deleted file mode 100644 index 09dfe56a5ef2b8f40464b73b163848d0f8943409..0000000000000000000000000000000000000000 --- a/externals/zexy/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ -AUTOMAKE_OPTIONS = foreign -ACLOCAL_AMFLAGS = -I m4 - -SUBDIRS = src abs reference -SUBDIRS += tests build - -zexydir=$(pkglibdir) -dist_zexy_DATA = \ - AUTHORS \ - README.txt \ - INSTALL \ - LICENSE.txt \ - ChangeLog \ - zexy-meta.pd - -LIBTOOL_DEPS = @LIBTOOL_DEPS@ -libtool: $(LIBTOOL_DEPS) - $(SHELL) ./config.status libtool diff --git a/externals/zexy/README.txt b/externals/zexy/README.txt index e337790675aa0bb197f7957dc98705c3f43f728a..3c237d208a0c2b5071150d82033f4b0a60bcd37b 100644 --- a/externals/zexy/README.txt +++ b/externals/zexy/README.txt @@ -1,134 +1,78 @@ -============================================================================== -the zexy external -============================================================================== - -outline of this file:: -============================================================================== - + general - + installation - + linux, irix, OSX,... (autoconf) - + w32 - + using - + license - - -general:: -============================================================================== -the zexy external is a collection of externals for miller.s.puckette's -realtime-computermusic-environment called "puredata" (or abbreviated "pd") -this zexy external will be of no use, if you don't have a running version of -pd on your system. -check out for http://pd.iem.at to learn more about pd and how to get it - -note: the zexy external is published under the Gnu General Public License -that is included (GnuGPL.txt). some parts of the code are taken directly -from the pd source-code, they, of course, fall under the license pd is -published under. - - - -installation:: -============================================================================== - -linux, irix, osx, mingw,... : ------------------------------------------------------------------------------- -see INSTALL for more detailed instructions - -#0> ./autogen.sh -#1> ./configure -#2> make -#3> make install - -installation directory: -by defaultm zexy will install into /usr/local/lib/pd/extra/zexy -the path can be changed via the "--prefix", or "--libdir" -e.g. "./configure --prefix=/usr" -> /usr/lib/pd/extra/zexy -e.g. "./configure --libdir=/tmp/foo" -> /tmp/foo/zexy - -puredata headers: -zexy needs to find the Pd headers (and Pd.lib on some systems) during the build -process. -if you have installed the headers in a non-standard location, you can specify -them with the "--with-pd" option: -"./configure --with-pd=/usr/include/pd" will add /usr/include/pd to the INCLUDE -path. -"./configure --with-pd=/home/me/src/Pd-0.43.1" can be used to add -/home/me/src/Pd-0.43.1/src to the INCLUDEs and /home/me/src/Pd-0.43.1/bin to the -library search path - -custom external extension: -zexy does it's best to determine the correct external extension for your system. -e.g. it will use "dll" on w32, or "pd_linux" on linux. -if - for whatever obscure reasons - you want to force the extension to certain -value, you can use the "--with-extension" flag: -"./configure --with-extension=l_ia64" will use "l_ia64" for the resulting -binaries - -SSE2 (SIMD): -by default zexy is compiled without SIMD optimization (recently there have been -reports about crashes, when SSE2 was enabled; until this is fixed, the default -is to use the safe fallback) -if you want to enable SSE2 optimization, configure with -"./configure --enable-simd=SSE2" - -multi-object vs single-object libraries: -by default, zexy builds a single library "zexy" that contains all objects. -if - for some obscure reason - you insist on having a lot of small libraries -each containing a single object, you can enable this by using the -"--disable-library" flag - -parallel port support: -if you don't want the parallel-port object [lpt] you can disable it with - "--disable-lpt" - (e.g.: because you don't have a parallel-port) - - -fat (multiarch) binaries: -for building multi-arch binaries (currently only supported on OSX), specify the -wanted architectures in the "--enable-fat-binary" flag -e.g. "./configure --enable-fat-binary=i386,ppc --with-extension=d_fat" - -win32 : ------------------------------------------------------------------------------- - -to compile: - + w/ MSVC use the build project found in build/win-vs*/ - OR - + with GCC configure your pd path, eg: - #> ./configure --prefix=/c/program/pd; make; make install - OR - + cross-compilation for windows on linux using mingw (assumes that the - crosscompiler is "i586-mingw32msvc-cc") - #> ./configure --host=i586-mingw32msvc --with-extension=dll \ - --disable-PIC --with-pd=/path/to/win/pd/ - #> make CFLAGS="-fno-unit-at-a-time" - notes: configure tries to set the CFLAGS to "-g -O2" if the compiler - accepts this; however, this optimization sometimes generates - binaries that cannot be loaded by pd; it seems that disabling - the "unit-at-a-time" optimization (which gets enabled by "-O2") - is the cause of this problem. turning it off might help - -making pd run with the zexy external:: -============================================================================== -make sure, that pd will be looking at this location -(add "-path <mypath>/pd/externs" either to your .pdrc or each time -you execute pd) -make sure, that you somehow load the zexy external (either add "-lib zexy" -(if you advised pd somehow to look at the correct place) -or "-lib <myzexypath>/zexy" to your startup-script (.pdrc or whatever) -or load it via the object "zexy" at runtime - -license:: -============================================================================== - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program. If not, see <http://www.gnu.org/licenses/>. +============================================================================== +the zexy external +============================================================================== + +outline of this file:: +============================================================================== + + general + + using + + bugs + + compilation/installation + + license + + +general:: +============================================================================== +the zexy external is a collection of externals for miller.s.puckette's +realtime-computermusic-environment called "pure data" (or abbreviated "pd") +this zexy external will be of no use, if you don't have a running version of +pd on your system. +check out for http://pd.iem.at to learn more about pd and how to get it + +note: the zexy external is published under the GNU General Public License +that is included (LICENSE.txt). some parts of the code are taken directly +from the pd source-code, they, of course, fall under the license pd is +published under. + +making pd run with the zexy external:: +============================================================================== +make sure, that pd will be looking at the location you installed zexy to. +ideally install zexy to some place, where pd already searches for libraries, +e.g. "~/.local/lib/pd/extra/" (linux), "~/Library/Pd/extra/" (macOS) or +"%AppData%\Pd\extra\" (Windows). +if this is not an option, either add the path to your "Path..." settings in pd, +or start pd with the cmdline option "-path /path/where/zexy/lives" (you can omit +the trailing "/zexy" component of the path) + +make sure, that you somehow load the zexy external, either by adding "zexy" to +the "Startup..." libraries (or by starting pd with "-lib zexy"), or (and this is +the preferred method) by adding something like the following to your patches: + + [declare -path zexy -lib zexy] + + +bugs:: +============================================================================== +if you happen to find any bugs, please report them at + https://git.iem.at/pd/zexy + + +installation:: +============================================================================== + +linux, irix, osx, mingw,... : +------------------------------------------------------------------------------ + +you will need to have Pd installed, and a C-compiler (preferably gcc) +as well as a GNUmake compatible implementation of 'make'. + +on windows, you also need MSYS2/MinGW installed. + +#1> make +#2> make install + + +license:: +============================================================================== + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program. If not, see <http://www.gnu.org/licenses/>. diff --git a/externals/zexy/abs/Makefile.am b/externals/zexy/abs/Makefile.am deleted file mode 100644 index 2a009ae553dda266838bf9e8ce9f11e3b1944e2c..0000000000000000000000000000000000000000 --- a/externals/zexy/abs/Makefile.am +++ /dev/null @@ -1,79 +0,0 @@ -AUTOMAKE_OPTIONS = foreign - -SUFFIXES = .pd - -zexydir=$(pkglibdir) - -dist_zexy_DATA= \ - 0x260x260x7e.pd \ - 0x3c0x7e-help.pd \ - 0x3c0x7e.pd \ - 0x3d0x3d0x7e.pd \ - 0x3e0x7e-help.pd \ - 0x3e0x7e.pd \ - 0x7c0x7c0x7e-help.pd \ - 0x7c0x7c0x7e.pd \ - a2l.pd \ - absgn~-help.pd \ - absgn~.pd \ - abs~-help.pd \ - abs~.pd \ - cart2pol-help.pd \ - cart2pol.pd \ - cart2sph-help.pd \ - cart2sph.pd \ - deg2rad-help.pd \ - deg2rad.pd \ - ==~-help.pd \ - &&~-help.pd \ - length.pd \ - list2int.pd \ - mavg.pd \ - mean-help.pd \ - mean.pd \ - minmax.pd \ - nop~-help.pd \ - nop-help.pd \ - nop~.pd \ - nop.pd \ - pol2cart-help.pd \ - pol2cart.pd \ - pol2sph-help.pd \ - pol2sph.pd \ - polyfun-help.pd \ - polyfun.pd \ - rad2deg-help.pd \ - rad2deg.pd \ - repack.pd \ - segregate-help.pd \ - segregate.pd \ - sgn~-help.pd \ - sgn~.pd \ - sph2cart-help.pd \ - sph2cart.pd \ - sph2pol-help.pd \ - sph2pol.pd \ - sum.pd \ - tabset.pd \ - uniqsym-help.pd \ - uniqsym.pd -############# -# symlinks for aliases -zexyaliasdir=$(pkglibdir) - -clean-local: clean_zexyalias -.PHONY: clean_zexyalias - -dist_zexyalias_DATA = any2list.pd l2i.pd - -# create aliases -$(dist_zexyalias_DATA): - test -e $< && $(LN_S) $< $@ - -# delete aliases -clean_zexyalias: - -rm -f $(dist_zexyalias_DATA) - -# define aliases -any2list.pd: a2l.pd -l2i.pd: list2int.pd diff --git a/externals/zexy/autogen.sh b/externals/zexy/autogen.sh deleted file mode 100755 index e0fbad4cd9f36916dfc9ef9931db6706aca332cc..0000000000000000000000000000000000000000 --- a/externals/zexy/autogen.sh +++ /dev/null @@ -1,160 +0,0 @@ -#!/bin/sh - -package=zexy - - -KERN=$(uname -s) -case "${KERN}" in - Darwin) - PATH=/sw/bin:${PATH} - ;; - *) - ;; -esac - -echo PATH: $PATH - - -AUTORECONF=$(which autoreconf) - -AUTOHEADER=$(which autoheader) -AUTOMAKE=$(which automake) -ACLOCAL=$(which aclocal) -LIBTOOL=$(which libtool) -LIBTOOLIZE=$(which libtoolize) -AUTOCONF=$(which autoconf) - -case "${KERN}" in - MINGW*) - AUTORECONF="" - ;; - *) - ;; -esac - - -#check whether the system supports pushd/popd -if pushd . > /dev/null 2>&1 -then - popd > /dev/null 2>&1 -else -## some shells (namely dash) don't support pushd/popd -## here we provide some dummies -pushd () { - echo "ignoring pushd to $@" -} - -popd () { - echo "ignoring popd ..." -} -fi - - -autoconf_getsubdirs () { - if [ -e configure.ac ]; then - cat configure.ac | sed -e 's|#.*$||' | grep AC_CONFIG_SUBDIRS | \ - sed -e 's|^.*AC_CONFIG_SUBDIRS(\[\(.*\)\]).*$|\1|' - fi -} - -runit () { -echo " $@" -$@ -} - -manual_autoreconf_doit () { - echo faking autoreconf for $1 - pushd $1 - - runit $ACLOCAL -I . -I $BASEDIR/m4 || exit 1 - - runit $LIBTOOLIZE --automake -c || exit 1 - - runit $AUTOCONF || exit 1 - - if test -e configure.ac && grep AC_CONFIG_HEADER configure.ac > /dev/null 2>&1; then - runit $AUTOHEADER --force || exit 1 - fi - - if [ -e Makefile.am ]; then - runit $AUTOMAKE --add-missing -c || exit 1 - fi - popd -} - -manual_autoreconf () { - echo faking autoreconf.. - BASEDIR=${0%/*} - pushd $BASEDIR - BASEDIR=$(pwd) - popd - - if [ "x${SUBDIRS}" = "x" ]; then - #SUBDIRS=autoconf_getsubdirs - - SUBDIRS="." - fi - - -# check for all the needed helpers - DIE=0 -($AUTOCONF --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have autoconf installed to compile $package." - echo "Download the appropriate package for your distribution," - echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" - DIE=1 -} - -($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have automake installed to compile $package." - echo "Download the appropriate package for your system," - echo "or get the source from one of the GNU ftp sites" - echo "listed in http://www.gnu.org/order/ftp.html" - DIE=1 -} - -($ACLOCAL --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have aclocal installed to compile $package." - echo "Download the appropriate package for your system," - echo "or get the source from one of the GNU ftp sites" - echo "listed in http://www.gnu.org/order/ftp.html" - DIE=1 -} - -($LIBTOOL --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have libtool installed to compile $package." - echo "Download the appropriate package for your system," - echo "or get the source from one of the GNU ftp sites" - echo "listed in http://www.gnu.org/order/ftp.html" - DIE=1 -} -($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have libtoolize installed to compile $package." - echo "Download the appropriate package for your system," - echo "or get the source from one of the GNU ftp sites" - echo "listed in http://www.gnu.org/order/ftp.html" - DIE=1 -} - -if test "$DIE" -eq 1; then - exit 1 -fi - -for s in ${SUBDIRS}; do - manual_autoreconf_doit ${BASEDIR}/${s} -done -} - - -if test x$AUTORECONF != x; then - echo running autoreconf ${AUTORECONF} - $AUTORECONF --force --verbose --install -else - echo not running autoreconf... - manual_autoreconf -fi diff --git a/externals/zexy/build/Makefile.am b/externals/zexy/build/Makefile.am deleted file mode 100644 index 364b98bf0ca745560dda19335e27aec88995f615..0000000000000000000000000000000000000000 --- a/externals/zexy/build/Makefile.am +++ /dev/null @@ -1,24 +0,0 @@ -AUTOMAKE_OPTIONS = foreign - -EXTRA_DIST = \ - autoconf/README.txt \ - README.txt \ - win-vs2003/zexy.sln \ - win-vs2003/zexy.vcproj \ - win-vs2008/zexy.sln \ - win-vs2008/zexy.vcproj \ - win-vs6/zexy.dsp \ - win-vs6/zexy.dsw \ - win-vs7.10/zexy.sln \ - win-vs7.10/zexy.vcproj \ - autoconf/README.txt \ - Makefile.am \ - README.txt \ - win-vs2003/zexy.sln \ - win-vs2003/zexy.vcproj \ - win-vs2008/zexy.sln \ - win-vs2008/zexy.vcproj \ - win-vs6/zexy.dsp \ - win-vs6/zexy.dsw \ - win-vs7.10/zexy.sln \ - win-vs7.10/zexy.vcproj diff --git a/externals/zexy/build/README.txt b/externals/zexy/build/README.txt deleted file mode 100644 index fe4cd285da091e57438057a4a7aa06562b4a15c7..0000000000000000000000000000000000000000 --- a/externals/zexy/build/README.txt +++ /dev/null @@ -1,36 +0,0 @@ -build-instructions for zexy -=========================== - - -autoconf/make -============= -this is the preferred way to build zexy, if your system supports autoconf/make. -such systems include: -- linux / gcc -- os-x / gcc -- windows / mingw -- windows / cygwin -- freebsd -- ... - -just go into the zexy/src/ directory, and run - % make -or alternatively: - % aclocal - % autoconf - % ./configure - % make - -use - % ./configure --help -to see flags you can pass to configure to get special builds - - - - -Microsoft Visual Studio -======================= -use the provided project-files in the directories -win-nmake: for nmake based builds -win-vs6: for Microsoft VisualStudio 6 -win-vs2003: for Microsoft VisualStudio .NET 2003 diff --git a/externals/zexy/build/autoconf/README.txt b/externals/zexy/build/autoconf/README.txt deleted file mode 100644 index 304f93111f6e619b40e5643db950dbab14d59893..0000000000000000000000000000000000000000 --- a/externals/zexy/build/autoconf/README.txt +++ /dev/null @@ -1,14 +0,0 @@ -the build/autoconf system is currently under revision; -if it doesn't work, try the autoconf-system in <zexy>/src/ instead - - - -GENERIC INSTALL INSTRUCTIONS -============================ -run the following commands: - - ./autogen.sh - ./configure - make - make install - diff --git a/externals/zexy/build/win-vs2003/zexy.sln b/externals/zexy/build/win-vs2003/zexy.sln deleted file mode 100644 index 241f59b15d2549d27625ff0b0c683fa6cf649f9e..0000000000000000000000000000000000000000 --- a/externals/zexy/build/win-vs2003/zexy.sln +++ /dev/null @@ -1,18 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zexy", "zexy.vcproj", "{6B55773B-3FF5-4F09-B538-2A7007DEC4DB}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Release = Release - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {6B55773B-3FF5-4F09-B538-2A7007DEC4DB}.Release.ActiveCfg = Release|Win32 - {6B55773B-3FF5-4F09-B538-2A7007DEC4DB}.Release.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/externals/zexy/build/win-vs2003/zexy.vcproj b/externals/zexy/build/win-vs2003/zexy.vcproj deleted file mode 100644 index 780725e20b23006a014e59a0d1b2c7deee07fe6f..0000000000000000000000000000000000000000 --- a/externals/zexy/build/win-vs2003/zexy.vcproj +++ /dev/null @@ -1,349 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="7.10" - Name="zexy" - ProjectGUID="{6B55773B-3FF5-4F09-B538-2A7007DEC4DB}" - RootNamespace="zexy" - SccProjectName="" - SccLocalPath=""> - <Platforms> - <Platform - Name="Win32"/> - </Platforms> - <Configurations> - <Configuration - Name="Release|Win32" - OutputDirectory="." - IntermediateDirectory=".\obj" - ConfigurationType="2" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="FALSE"> - <Tool - Name="VCCLCompilerTool" - Optimization="4" - AdditionalIncludeDirectories="..\..\..\pd\src;"$(ProgramFiles)\pd\src"" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY" - RuntimeLibrary="4" - StructMemberAlignment="5" - UsePrecompiledHeader="2" - PrecompiledHeaderFile=".\obj/zexy.pch" - AssemblerListingLocation=".\obj/" - ObjectFile=".\obj/" - ProgramDataBaseFileName=".\obj/" - BrowseInformation="1" - WarningLevel="3" - SuppressStartupBanner="TRUE" - CompileAs="0"/> - <Tool - Name="VCCustomBuildTool"/> - <Tool - Name="VCLinkerTool" - AdditionalOptions="/export:zexy_setup" - AdditionalDependencies="wsock32.lib libc.lib oldnames.lib pd.lib" - OutputFile="..\zexy.dll" - LinkIncremental="1" - SuppressStartupBanner="TRUE" - AdditionalLibraryDirectories="..\..\..\pd\bin;"$(ProgramFiles)\pd\bin"" - IgnoreAllDefaultLibraries="TRUE" - ProgramDatabaseFile="./zexy.pdb" - ImportLibrary="./zexy.lib" - TargetMachine="1"/> - <Tool - Name="VCMIDLTool" - SuppressStartupBanner="TRUE" - TargetEnvironment="1" - TypeLibraryName="./zexy.tlb" - HeaderFileName=""/> - <Tool - Name="VCPostBuildEventTool"/> - <Tool - Name="VCPreBuildEventTool"/> - <Tool - Name="VCPreLinkEventTool"/> - <Tool - Name="VCResourceCompilerTool" - Culture="3079"/> - <Tool - Name="VCWebServiceProxyGeneratorTool"/> - <Tool - Name="VCXMLDataGeneratorTool"/> - <Tool - Name="VCWebDeploymentTool"/> - <Tool - Name="VCManagedWrapperGeneratorTool"/> - <Tool - Name="VCAuxiliaryManagedWrapperGeneratorTool"/> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="objectclasses" - Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"> - <File - RelativePath="..\..\src\0x260x260x7e.c"> - </File> - <File - RelativePath="..\..\src\0x2e.c"> - </File> - <File - RelativePath="..\..\src\0x3c0x7e.c"> - </File> - <File - RelativePath="..\..\src\0x3d0x3d0x7e.c"> - </File> - <File - RelativePath="..\..\src\0x3e0x7e.c"> - </File> - <File - RelativePath="..\..\src\0x7c0x7c0x7e.c"> - </File> - <File - RelativePath="..\..\src\a2l.c"> - </File> - <File - RelativePath="..\..\src\absgn~.c"> - </File> - <File - RelativePath="..\..\src\abs~.c"> - </File> - <File - RelativePath="..\..\src\atoi.c"> - </File> - <File - RelativePath="..\..\src\avg~.c"> - </File> - <File - RelativePath="..\..\src\blockmirror~.c"> - </File> - <File - RelativePath="..\..\src\blockshuffle~.c"> - </File> - <File - RelativePath="..\..\src\blockswap~.c"> - </File> - <File - RelativePath="..\..\src\date.c"> - </File> - <File - RelativePath="..\..\src\demultiplex.c"> - </File> - <File - RelativePath="..\..\src\demultiplex~.c"> - </File> - <File - RelativePath="..\..\src\dfreq~.c"> - </File> - <File - RelativePath="..\..\src\dirac~.c"> - </File> - <File - RelativePath="..\..\src\drip.c"> - </File> - <File - RelativePath="..\..\src\envrms~.c"> - </File> - <File - RelativePath="..\..\src\fifop.c"> - </File> - <File - RelativePath="..\..\src\freadln.c"> - </File> - <File - RelativePath="..\..\src\fwriteln.c"> - </File> - <File - RelativePath="..\..\src\glue.c"> - </File> - <File - RelativePath="..\..\src\index.c"> - </File> - <File - RelativePath="..\..\src\length.c"> - </File> - <File - RelativePath="..\..\src\lifop.c"> - </File> - <File - RelativePath="..\..\src\limiter~.c"> - </File> - <File - RelativePath="..\..\src\list2int.c"> - </File> - <File - RelativePath="..\..\src\list2lists.c"> - </File> - <File - RelativePath="..\..\src\list2symbol.c"> - </File> - <File - RelativePath="..\..\src\lister.c"> - </File> - <File - RelativePath="..\..\src\listfind.c"> - </File> - <File - RelativePath="..\..\src\lpt.c"> - </File> - <File - RelativePath="..\..\src\makesymbol.c"> - </File> - <File - RelativePath="..\..\src\matchbox.c"> - </File> - <File - RelativePath="..\..\src\mavg.c"> - </File> - <File - RelativePath="..\..\src\minmax.c"> - </File> - <File - RelativePath="..\..\src\msgfile.c"> - </File> - <File - RelativePath="..\..\src\multiline~.c"> - </File> - <File - RelativePath="..\..\src\multiplex.c"> - </File> - <File - RelativePath="..\..\src\multiplex~.c"> - </File> - <File - RelativePath="..\..\src\niagara.c"> - </File> - <File - RelativePath="..\..\src\noish~.c"> - </File> - <File - RelativePath="..\..\src\noisi~.c"> - </File> - <File - RelativePath="..\..\src\operating_system.c"> - </File> - <File - RelativePath="..\..\src\pack.c"> - </File> - <File - RelativePath="..\..\src\packel.c"> - </File> - <File - RelativePath="..\..\src\pack~.c"> - </File> - <File - RelativePath="..\..\src\pdf~.c"> - </File> - <File - RelativePath="..\..\src\prime.c"> - </File> - <File - RelativePath="..\..\src\quantize~.c"> - </File> - <File - RelativePath="..\..\src\regex.c"> - </File> - <File - RelativePath="..\..\src\relay.c"> - </File> - <File - RelativePath="..\..\src\repack.c"> - </File> - <File - RelativePath="..\..\src\repeat.c"> - </File> - <File - RelativePath="..\..\src\route~.c"> - </File> - <File - RelativePath="..\..\src\sfplay.c"> - </File> - <File - RelativePath="..\..\src\sfrecord.c"> - </File> - <File - RelativePath="..\..\src\sgn~.c"> - </File> - <File - RelativePath="..\..\src\sigzero~.c"> - </File> - <File - RelativePath="..\..\src\sort.c"> - </File> - <File - RelativePath="..\..\src\step~.c"> - </File> - <File - RelativePath="..\..\src\strcmp.c"> - </File> - <File - RelativePath="..\..\src\sum.c"> - </File> - <File - RelativePath="..\..\src\swap~.c"> - </File> - <File - RelativePath="..\..\src\symbol2list.c"> - </File> - <File - RelativePath="..\..\src\tabdump.c"> - </File> - <File - RelativePath="..\..\src\tabminmax.c"> - </File> - <File - RelativePath="..\..\src\tabread4~~.c"> - </File> - <File - RelativePath="..\..\src\tabset.c"> - </File> - <File - RelativePath="..\..\src\tavg~.c"> - </File> - <File - RelativePath="..\..\src\time.c"> - </File> - <File - RelativePath="..\..\src\unpack.c"> - </File> - <File - RelativePath="..\..\src\unpack~.c"> - </File> - <File - RelativePath="..\..\src\urn.c"> - </File> - <File - RelativePath="..\..\src\wrap.c"> - </File> - <File - RelativePath="..\..\src\z~.c"> - </File> - </Filter> - <Filter - Name="zexy" - Filter="h;hpp;hxx;hm;inl"> - <File - RelativePath="..\..\src\z_zexy.c"> - </File> - <File - RelativePath="..\..\src\z_zexy.h"> - </File> - <File - RelativePath="..\..\src\zexy.c"> - </File> - <File - RelativePath="..\..\src\zexy.h"> - </File> - </Filter> - <Filter - Name="helper" - Filter=""> - <File - RelativePath="..\..\src\winNT_portio.c"> - </File> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/externals/zexy/build/win-vs2008/zexy.sln b/externals/zexy/build/win-vs2008/zexy.sln deleted file mode 100644 index f5670f07da2feadbf9bdee4ee80be1bf396375cf..0000000000000000000000000000000000000000 --- a/externals/zexy/build/win-vs2008/zexy.sln +++ /dev/null @@ -1,16 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zexy", "zexy.vcproj", "{6B55773B-3FF5-4F09-B538-2A7007DEC4DB}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6B55773B-3FF5-4F09-B538-2A7007DEC4DB}.Release|Win32.ActiveCfg = Release|Win32 - {6B55773B-3FF5-4F09-B538-2A7007DEC4DB}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/externals/zexy/build/win-vs2008/zexy.vcproj b/externals/zexy/build/win-vs2008/zexy.vcproj deleted file mode 100644 index a9de903cd7ad45ace6b4a90c2f354df92ac7b587..0000000000000000000000000000000000000000 --- a/externals/zexy/build/win-vs2008/zexy.vcproj +++ /dev/null @@ -1,226 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="9,00" - Name="zexy" - ProjectGUID="{6B55773B-3FF5-4F09-B538-2A7007DEC4DB}" - RootNamespace="zexy" - TargetFrameworkVersion="131072" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Release|Win32" - OutputDirectory="." - IntermediateDirectory=".\obj" - ConfigurationType="2" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - SuppressStartupBanner="true" - TargetEnvironment="1" - TypeLibraryName="./zexy.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="4" - AdditionalIncludeDirectories="..\..\..\pd\src;"$(ProgramFiles)\pd\src";"$(ProgramFiles)\pd-0.43.0\src"" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY" - RuntimeLibrary="0" - StructMemberAlignment="5" - UsePrecompiledHeader="0" - PrecompiledHeaderFile=".\obj/zexy.pch" - AssemblerListingLocation=".\obj/" - ObjectFile=".\obj/" - ProgramDataBaseFileName=".\obj/" - BrowseInformation="1" - WarningLevel="3" - SuppressStartupBanner="true" - CompileAs="0" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - Culture="3079" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalOptions="/export:zexy_setup" - AdditionalDependencies="pd.lib wsock32.lib" - OutputFile="..\..\zexy.dll" - LinkIncremental="1" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="..\..\..\pd\bin;"$(ProgramFiles)\pd\bin";"$(ProgramFiles)\pd-0.43.0\bin"" - ProgramDatabaseFile="./zexy.pdb" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - ImportLibrary="./zexy.lib" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="objectclasses" - Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" - > - <File RelativePath="..\..\src\0x260x260x7e.c" > </File> - <File RelativePath="..\..\src\0x2e.c" > </File> - <File RelativePath="..\..\src\0x3c0x7e.c" > </File> - <File RelativePath="..\..\src\0x3d0x3d0x7e.c" > </File> - <File RelativePath="..\..\src\0x3e0x7e.c" > </File> - <File RelativePath="..\..\src\0x7c0x7c0x7e.c" > </File> - <File RelativePath="..\..\src\a2l.c" > </File> - <File RelativePath="..\..\src\absgn~.c" > </File> - <File RelativePath="..\..\src\abs~.c" > </File> - <File RelativePath="..\..\src\atof.c" > </File> - <File RelativePath="..\..\src\atoi.c" > </File> - <File RelativePath="..\..\src\avg~.c" > </File> - <File RelativePath="..\..\src\blockmirror~.c" > </File> - <File RelativePath="..\..\src\blockshuffle~.c" > </File> - <File RelativePath="..\..\src\blockswap~.c" > </File> - <File RelativePath="..\..\src\date.c" > </File> - <File RelativePath="..\..\src\demultiplex.c" > </File> - <File RelativePath="..\..\src\demultiplex~.c" > </File> - <File RelativePath="..\..\src\dfreq~.c" > </File> - <File RelativePath="..\..\src\dirac~.c" > </File> - <File RelativePath="..\..\src\doublepole~.c"></File> - <File RelativePath="..\..\src\drip.c" > </File> - <File RelativePath="..\..\src\envrms~.c" > </File> - <File RelativePath="..\..\src\fifop.c" > </File> - <File RelativePath="..\..\src\freadln.c" > </File> - <File RelativePath="..\..\src\fwriteln.c" > </File> - <File RelativePath="..\..\src\glue.c" > </File> - <File RelativePath="..\..\src\index.c" > </File> - <File RelativePath="..\..\src\length.c" > </File> - <File RelativePath="..\..\src\lifop.c" > </File> - <File RelativePath="..\..\src\limiter~.c" > </File> - <File RelativePath="..\..\src\list2int.c" > </File> - <File RelativePath="..\..\src\list2lists.c" > </File> - <File RelativePath="..\..\src\list2symbol.c" > </File> - <File RelativePath="..\..\src\lister.c" > </File> - <File RelativePath="..\..\src\listfind.c" > </File> - <File RelativePath="..\..\src\liststorage.c" > </File> - <File RelativePath="..\..\src\longload~.c"></File> - <File RelativePath="..\..\src\lpt.c" > </File> - <File RelativePath="..\..\src\makesymbol.c" > </File> - <File RelativePath="..\..\src\matchbox.c" > </File> - <File RelativePath="..\..\src\mavg.c" > </File> - <File RelativePath="..\..\src\minmax.c" > </File> - <File RelativePath="..\..\src\msgfile.c" > </File> - <File RelativePath="..\..\src\multiline~.c" > </File> - <File RelativePath="..\..\src\multiplex.c" > </File> - <File RelativePath="..\..\src\multiplex~.c" > </File> - <File RelativePath="..\..\src\multireceive.c" > </File> - <File RelativePath="..\..\src\niagara.c" > </File> - <File RelativePath="..\..\src\noish~.c" > </File> - <File RelativePath="..\..\src\noisi~.c" > </File> - <File RelativePath="..\..\src\operating_system.c" > </File> - <File RelativePath="..\..\src\pack.c" > </File> - <File RelativePath="..\..\src\packel.c" > </File> - <File RelativePath="..\..\src\pack~.c" > </File> - <File RelativePath="..\..\src\pdf~.c" > </File> - <File RelativePath="..\..\src\prime.c" > </File> - <File RelativePath="..\..\src\quantize~.c" > </File> - <File RelativePath="..\..\src\rawprint.c" > </File> - <File RelativePath="..\..\src\regex.c" > </File> - <File RelativePath="..\..\src\relay.c" > </File> - <File RelativePath="..\..\src\repack.c" > </File> - <File RelativePath="..\..\src\repeat.c" > </File> - <File RelativePath="..\..\src\route~.c" > </File> - <File RelativePath="..\..\src\sfplay.c" > </File> - <File RelativePath="..\..\src\sfrecord.c" > </File> - <File RelativePath="..\..\src\sgn~.c" > </File> - <File RelativePath="..\..\src\sigzero~.c" > </File> - <File RelativePath="..\..\src\sleepgrain.c" > </File> - <File RelativePath="..\..\src\sort.c" > </File> - <File RelativePath="..\..\src\step~.c" > </File> - <File RelativePath="..\..\src\strcmp.c" > </File> - <File RelativePath="..\..\src\sum.c" > </File> - <File RelativePath="..\..\src\swap~.c" > </File> - <File RelativePath="..\..\src\symbol2list.c" > </File> - <File RelativePath="..\..\src\tabdump.c" > </File> - <File RelativePath="..\..\src\tabminmax.c" > </File> - <File RelativePath="..\..\src\tabread4~~.c" > </File> - <File RelativePath="..\..\src\tabset.c" > </File> - <File RelativePath="..\..\src\tavg~.c" > </File> - <File RelativePath="..\..\src\time.c" > </File> - <File RelativePath="..\..\src\unpack.c" > </File> - <File RelativePath="..\..\src\unpack~.c" > </File> - <File RelativePath="..\..\src\urn.c" > </File> - <File RelativePath="..\..\src\wrap.c" > </File> - <File RelativePath="..\..\src\z~.c" > </File> - </Filter> - <Filter - Name="zexy" - Filter="h;hpp;hxx;hm;inl" - > - <File RelativePath="..\..\src\z_zexy.c" > </File> - <File RelativePath="..\..\src\z_zexy.h" > </File> - <File RelativePath="..\..\src\zexySIMD.h" > </File> - <File RelativePath="..\..\src\zexy.c" > </File> - <File RelativePath="..\..\src\zexy.h" > </File> - </Filter> - <Filter - Name="helper" - > - <File RelativePath="..\..\src\winNT_portio.c" > </File> - </Filter> - <Filter - Name="tmp" - > - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/externals/zexy/build/win-vs6/zexy.dsp b/externals/zexy/build/win-vs6/zexy.dsp deleted file mode 100644 index 4542e271d2aa8e3def256876bad07e14f0680c4e..0000000000000000000000000000000000000000 --- a/externals/zexy/build/win-vs6/zexy.dsp +++ /dev/null @@ -1,407 +0,0 @@ -# Microsoft Developer Studio Project File - Name="zexy" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** NICHT BEARBEITEN ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=ZEXY - WIN32 RELEASE -!MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE -!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl -!MESSAGE -!MESSAGE NMAKE /f "zexy.mak". -!MESSAGE -!MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben -!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: -!MESSAGE -!MESSAGE NMAKE /f "zexy.mak" CFG="ZEXY - WIN32 RELEASE" -!MESSAGE -!MESSAGE Für die Konfiguration stehen zur Auswahl: -!MESSAGE -!MESSAGE "zexy - Win32 Release" (basierend auf "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 1 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "" -# PROP Intermediate_Dir "obj\" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEXY_EXPORTS" /YX /FD /c -# ADD CPP /nologo /Zp16 /W3 /GX /I "..\..\..\pd\src" /I "C:\Programme\pd\src" /D "__WIN32__" /D "ZEXY" /D "Z_WANT_LPT" /D "ZEXY_LIBRARY" /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /win32 -# SUBTRACT MTL /mktyplib203 -# ADD BASE RSC /l 0xc07 /d "NDEBUG" -# ADD RSC /l 0xc07 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib wsock32.lib uuid.lib libc.lib oldnames.lib pd.lib /nologo /dll /machine:I386 /nodefaultlib /out:"..\zexy.dll" /libpath:"../../bin" /libpath:"C:\Programme\pd\bin" /export:zexy_setup -# SUBTRACT LINK32 /pdb:none -# Begin Target - -# Name "zexy - Win32 Release" -# Begin Group "Quellcodedateien" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\0x260x260x7e.c -# End Source File -# Begin Source File - -SOURCE=.\0x2e.c -# End Source File -# Begin Source File - -SOURCE=.\0x3c0x7e.c -# End Source File -# Begin Source File - -SOURCE=.\0x3d0x3d0x7e.c -# End Source File -# Begin Source File - -SOURCE=.\0x3e0x7e.c -# End Source File -# Begin Source File - -SOURCE=.\0x7c0x7c0x7e.c -# End Source File -# Begin Source File - -SOURCE=.\a2l.c -# End Source File -# Begin Source File - -SOURCE=.\absgn~.c -# End Source File -# Begin Source File - -SOURCE=.\abs~.c -# End Source File -# Begin Source File - -SOURCE=.\atoi.c -# End Source File -# Begin Source File - -SOURCE=.\avg~.c -# End Source File -# Begin Source File - -SOURCE=.\blockmirror~.c -# End Source File -# Begin Source File - -SOURCE=.\blockshuffle~.c -# End Source File -# Begin Source File - -SOURCE=.\blockswap~.c -# End Source File -# Begin Source File - -SOURCE=.\date.c -# End Source File -# Begin Source File - -SOURCE=.\demultiplex.c -# End Source File -# Begin Source File - -SOURCE=.\demultiplex~.c -# End Source File -# Begin Source File - -SOURCE=.\dfreq~.c -# End Source File -# Begin Source File - -SOURCE=.\dirac~.c -# End Source File -# Begin Source File - -SOURCE=.\drip.c -# End Source File -# Begin Source File - -SOURCE=.\envrms~.c -# End Source File -# Begin Source File - -SOURCE=.\fifop.c -# End Source File -# Begin Source File - -SOURCE=.\freadln.c -# End Source File -# Begin Source File - -SOURCE=.\fwriteln.c -# End Source File -# Begin Source File - -SOURCE=.\glue.c -# End Source File -# Begin Source File - -SOURCE=.\index.c -# End Source File -# Begin Source File - -SOURCE=.\length.c -# End Source File -# Begin Source File - -SOURCE=.\lifop.c -# End Source File -# Begin Source File - -SOURCE=.\limiter~.c -# End Source File -# Begin Source File - -SOURCE=.\list2int.c -# End Source File -# Begin Source File - -SOURCE=.\list2lists.c -# End Source File -# Begin Source File - -SOURCE=.\list2symbol.c -# End Source File -# Begin Source File - -SOURCE=.\lister.c -# End Source File -# Begin Source File - -SOURCE=.\listfind.c -# End Source File -# Begin Source File - -SOURCE=.\lpt.c -# End Source File -# Begin Source File - -SOURCE=.\makesymbol.c -# End Source File -# Begin Source File - -SOURCE=.\matchbox.c -# End Source File -# Begin Source File - -SOURCE=.\mavg.c -# End Source File -# Begin Source File - -SOURCE=.\minmax.c -# End Source File -# Begin Source File - -SOURCE=.\msgfile.c -# End Source File -# Begin Source File - -SOURCE=.\multiline~.c -# End Source File -# Begin Source File - -SOURCE=.\multiplex.c -# End Source File -# Begin Source File - -SOURCE=.\multiplex~.c -# End Source File -# Begin Source File - -SOURCE=.\niagara.c -# End Source File -# Begin Source File - -SOURCE=.\noish~.c -# End Source File -# Begin Source File - -SOURCE=.\noisi~.c -# End Source File -# Begin Source File - -SOURCE=.\operating_system.c -# End Source File -# Begin Source File - -SOURCE=.\pack.c -# End Source File -# Begin Source File - -SOURCE=.\packel.c -# End Source File -# Begin Source File - -SOURCE=.\pack~.c -# End Source File -# Begin Source File - -SOURCE=.\pdf~.c -# End Source File -# Begin Source File - -SOURCE=.\prime.c -# End Source File -# Begin Source File - -SOURCE=.\quantize~.c -# End Source File -# Begin Source File - -SOURCE=.\regex.c -# End Source File -# Begin Source File - -SOURCE=.\relay.c -# End Source File -# Begin Source File - -SOURCE=.\repack.c -# End Source File -# Begin Source File - -SOURCE=.\repeat.c -# End Source File -# Begin Source File - -SOURCE=.\sfplay.c -# End Source File -# Begin Source File - -SOURCE=.\sfrecord.c -# End Source File -# Begin Source File - -SOURCE=.\sgn~.c -# End Source File -# Begin Source File - -SOURCE=.\sigzero~.c -# End Source File -# Begin Source File - -SOURCE=.\sort.c -# End Source File -# Begin Source File - -SOURCE=.\step~.c -# End Source File -# Begin Source File - -SOURCE=.\strcmp.c -# End Source File -# Begin Source File - -SOURCE=.\sum.c -# End Source File -# Begin Source File - -SOURCE=.\swap~.c -# End Source File -# Begin Source File - -SOURCE=.\symbol2list.c -# End Source File -# Begin Source File - -SOURCE=.\tabdump.c -# End Source File -# Begin Source File - -SOURCE=.\tabminmax.c -# End Source File -# Begin Source File - -SOURCE=.\tabread4~~.c -# End Source File -# Begin Source File - -SOURCE=.\tabset.c -# End Source File -# Begin Source File - -SOURCE=.\tavg~.c -# End Source File -# Begin Source File - -SOURCE=.\time.c -# End Source File -# Begin Source File - -SOURCE=.\unpack.c -# End Source File -# Begin Source File - -SOURCE=.\unpack~.c -# End Source File -# Begin Source File - -SOURCE=.\urn.c -# End Source File -# Begin Source File - -SOURCE=.\winNT_portio.c -# End Source File -# Begin Source File - -SOURCE=.\wrap.c -# End Source File -# Begin Source File - -SOURCE=.\z_zexy.c -# End Source File -# Begin Source File - -SOURCE=.\zexy.c -# End Source File -# Begin Source File - -SOURCE=.\z~.c -# End Source File -# End Group -# Begin Group "Header-Dateien" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\..\src\m_pd.h -# End Source File -# Begin Source File - -SOURCE=.\Zexy.h -# End Source File -# End Group -# Begin Group "generic" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\z_zexy.h -# End Source File -# End Group -# End Target -# End Project diff --git a/externals/zexy/build/win-vs6/zexy.dsw b/externals/zexy/build/win-vs6/zexy.dsw deleted file mode 100644 index f8e4ba7084a8b9eade47cc96a5557f8222643f80..0000000000000000000000000000000000000000 --- a/externals/zexy/build/win-vs6/zexy.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNUNG: DIESE ARBEITSBEREICHSDATEI DARF NICHT BEARBEITET ODER GELÖSCHT WERDEN! - -############################################################################### - -Project: "zexy"=.\zexy.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/externals/zexy/build/win-vs7.10/zexy.sln b/externals/zexy/build/win-vs7.10/zexy.sln deleted file mode 100644 index baea9f226679b98d4002b58289092d5d06615c80..0000000000000000000000000000000000000000 --- a/externals/zexy/build/win-vs7.10/zexy.sln +++ /dev/null @@ -1,18 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zexy", "zexy.vcproj", "{D6D6C3DC-5B5B-452F-9953-2B37FAC07F2A}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Release = Release - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {D6D6C3DC-5B5B-452F-9953-2B37FAC07F2A}.Release.ActiveCfg = Release|Win32 - {D6D6C3DC-5B5B-452F-9953-2B37FAC07F2A}.Release.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/externals/zexy/build/win-vs7.10/zexy.vcproj b/externals/zexy/build/win-vs7.10/zexy.vcproj deleted file mode 100644 index 5c878dcf7cae9913b20f8b6c2da6120eddbcf626..0000000000000000000000000000000000000000 --- a/externals/zexy/build/win-vs7.10/zexy.vcproj +++ /dev/null @@ -1,897 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="7.10" - Name="zexy" - RootNamespace="zexy" - SccProjectName="" - SccLocalPath=""> - <Platforms> - <Platform - Name="Win32"/> - </Platforms> - <Configurations> - <Configuration - Name="Release|Win32" - OutputDirectory="." - IntermediateDirectory=".\obj" - ConfigurationType="2" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="FALSE"> - <Tool - Name="VCCLCompilerTool" - Optimization="4" - AdditionalIncludeDirectories="..\..\..\pd\src,C:\Programme\pd\src" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY" - RuntimeLibrary="4" - StructMemberAlignment="5" - UsePrecompiledHeader="2" - PrecompiledHeaderFile=".\obj/zexy.pch" - AssemblerListingLocation=".\obj/" - ObjectFile=".\obj/" - ProgramDataBaseFileName=".\obj/" - BrowseInformation="1" - WarningLevel="3" - SuppressStartupBanner="TRUE" - CompileAs="0"/> - <Tool - Name="VCCustomBuildTool"/> - <Tool - Name="VCLinkerTool" - AdditionalOptions="/export:zexy_setup" - AdditionalDependencies="wsock32.lib libc.lib oldnames.lib pd.lib" - OutputFile="..\zexy.dll" - LinkIncremental="1" - SuppressStartupBanner="TRUE" - AdditionalLibraryDirectories="C:\home\zmoelnig\pd\bin;..\..\pd\bin;C:\Programme\pd\bin" - IgnoreAllDefaultLibraries="TRUE" - ProgramDatabaseFile="./zexy.pdb" - ImportLibrary="./zexy.lib" - TargetMachine="1"/> - <Tool - Name="VCMIDLTool" - SuppressStartupBanner="TRUE" - TargetEnvironment="1" - TypeLibraryName="./zexy.tlb" - HeaderFileName=""/> - <Tool - Name="VCPostBuildEventTool"/> - <Tool - Name="VCPreBuildEventTool"/> - <Tool - Name="VCPreLinkEventTool"/> - <Tool - Name="VCResourceCompilerTool" - Culture="3079"/> - <Tool - Name="VCWebServiceProxyGeneratorTool"/> - <Tool - Name="VCXMLDataGeneratorTool"/> - <Tool - Name="VCWebDeploymentTool"/> - <Tool - Name="VCManagedWrapperGeneratorTool"/> - <Tool - Name="VCAuxiliaryManagedWrapperGeneratorTool"/> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Quellcodedateien" - Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"> - <File - RelativePath="0x260x260x7e.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="0x2e.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="0x3c0x7e.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="0x3d0x3d0x7e.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="0x3e0x7e.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="0x7c0x7c0x7e.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="a2l.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="absgn~.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="abs~.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="atoi.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="avg~.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="blockmirror~.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="blockswap~.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="date.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="demultiplex.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="demultiplex~.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="dfreq~.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="dirac~.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="drip.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="envrms~.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="fifop.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="glue.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="index.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="length.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="lifop.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="limiter~.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="list2int.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="list2symbol.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="lister.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="lpt.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="makesymbol.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="mavg.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="minmax.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="msgfile.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="multiline~.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="multiplex.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="multiplex~.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="niagara.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="noish~.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="noisi~.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="operating_system.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="packel.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="pack~.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="pdf~.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="prime.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="quantize~.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="regex.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="relay.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="repack.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="repeat.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="sfplay.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="sfrecord.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="sgn~.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="sigzero~.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="sort.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="step~.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="strcmp.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="sum.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="swap~.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="symbol2list.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="tabdump.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="tabminmax.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="tabset.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="tavg~.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="time.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="unpack~.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="urn.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="winNT_portio.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="wrap.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="z_zexy.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="zexy.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - <File - RelativePath="z~.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="__WIN32__;ZEXY;Z_WANT_LPT;ZEXY_LIBRARY;$(NoInherit)" - BrowseInformation="1"/> - </FileConfiguration> - </File> - </Filter> - <Filter - Name="Header-Dateien" - Filter="h;hpp;hxx;hm;inl"> - <File - RelativePath="Zexy.h"> - </File> - <File - RelativePath=".\zexyconf.h"> - </File> - </Filter> - <Filter - Name="generic" - Filter=""> - <File - RelativePath="z_zexy.h"> - </File> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/externals/zexy/configure.ac b/externals/zexy/configure.ac deleted file mode 100644 index fef1c90a7ea2201b7ad9d0c99d55b58b9a2221c7..0000000000000000000000000000000000000000 --- a/externals/zexy/configure.ac +++ /dev/null @@ -1,183 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. -AC_PREREQ([2.60]) - -AC_INIT([zexy], [2.2.6], [zmoelnig@iem.at], [zexy], [https://git.iem.at/pd/zexy]) -AM_INIT_AUTOMAKE([1.10 foreign]) -m4_ifdef([LT_INIT], - [LT_INIT([disable-static win32-dll])], - [AC_ENABLE_SHARED - AC_DISABLE_STATIC - AC_LIBTOOL_WIN32_DLL]) - -AC_CONFIG_MACRO_DIR([m4]) - -AC_CONFIG_HEADERS([config.h]) -AC_CONFIG_FILES([Makefile src/Makefile abs/Makefile reference/Makefile]) -AC_CONFIG_FILES([tests/Makefile build/Makefile]) -AC_CONFIG_FILES([zexy-meta.pd]) - -AC_CONFIG_SRCDIR([src/zexy.c]) - -IEM_OPERATING_SYSTEM -ARCH=$(uname -m) -KERN=$(uname -s) - -dnl m4_ifdef([AC_LIB_RPATH], [AC_LIB_RPATH]) - -dnl Checks for programs. -AC_PROG_CC -AC_PROG_LN_S -AC_LIBTOOL_WIN32_DLL -AC_PROG_LIBTOOL - -AC_ARG_WITH([pd], [ --with-pd=</path/to/pd> where to look for pd-headers and and -libs]) -AC_ARG_WITH([extension],[ --with-extension=<ext> enforce a certain extension for the dynamic library (e.g. dll)]) -AC_ARG_ENABLE([library],[ --enable-library build zexy as multi-object library (default, "yes"), as single-object externals ("no") or as both ("both")]) -AM_CONDITIONAL([LIBRARY], [test "x${enable_library}" != "xno"]) -AM_CONDITIONAL([SINGLEOBJECTS], [test "x${enable_library}" = "xno" || test "x${enable_library}" = "xboth"]) - -## override build-date -AC_ARG_WITH([build-date], AC_HELP_STRING([--with-build-date=<str>], [alternative date string])) -AC_MSG_CHECKING([build-date]) -AS_IF([test "x$with_build_date" = "xyes" ],[with_build_date=""]) -AS_IF([test "x$with_build_date" = "xno" ],[with_build_date=""]) -AS_IF([test "x$with_build_date" != "x" ],[ AC_DEFINE_UNQUOTED([BUILD_DATE], -["$with_build_date"], [user-defined build-date string])]) -## urgh, brackets need to be escaped with @<:@ and @:>@... -AS_IF([test "x$with_build_date" != "x" ],[ with_build_date="@<:@default@:>@" ]) -AC_MSG_RESULT([$with_build_date]) - - -if test "x${libdir}" = "x\${exec_prefix}/lib"; then - libdir='${exec_prefix}/lib/pd/extra' -fi - - -if test "x$with_pd" != "x"; then - if test -d "${with_pd}"; then - PDPATH=${with_pd} - fi - if test -d "${PDPATH}/src"; then - AC_MSG_RESULT([adding ${PDPATH}/src to INCLUDES]) - CPPFLAGS="-I${PDPATH}/src ${CPPFLAGS}" - - AC_MSG_RESULT([adding ${PDPATH}/src to LDFLAGS]) - LDFLAGS="-L${PDPATH}/src ${LDFLAGS}" - else - if test -d "${PDPATH}"; then - AC_MSG_RESULT([adding ${PDPATH} to INCLUDES]) - CPPFLAGS="-I${PDPATH} ${CPPFLAGS}" - fi - fi - if test -d "${PDPATH}/bin"; then - AC_MSG_RESULT([adding ${PDPATH}/bin to LDFLAGS]) - LDFLAGS="-L${PDPATH}/bin ${LDFLAGS}" - else - if test -d "${PDPATH}"; then - AC_MSG_RESULT([adding ${PDPATH} to LDFLAGS]) - LDFLAGS="-L${PDPATH} ${LDFLAGS}" - fi - fi -fi - -dnl Checks for libraries. -dnl Replace `main' with a function in -lc: -AC_CHECK_LIB([c], [main]) -AC_CHECK_LIB([crtdll], [fclose]) - -AC_CHECK_LIB([coldname], [lseek]) -AC_CHECK_LIB([kernel32], [main]) -AC_CHECK_LIB([user32], [main]) -AC_CHECK_LIB([gdi32], [main]) - -dnl Replace `main' with a function in -lm: -AC_CHECK_LIB([m], [main]) -dnl Replace `main' with a function in -lpthread: -dnl AC_CHECK_LIB([pthread], [main]) -dnl Replace `main' with a function in -lstk: -dnl AC_CHECK_LIB([stk], [main], [STK=yes]) - -tmp_pddll_LIBS=$LIBS -AC_CHECK_LIB([:pd.dll], [nullfn], have_pddll="yes", have_pddll="no") -LIBS=$tmp_pddll_LIBS - -if test "x$have_pddll" = "xyes" -then - EXTRA_LTFLAGS="$EXTRA_LTFLAGS -Xlinker -l:pd.dll" -else - AC_CHECK_LIB([pd], [nullfn]) -fi - -AC_CHECK_LIB([regex], [regcomp]) - -dnl Checks for header files. -AC_HEADER_STDC -AC_CHECK_HEADERS([stdlib.h stdio.h string.h math.h time.h sys/time.h regex.h alloca.h]) - -dnl Checks for typedefs, structures, and compiler characteristics. -AC_HEADER_TIME - -dnl Checks for library functions. -AC_FUNC_MMAP -AC_CHECK_FUNCS([select socket strerror]) - -IEM_CHECK_FAT(ARCH_FLAG) - -IEM_CHECK_CFLAGS([-mms-bitfields]) -IEM_CHECK_SIMD -IEM_CHECK_LPT - -AC_MSG_CHECKING([extension]) -if test "x$with_extension" != "x" -then - EXTENSION=$with_extension -else - case "$KERN" in - Darwin) - EXTENSION=pd_darwin - ;; - Linux) - EXTENSION=pd_linux - ;; - IRIX64) - EXTENSION=pd_irix6 - ;; - IRIX32) - EXTENSION=pd_irix5 - ;; - IRIX64) - EXTENSION=pd_irix6 - ;; - *CYGWIN*) - EXTENSION=dll - ;; - *MINGW*) - EXTENSION=dll - ;; - *) - EXTENSION=pd_linux - ;; - esac -fi -AC_MSG_RESULT([$EXTENSION]) - - -have_pd="no" -AC_CHECK_HEADERS([pd/m_pd.h m_pd.h], [have_pd="yes"]) -if test "x${have_pd}" = "xno" -then -AC_ERROR([m_pd.h is desperately needed! - install pd and/or use - "--with-pd=</path/to/pd/>"]) -fi - -AC_SUBST(CFLAGS) -AC_SUBST(CPPFLAGS) -AC_SUBST(DEFS) -AC_SUBST(ARCH_FLAG) -AC_SUBST([LIBTOOL_DEPS]) -AC_SUBST([EXTRA_LTFLAGS]) - -AC_SUBST(EXTENSION) - -AC_OUTPUT() diff --git a/externals/zexy/examples/README.txt b/externals/zexy/examples/README.txt deleted file mode 100644 index b0f66091688e288fb8e0e4bed4f9fe12ce653a64..0000000000000000000000000000000000000000 --- a/externals/zexy/examples/README.txt +++ /dev/null @@ -1,5 +0,0 @@ -here you (will) find example patches on how to make use of zexy objects. -the reference-patches (aka help-patches) have been moved to ../reference - -mfg.asdr -IOhannes - zmoelnig at iem dot at diff --git a/externals/zexy/m4/iem_checkflags.m4 b/externals/zexy/m4/iem_checkflags.m4 deleted file mode 100644 index b58b7993da7a9091bfc23e5f166cc247f1e46122..0000000000000000000000000000000000000000 --- a/externals/zexy/m4/iem_checkflags.m4 +++ /dev/null @@ -1,111 +0,0 @@ -dnl Copyright (C) 2005-2011 IOhannes m zmölnig -dnl This file is free software; IOhannes m zmölnig -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -# IEM_CHECK_CPPFLAGS(ADDITIONAL-CPPFLAGS, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) -# -# checks whether the $(C) compiler accepts the ADDITIONAL-CPPFLAGS -# if so, they are added to the CPPFLAGS -AC_DEFUN([IEM_CHECK_CPPFLAGS], -[ - AC_MSG_CHECKING([whether $CPP accepts "$1"]) - temp_check_cppflags="${CPPFLAGS}" - CPPFLAGS="$1 ${CPPFLAGS}" - AC_PREPROC_IFELSE( - [AC_LANG_SOURCE([[int main(void){return 0;}]])], - [AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no]); CPPFLAGS="${temp_check_cppflags}"]) -])# IEM_CHECK_CPPFLAGS - - - -# IEM_CHECK_CFLAGS(ADDITIONAL-CFLAGS, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) -# -# checks whether the $(C) compiler accepts the ADDITIONAL-CFLAGS -# if so, they are added to the CFLAGS -AC_DEFUN([IEM_CHECK_CFLAGS], -[ - AC_MSG_CHECKING([whether $CC accepts "$1"]) -cat > conftest.c << EOF -int main(){ - return 0; -} -EOF -if $CC $CFLAGS [$1] -o conftest.o conftest.c > /dev/null 2>&1 -then - AC_MSG_RESULT([yes]) - CFLAGS="${CFLAGS} [$1]" - [$2] -else - AC_MSG_RESULT([no]) - [$3] -fi -])# IEM_CHECK_CFLAGS - -# IEM_CHECK_CXXFLAGS(ADDITIONAL-CXXFLAGS, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) -# -# checks whether the $(CXX) (c++) compiler accepts the ADDITIONAL-CXXFLAGS -# if so, they are added to the CXXFLAGS -AC_DEFUN([IEM_CHECK_CXXFLAGS], -[ - AC_MSG_CHECKING([whether $CXX accepts "$1"]) -cat > conftest.c++ << EOF -int main(){ - return 0; -} -EOF -if $CXX $CPPFLAGS $CXXFLAGS -o conftest.o conftest.c++ [$1] > /dev/null 2>&1 -then - AC_MSG_RESULT([yes]) - CXXFLAGS="${CXXFLAGS} [$1]" - [$2] -else - AC_MSG_RESULT([no]) - [$3] -fi -])# IEM_CHECK_CXXFLAGS - -# IEM_CHECK_FRAMEWORK(FRAMEWORK, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) -# -# -AC_DEFUN([IEM_CHECK_FRAMEWORK], -[ - AC_MSG_CHECKING([for "$1"-framework]) - - temp_check_ldflags_org="${LDFLAGS}" - LDFLAGS="-framework [$1] ${LDFLAGS}" - - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [temp_check_ldflags_success="yes"],[temp_check_ldflags_success="no"]) - - if test "x$temp_check_ldflags_success" = "xyes"; then - AC_MSG_RESULT([yes]) - [$2] - else - AC_MSG_RESULT([no]) - LDFLAGS="$temp_check_ldflags_org" - [$3] - fi -])# IEM_CHECK_FRAMEWORK - -# IEM_CHECK_LDFLAGS(ADDITIONAL-LDFLAGS, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) -# -# checks whether the $(LD) linker accepts the ADDITIONAL-LDFLAGS -# if so, they are added to the LDFLAGS -AC_DEFUN([IEM_CHECK_LDFLAGS], -[ - AC_MSG_CHECKING([whether linker accepts "$1"]) - temp_check_ldflags_org="${LDFLAGS}" - LDFLAGS="$1 ${LDFLAGS}" - - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [temp_check_ldflags_success="yes"],[temp_check_ldflags_success="no"]) - - if test "x$temp_check_ldflags_success" = "xyes"; then - AC_MSG_RESULT([yes]) - [$2] - else - AC_MSG_RESULT([no]) - LDFLAGS="$temp_check_ldflags_org" - [$3] - fi -])# IEM_CHECK_LDFLAGS diff --git a/externals/zexy/m4/iem_fat.m4 b/externals/zexy/m4/iem_fat.m4 deleted file mode 100644 index 1ffeb5fe6d9fc36cfcc3ca2790f4fc6e33dcff05..0000000000000000000000000000000000000000 --- a/externals/zexy/m4/iem_fat.m4 +++ /dev/null @@ -1,51 +0,0 @@ -dnl Copyright (C) 2005-2006 IOhannes m zmölnig -dnl This file is free software; IOhannes m zmölnig -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -AC_DEFUN([IEM_CHECK_FAT], -[ -AC_ARG_ENABLE(fat-binary, - [ --enable-fat-binary=ARCHS - build an Apple Multi Architecture Binary (MAB); - ARCHS is a comma-delimited list of architectures for - which to build; if ARCHS is omitted, then the package - will be built for all architectures supported by the - platform (e.g. "ppc,i386" for MacOS/X and Darwin; - if this option is disabled or omitted entirely, then - the package will be built only for the target - platform], - [fat_binary=$enableval], [fat_binary=no]) -if test "$fat_binary" != no; then - AC_MSG_CHECKING([target architectures]) - - # Respect TARGET_ARCHS setting from environment if available. - if test -z "$TARGET_ARCHS"; then - # Respect ARCH given to --enable-fat-binary if present. - if test "$fat_binary" != yes; then - TARGET_ARCHS=`echo "$fat_binary" | tr ',' ' '` - else - # Choose a default set of architectures based upon platform. - TARGET_ARCHS="ppc i386" - fi - fi - AC_MSG_RESULT([$TARGET_ARCHS]) - - define([Name],[translit([$1],[./-], [___])]) - # /usr/lib/arch_tool -archify_list $TARGET_ARCHS - []Name="" - for archs in $TARGET_ARCHS - do - []Name="$[]Name -arch $archs" - done - - if test "x$[]Name" != "x"; then - IEM_CHECK_CFLAGS($[]Name,,[]Name="") - IEM_CHECK_CXXFLAGS($[]Name,,[]Name="") - IEM_CHECK_LDFLAGS($[]Name,,[]Name="") - fi - - - undefine([Name]) -fi -])# IEM_CHECK_FAT diff --git a/externals/zexy/m4/iem_operatingsystem.m4 b/externals/zexy/m4/iem_operatingsystem.m4 deleted file mode 100644 index 87726e110c499cab343361e89c504ab8f0561bc7..0000000000000000000000000000000000000000 --- a/externals/zexy/m4/iem_operatingsystem.m4 +++ /dev/null @@ -1,55 +0,0 @@ -dnl try to figure out the target operating system and set some AM-macros accordingly -dnl -dnl Copyright (C) 2011 IOhannes m zmölnig - - -AC_DEFUN([IEM_OPERATING_SYSTEM], -[ -AC_CANONICAL_HOST - -LINUX=no -ANDROID=no -MACOSX=no -IPHONEOS=no -BSD=no -WINDOWS=no -MINGW=no -CYGWIN=no -HURD=no -IRIX=no - -case $host_os in -*linux*) - LINUX=yes - ;; -*darwin*) - MACOSX=yes - ;; -GNU/kFreeBSD) - BSD=yes - ;; -*mingw*) - WINDOWS=yes - MINGW=yes - ;; -*cygwin*) - WINDOWS=yes - CYGWIN=yes - ;; -GNU) - HURD=yes - ;; -esac - - -AM_CONDITIONAL(LINUX, test x$LINUX = xyes) -AM_CONDITIONAL(ANDROID, test x$ANDROID = xyes) -AM_CONDITIONAL(MACOSX, test x$MACOSX = xyes) -AM_CONDITIONAL(IPHONEOS, test x$IPHONEOS = xyes) -AM_CONDITIONAL(BSD, test x$BSD = xyes) -AM_CONDITIONAL(WINDOWS, test x$WINDOWS = xyes) -AM_CONDITIONAL(CYGWIN, test x$MINGW = xyes) -AM_CONDITIONAL(MINGW, test x$MINGW = xyes) -AM_CONDITIONAL(HURD, test x$HURD = xyes) -AM_CONDITIONAL(IRIX, test x$IRIX = xyes) -]) dnl IEM_OPERATING_SYSTEM diff --git a/externals/zexy/m4/iem_parallelport.m4 b/externals/zexy/m4/iem_parallelport.m4 deleted file mode 100644 index f49707bf7e9390cf83526d8d30477ece80f1482c..0000000000000000000000000000000000000000 --- a/externals/zexy/m4/iem_parallelport.m4 +++ /dev/null @@ -1,39 +0,0 @@ -dnl Copyright (C) 2005-2006 IOhannes m zmölnig -dnl This file is free software; IOhannes m zmölnig -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -AC_DEFUN([IEM_CHECK_LPT], -[ -dnl check for LPT -AC_ARG_ENABLE(lpt, [ --enable-lpt enable parallelport-support]) - -if test "x" = "x${enable_lpt}" ; then - enable_lpt="${with_lpt}" -fi - -AC_CHECK_HEADERS(linux/ppdev.h, [ have_ppdev=" (with device-support)" ], [ have_ppdev="" ]) - -if test x"$enable_lpt" != "xno" -then - AC_MSG_CHECKING([parallel-port]) - if test "x$enable_lpt" = "xyes" - then -# forced - AC_DEFINE([Z_WANT_LPT], [1], [Define if you want parallelport support]) - have_lpt="yes (forced)" - else - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/io.h>]], [[ ioperm(0x3bc, 8, 1); outb(0, 0x3bc); ioperm(0x3bc, 8, 0); ]])], - [have_lpt="yes"], [have_lpt="no"]) - fi -fi - -if test "x$have_lpt" != "xno"; then - AC_DEFINE([Z_WANT_LPT], [1], [Define if you want line printer support]) - AC_MSG_RESULT([$have_lpt$have_ppdev]) -else - AC_MSG_RESULT([no]) -fi -AM_CONDITIONAL([LPT], [test "x${have_lpt}" != "xno"]) - -]) dnl IEM_CHECK_LPT diff --git a/externals/zexy/m4/iem_simd.m4 b/externals/zexy/m4/iem_simd.m4 deleted file mode 100644 index 6b8931b1e646daa9d59c9661741ab99bc6ae2079..0000000000000000000000000000000000000000 --- a/externals/zexy/m4/iem_simd.m4 +++ /dev/null @@ -1,39 +0,0 @@ -dnl Copyright (C) 2005-2006 IOhannes m zmölnig -dnl This file is free software; IOhannes m zmölnig -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -AC_DEFUN([IEM_CHECK_SIMD], -[ -AC_ARG_ENABLE(simd, - [ --enable-simd=ARCHS - enable SIMD optimization; - valid arguments are: SSE2 - ], - [simd=$enableval], [simd=no]) -if test "$simd" != no; then - AC_MSG_CHECKING([SIMD optimization]) - - # Respect SIMD given to --enable-simd if present. - if test "$simd" != yes; then - SIMD=`echo "$simd" | tr ',' ' '` - else - # Choose a default set of architectures based upon platform. - SIMD="SSE2" - fi - - for smd in $SIMD - do - case "${smd}" in - SSE2|sse2) - AC_MSG_RESULT([SSE2]) - IEM_CHECK_CFLAGS([-mfpmath=sse -msse]) - IEM_CHECK_CXXFLAGS([-mfpmath=sse -msse]) - ;; - *) - AC_MSG_RESULT([unknown SIMD instructions: ${smd}]) - ;; - esac - done -fi -])# IEM_CHECK_SIMD diff --git a/externals/zexy/pd-lib-builder/CHANGELOG.txt b/externals/zexy/pd-lib-builder/CHANGELOG.txt new file mode 100644 index 0000000000000000000000000000000000000000..5bdfce6c9f2e4276498509d566131a780a8c4f09 --- /dev/null +++ b/externals/zexy/pd-lib-builder/CHANGELOG.txt @@ -0,0 +1,104 @@ +Changelog for Makefile.pdlibbuilder. + +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) diff --git a/externals/zexy/pd-lib-builder/Makefile.pdlibbuilder b/externals/zexy/pd-lib-builder/Makefile.pdlibbuilder new file mode 100644 index 0000000000000000000000000000000000000000..7d6c11cdb2703f76838f7e5fe96c92d8d07d3222 --- /dev/null +++ b/externals/zexy/pd-lib-builder/Makefile.pdlibbuilder @@ -0,0 +1,1336 @@ +# Makefile.pdlibbuilder dated 2019-12-21 +version = 0.6.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 +# - <classname>.class.sources +# - <classname>.class.ldflags +# - <classname>.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 +# +# 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. +# +# <classname>.class.sources: +# Source file(s) (C or C++) specific to class <classname>. 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. +# +# <classname>.class.ldflags and <classname>.class.ldlibs: +# Define ldflags resp. ldlibs specific to class <classname>. 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. +# +# 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 +# <classname>: force clean build of an individual class +# <sourcefile>.pre: make preprocessor output file in current working directory +# <sourcefile>.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 <lib.name>-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 <target>' to print debug details of the make process. +# Use 'make -p <target>' 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 + + +################################################################################ +### 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 ########################################################### +################################################################################ + + +#=== sources =================================================================== + + +# (re)define <classname>.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 <classname>.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 .o, $(basename $(classes.sources))) +common.objects := $(addsuffix .o, $(basename $(common.sources))) +shared.objects := $(addsuffix .o, $(basename $(shared.sources))) +lib.setup.objects := $(addsuffix .o, $(basename $(lib.setup.sources))) +all.objects = $(classes.objects) $(common.objects) $(shared.objects) \ + $(lib.setup.objects) + + +#=== executables =============================================================== + + +# use recursive variables here because executable extension is not yet known + +# construct class executable names from class names +classes.executables = $(addsuffix .$(extension), $(classes)) + +# construct shared lib executable name if shared sources are defined +ifdef shared.sources + shared.lib = lib$(lib.name).$(shared.extension) +else + shared.lib = +endif + + +################################################################################ +### 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 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), 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.dll" + c.ldlibs := + cxx.flags := -fcheck-new + cxx.ldflags := -static-libgcc -static-libstdc++ -shared \ + -Wl,--enable-auto-import "$(PDBINDIR)/pd.dll" + cxx.ldlibs := + shared.extension = dll + shared.ldflags := -static-libgcc -shared "$(PDBINDIR)/pd.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)" $(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 := $(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: 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.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 .o, $(basename $($2.class.sources))) \ + $(addsuffix .o, $(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 lib$(lib.name).$(shared.extension) $(shared.objects) \ + $($1.ldlibs) $(shared.ldlibs) +endef + +# rule for linking objects in shared executable +# build recipe is in macro 'link-shared' +lib$(lib.name).$(shared.extension): $(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. + +%.o:: %.c + $(call make-object-file,c) + +%.o:: %.cc + $(call make-object-file,cxx) + +%.o:: %.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 .o, $(basename $($v.class.sources))) \ + $(addsuffix .o, $(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)$(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: + diff --git a/externals/zexy/pd-lib-builder/README.md b/externals/zexy/pd-lib-builder/README.md new file mode 100644 index 0000000000000000000000000000000000000000..187b132d7bdc8b7caef1999490ae4ec4304b9983 --- /dev/null +++ b/externals/zexy/pd-lib-builder/README.md @@ -0,0 +1,162 @@ + + +### 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 + + include 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. + + +### 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 + + diff --git a/externals/zexy/pd-lib-builder/tips-tricks.md b/externals/zexy/pd-lib-builder/tips-tricks.md new file mode 100644 index 0000000000000000000000000000000000000000..c1795f45ed87f23a0909ed65cca1592278cf32d0 --- /dev/null +++ b/externals/zexy/pd-lib-builder/tips-tricks.md @@ -0,0 +1,230 @@ +pd-lib-builder cheatsheet +========================= + +# Creating special builds + +## cross-compiling on linux x86_64 for other platforms + +Using pd-lib-builder >=0.6.0 we can define variable `PLATFORM` to specify a +target triplet for cross-compilation. Example to build W32 binaries (assuming +package `mingw-w64` is installed and a W32 package for Pd is unzipped into a +path `${PDWIN32}`: + + make PLATFORM=x86_64-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 + +Cross toolchains for relevant platforms in Debian Buster (install g++ +with dependencies for a given platform to get the whole tool chain): + +- `arm-linux-gnueabihf` +- `aarch64-linux-gnu` +- `i686-linux-gnu` +- `i686-w64-mingw32` and `x86_64-w64-mingw32` (install `mingw-w64`) + +OSX/MacOS cross tool chains are not distributed by Debian. Use project +`osxcross` from Thomas Poechtraeger to create the tools. + +## building double-precision externals + +At the time of writing (2018-02) 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: + + make CPPFLAGS="-DPD_FLOATSIZE=64" + +## building externals for W64 (64-bit Windows) + +At the time of writing (2018-02) there is no official Pd that supports +W64 yet. +However, if you do get hold of an experimental W64 Pd, you can +easily build your externals for this environment with + + make CPPFLAGS="-DPD_LONGINTTYPE=__int64" CC=x86_64-w64-mingw32-gcc + + +To build a double-precision external for W64, use something like: + + make CPPFLAGS="-DPD_LONGINTTYPE=__int64 -DPD_FLOATSIZE=64" CC=x86_64-w64-mingw32-gcc + + +## TODO universal binaries on OSX + + +# 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 <file>..." to update what will be committed) + (use "git checkout -- <file>..." 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). + diff --git a/externals/zexy/pd-zexy.info b/externals/zexy/pd-zexy.info deleted file mode 100644 index f7b897ebc80e5371f6e88a6a1ea58d6e375fad15..0000000000000000000000000000000000000000 --- a/externals/zexy/pd-zexy.info +++ /dev/null @@ -1,16 +0,0 @@ -Title Zexy for Pd -Version MSP standard paths -Description IOhannes m zmoelnig's zexy -DefaultLocation /usr/local/lib -DeleteWarning - -### Package Flags - -NeedsAuthorization YES -Required NO -Relocatable YES -RequiresReboot NO -UseUserMask YES -OverwritePermissions NO -InstallFat NO -RootVolumeOnly NO diff --git a/externals/zexy/reference/Makefile.am b/externals/zexy/reference/Makefile.am deleted file mode 100644 index b74db0c39bbc88ab74de1033b4b3f2a77814a054..0000000000000000000000000000000000000000 --- a/externals/zexy/reference/Makefile.am +++ /dev/null @@ -1,124 +0,0 @@ -AUTOMAKE_OPTIONS = foreign - -SUFFIXES = .pd - -zexydir=$(pkglibdir) - -empty= - -dist_zexy_DATA= \ - a2l-help.pd \ - atoi-help.pd \ - avg~-help.pd \ - blockmirror~-help.pd \ - blockswap~-help.pd \ - coordinates-help.pd \ - date-help.pd \ - demultiplex~-help.pd \ - demultiplex-help.pd \ - dfreq~-help.pd \ - digidistort-help.pd \ - dirac~-help.pd \ - drip-help.pd \ - envrms~-help.pd \ - fifop-help.pd \ - freadln-help.pd \ - fwriteln-help.pd \ - glue-help.pd \ - index-help.pd \ - length-help.pd \ - lifop-help.pd \ - limiter~-help.pd \ - list2int-help.pd \ - list2lists-help.pd \ - list2symbol-help.pd \ - lister-help.pd \ - listfind-help.pd \ - lpt-help.pd \ - makesymbol-help.pd \ - matchbox-help.pd \ - mavg-help.pd \ - minmax-help.pd \ - msgfile-help.pd \ - multiline~-help.pd \ - multiplex~-help.pd \ - multiplex-help.pd \ - niagara-help.pd \ - noish~-help.pd \ - noisi~-help.pd \ - operating_system-help.pd \ - packel-help.pd \ - pack~-help.pd \ - pack-help.pd \ - pdf~-help.pd \ - prime-help.pd \ - quantize~-help.pd \ - rawprint-help.pd \ - regex-help-help.pd \ - regex-help.pd \ - relay-help.pd \ - repack-help.pd \ - repeat-help.pd \ - route~-help.pd \ - scalarmult-help.pd \ - sf-play_record-help.pd \ - sigzero~-help.pd \ - sort-help.pd \ - step~-help.pd \ - strcmp-help.pd \ - sum-help.pd \ - swap~-help.pd \ - symbol2list-help.pd \ - tabdump-help.pd \ - tabminmax-help.pd \ - tabset-help.pd \ - tavg~-help.pd \ - time-help.pd \ - unpack~-help.pd \ - unpack-help.pd \ - urn-help.pd \ - wrap-help.pd \ - z~-help.pd \ - zigbinops-help.pd \ - $(empty) - -############# -# symlinks for aliases -zexyaliasdir=$(pkglibdir) - -clean-local: clean_zexyalias -.PHONY: clean_zexyalias - -dist_zexyalias_DATA= \ - unfold-help.pd \ - mux-help.pd \ - demux~-help.pd \ - l2i-help.pd \ - l2s-help.pd \ - any2list-help.pd \ - lp-help.pd \ - demux-help.pd \ - l-help.pd \ - mux~-help.pd \ - s2l-help.pd - -# create aliases -$(dist_zexyalias_DATA): - test -e $< && $(LN_S) $< $@ - -# delete aliases -clean_zexyalias: - -rm -f $(dist_zexyalias_DATA) - -# define aliases -any2list-help.pd: a2l-help.pd -demux~-help.pd: demultiplex~-help.pd -demux-help.pd: demultiplex-help.pd -l2i-help.pd: list2int-help.pd -l2s-help.pd: list2symbol-help.pd -l-help.pd: lister-help.pd -lp-help.pd: lpt-help.pd -mux~-help.pd: multiplex~-help.pd -mux-help.pd: multiplex-help.pd -s2l-help.pd: symbol2list-help.pd -unfold-help.pd: drip-help.pd diff --git a/externals/zexy/reference/drip-help.pd b/externals/zexy/reference/drip-help.pd index 74f199a14008eae90833a129f8695f2b1a7bfba9..eb1d1520e83e176e319482ad00d11c2258e68eb0 100644 --- a/externals/zexy/reference/drip-help.pd +++ b/externals/zexy/reference/drip-help.pd @@ -48,7 +48,7 @@ be flushed when a new package arrives or not.; #X obj 35 335 drip 200 flush; #X obj 171 335 drip 200; #X text 717 13 part of; -#X obj 776 13 zexy; +#X text 776 13 zexy; #N canvas 460 154 494 344 META 0; #X text 12 145 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; diff --git a/externals/zexy/reference/fifop-help.pd b/externals/zexy/reference/fifop-help.pd index 94c5a3e42991048e170209cd06db936e838c919b..eaf638d219b4cd300a6a86875c15d81380c80a87 100644 --- a/externals/zexy/reference/fifop-help.pd +++ b/externals/zexy/reference/fifop-help.pd @@ -27,7 +27,7 @@ eat your memory.; #X msg 201 159 info; #X text 247 158 query the number of arguments in the LIFO; #X obj 156 209 print info; -#X obj 533 30 zexy; +#X text 533 30 zexy; #N canvas 593 163 494 344 META 0; #X text 12 165 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan Wilkes for Pd version 0.42.; diff --git a/externals/zexy/reference/lifop-help.pd b/externals/zexy/reference/lifop-help.pd index 3c2f992482c37dd05f445e831f1ff619b862649d..4a436f6458c1afa9946627dcfac1092f2fd3ad37 100644 --- a/externals/zexy/reference/lifop-help.pd +++ b/externals/zexy/reference/lifop-help.pd @@ -1,6 +1,6 @@ #N canvas 0 31 568 508 10; #X text 471 31 part of; -#X obj 533 30 zexy; +#X text 533 30 zexy; #X obj 58 192 lifop; #X msg 58 85 1 2 3 4 5; #X msg 69 110 list a list; diff --git a/externals/zexy/reference/limiter~-help.pd b/externals/zexy/reference/limiter~-help.pd index 246a36bb0193dc52d4da703a6547ee78bad69d0d..b7f4bb83dc1de5ada3ba90cde14c5d077956f539 100644 --- a/externals/zexy/reference/limiter~-help.pd +++ b/externals/zexy/reference/limiter~-help.pd @@ -26,7 +26,7 @@ #X obj 382 341 env~; #X floatatom 382 359 4 0 0 0 - - -; #X text 30 299 to learn more about this object \, try these; -#X text 48 371 http://iem.kug.ac.at/~zmoelnig; +#X text 48 371 http://users.iem.at/zmoelnig; #N canvas 59 76 600 400 generator~ 0; #X obj 86 49 inlet; #X obj 252 54 inlet; diff --git a/externals/zexy/reference/msgfile-help.pd b/externals/zexy/reference/msgfile-help.pd index cdfe5d0395abeca38b6b55e343e2bc1315afa9ea..faf1d56857ce8d39aa6e0144cbb5c298f3f1a906 100644 --- a/externals/zexy/reference/msgfile-help.pd +++ b/externals/zexy/reference/msgfile-help.pd @@ -1,4 +1,4 @@ -#N canvas 0 31 854 331 10; +#N canvas 80 115 854 331 10; #X obj 425 235 print done; #X text 72 260 see also:; #X msg 423 39 bang; @@ -10,7 +10,7 @@ #X text 18 57 The msgfile object is derived from the textfile object and expands its features.; #X text 15 97 new features are :; -#X text 127 110 insert \, append \, delete \, replace; +#X text 126 111 insert \, append \, delete \, replace; #X text 472 36 output one line as a list and move to the next; #X text 90 201 add2 : read "add too" \; append to an existing line ; @@ -18,8 +18,8 @@ and expands its features.; sequence \; it will also get the current position when using "when" ; #X text 127 97 end \, goto \, skip; -#X text 131 127 flush \, where \, this \, prev \, next; -#X text 128 145 find; +#X text 126 127 flush \, where \, this \, prev \, next; +#X text 126 143 find; #X text 73 163 read/write can handle csv files too; #X text 598 7 part of zexy; #N canvas 112 31 646 300 navigation 0; @@ -130,32 +130,68 @@ and the list is output (via the 2nd and 1st outlet).; #X connect 2 0 0 0; #X connect 6 0 0 0; #X restore 423 124 pd searching; -#N canvas 0 0 853 402 file-i/o 0; -#X obj 54 312 outlet; +#N canvas 5 51 853 726 file-i/o 1; +#X obj 57 532 outlet; #X text 265 75 read a file; -#X text 299 96 write one; -#X text 305 164 write a file \, terminating lines only with carriage -return (omitting semicolons.) You can read files this way too \, in -which case carriage returns are mapped to semicolons.; -#X msg 87 76 read msgfile.txt; -#X msg 87 168 write /tmp/msgfile2.txt cr; -#X msg 87 191 read msgfile2.txt cr; -#X msg 87 97 write /tmp/msgfile.txt; +#X msg 97 76 read msgfile.txt; +#X msg 127 248 write /tmp/msgfile2.txt cr; +#X msg 127 268 read msgfile2.txt cr; +#X msg 97 97 write /tmp/msgfile.txt; #X text 51 26 reading from and writing the contents of [msgfile] to files; -#X msg 111 248 write /tmp/msgfile3.txt $$; -#X text 331 238 on writing replace every occurence of $$ with a single -$. This way you can write pd-patches which can handle arguments.; -#X msg 146 291 add #X obj f $\$1; -#X msg 92 130 read2 msgfile.txt; +#X msg 102 130 read2 msgfile.txt; #X text 264 131 read file and append it to the current buffer; -#X connect 4 0 0 0; -#X connect 5 0 0 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X connect 9 0 0 0; -#X connect 11 0 0 0; -#X connect 12 0 0 0; +#X msg 127 308 write /tmp/msgfile2.csv csv; +#X msg 127 328 read msgfile2.csv csv; +#X msg 127 468 read /tmp/msgfile2.txt txt; +#X msg 127 418 read /tmp/msgfile.txt fudi; +#X text 266 96 write a file; +#X msg 127 186 read msgfile.txt pd; +#X msg 127 206 write /tmp/msgfile.txt pd; +#X text 343 170 read a file in Pd's native format (lines are terminated +with semicolon). this is the DEFAULT.; +#X text 343 200 write a file in Pd's native format (lines are terminated +with semicolon). this is the DEFAULT.; +#X text 343 240 write a file \, terminating lines only with carriage +return (omitting semicolons). You can read files this way too \, in +which case carriage returns are mapped to semicolons.; +#X text 343 380 read a file in Pd's native format (with semicolons +as line terminators): very much like the default mode ("pd") \, but +handles backslash-escaped whitespace (so you can read symbols with +spaces). You can write files this way too (which is the same as writing +in 'pd' format); +#X text 343 480 read a text file (with carriage return as line terminators): +very much like the "cr" mode \, but handles backslash-escaped whitespace +(so you can read symbols with spaces). You can write files this way +too (which is the same as writing in 'cr' format); +#X obj 57 161 t a; +#X obj 57 237 t a; +#X obj 57 298 t a; +#X obj 57 358 t a; +#X obj 57 498 t a; +#X text 151 600 you can set the DEFAULT read/write mode as a creation +argument.; +#X obj 502 602 msgfile txt; +#X text 343 300 write a CSV-file (Comma-Separated-Values) \, separating +atoms with comma and terminating lines with carriage return. Symbol-atoms +that contain whitespace (e.g. ' ') are automatically quoted. You can +read files this way too.; +#X connect 2 0 21 0; +#X connect 3 0 23 0; +#X connect 4 0 23 0; +#X connect 5 0 21 0; +#X connect 7 0 21 0; +#X connect 9 0 24 0; +#X connect 10 0 24 0; +#X connect 11 0 25 0; +#X connect 12 0 25 0; +#X connect 14 0 22 0; +#X connect 15 0 22 0; +#X connect 21 0 22 0; +#X connect 22 0 23 0; +#X connect 23 0 24 0; +#X connect 24 0 25 0; +#X connect 25 0 0 0; #X restore 423 144 pd file-i/o; #N canvas 67 162 450 397 misc 0; #X obj 84 282 outlet; diff --git a/externals/zexy/reference/multireceive-help.pd b/externals/zexy/reference/multireceive-help.pd new file mode 100644 index 0000000000000000000000000000000000000000..8940eb46d58abd019eddae7c446ebe6300a43331 --- /dev/null +++ b/externals/zexy/reference/multireceive-help.pd @@ -0,0 +1,23 @@ +#N canvas 275 127 834 332 10; +#X floatatom 389 174 5 0 0 0 - - -, f 5; +#X obj 153 186 print x; +#X text 51 32 [multireceive]: combine multiple receives; +#X obj 389 202 s \$0-a; +#X msg 442 171 set foo bar; +#X obj 442 202 s \$0-c; +#X msg 153 120 set foo bar; +#X obj 153 164 multireceive \$0-a foo \$0-c; +#X floatatom 549 154 5 0 0 0 - - -, f 5; +#X obj 549 202 s foo; +#X msg 549 173 foo \$1; +#X obj 602 202 s bar; +#X msg 602 173 bar-\$1; +#X floatatom 602 154 5 0 0 0 - - -, f 5; +#X connect 0 0 3 0; +#X connect 4 0 5 0; +#X connect 6 0 7 0; +#X connect 7 0 1 0; +#X connect 8 0 10 0; +#X connect 10 0 9 0; +#X connect 12 0 11 0; +#X connect 13 0 12 0; diff --git a/externals/zexy/reference/packel-help.pd b/externals/zexy/reference/packel-help.pd index f31a9e7bcada555a17fb8b42baf1aeb383818d58..2616e4e851457bf3a03afe9479de30a4ba9c8a32 100644 --- a/externals/zexy/reference/packel-help.pd +++ b/externals/zexy/reference/packel-help.pd @@ -8,8 +8,8 @@ #X obj 62 401 print REVERSE_ELEMENT; #X text 146 75 creation: packel [<n>]; #X text 185 92 n indicates the index of the element to be output; -#X text 185 110 n==0 ouputs the whole package; -#X text 185 127 n<0 ouputs the nth-last element; +#X text 185 110 n==0 outputs the whole package; +#X text 185 127 n<0 outputs the nth-last element; #X text 461 26 part of zexy; #X msg 62 191 list uno dva drei quattre five; #X msg 62 357 list uno dva drei quattre five; diff --git a/externals/zexy/reference/relay-help.pd b/externals/zexy/reference/relay-help.pd index db6a8101deb437d4759792373af0faaee9350293..f90cfc39799b48bea69e6490d97009736d1f1336 100644 --- a/externals/zexy/reference/relay-help.pd +++ b/externals/zexy/reference/relay-help.pd @@ -1,6 +1,6 @@ #N canvas 0 31 778 668 10; #X text 625 11 part of; -#X obj 700 10 zexy; +#X text 700 10 zexy; #X obj 183 223 print x1; #X obj 261 223 print x2; #X obj 339 223 print x3; diff --git a/externals/zexy/reference/sf-play_record-help.pd b/externals/zexy/reference/sf-play_record-help.pd index 512236567e53c08c50b99043d6c28ce0deee260a..33f397d1d9a2d931c20b0d635cb3bc6e5e05fd7b 100644 --- a/externals/zexy/reference/sf-play_record-help.pd +++ b/externals/zexy/reference/sf-play_record-help.pd @@ -30,7 +30,7 @@ #X text 52 64 up to now \, the "sfrecord" only supports .RAW format ; #X text 51 78 "sfplay" can skip any header \, if you know it's size:: -just call "sfplay <num.of.chan> <skip.bytes>; +just call "sfplay <num.of.chan> <skip.bytes>"; #X floatatom 471 356 0 0 0 0 - - -; #N canvas 160 49 495 266 output 0; #X obj 338 160 t b; diff --git a/externals/zexy/src/0x260x26_tilde.c b/externals/zexy/src/0x260x26_tilde.c index 793ce500c6c9713c0c2c6d9674d76501b6bc1a6f..47c8c07e05f49c5f3ed6455b7e01db030aa09e99 100644 --- a/externals/zexy/src/0x260x26_tilde.c +++ b/externals/zexy/src/0x260x26_tilde.c @@ -23,7 +23,7 @@ /* ------------------------ logical~ ----------------------------- */ /* ----------------------------- andand_tilde ----------------------------- */ -static t_class *andand_tilde_class, *scalarandand_tilde_class; +static t_class *andand_tilde_class=NULL, *scalarandand_tilde_class=NULL; typedef struct _andand_tilde { t_object x_obj; @@ -33,7 +33,7 @@ typedef struct _andand_tilde { typedef struct _scalarandand_tilde { t_object x_obj; t_float x_f; - t_float x_g; /* inlet value */ + t_float x_g; /* inlet value */ } t_scalarandand_tilde; static void *andand_tilde_new(t_symbol * UNUSED(s), int argc, t_atom *argv) @@ -147,34 +147,34 @@ static t_int *andand_tilde_performSSE(t_int *w) while (n--) { __m128 xmm0, xmm1, xmm2; - xmm0 = _mm_and_ps (in1[0] , bitmask); /* =abs(f); */ - xmm1 = _mm_and_ps (in2[0] , bitmask); - xmm0 = _mm_cmpge_ps(xmm0 , + xmm0 = _mm_and_ps (in1[0], bitmask); /* =abs(f); */ + xmm1 = _mm_and_ps (in2[0], bitmask); + xmm0 = _mm_cmpge_ps(xmm0, one); /* =(abs(f)>=1.0)=i (a weird cast to integer) */ - xmm1 = _mm_cmpge_ps(xmm1 , one); - xmm2 = _mm_and_ps (xmm0 , xmm1); /* =(i0&&i1) */ - out[0] = _mm_and_ps (xmm2 , one); /* 0xfffffff -> 1.0 */ - - xmm0 = _mm_and_ps (in1[1] , bitmask); - xmm1 = _mm_and_ps (in2[1] , bitmask); - xmm0 = _mm_cmpge_ps(xmm0 , one); - xmm1 = _mm_cmpge_ps(xmm1 , one); - xmm2 = _mm_and_ps (xmm0 , xmm1); - out[1] = _mm_and_ps (xmm2 , one); - - xmm0 = _mm_and_ps (in1[2] , bitmask); - xmm1 = _mm_and_ps (in2[2] , bitmask); - xmm0 = _mm_cmpge_ps(xmm0 , one); - xmm1 = _mm_cmpge_ps(xmm1 , one); - xmm2 = _mm_and_ps (xmm0 , xmm1); - out[2] = _mm_and_ps (xmm2 , one); - - xmm0 = _mm_and_ps (in1[3] , bitmask); - xmm1 = _mm_and_ps (in2[3] , bitmask); - xmm0 = _mm_cmpge_ps(xmm0 , one); - xmm1 = _mm_cmpge_ps(xmm1 , one); - xmm2 = _mm_and_ps (xmm0 , xmm1); - out[3] = _mm_and_ps (xmm2 , one); + xmm1 = _mm_cmpge_ps(xmm1, one); + xmm2 = _mm_and_ps (xmm0, xmm1); /* =(i0&&i1) */ + out[0] = _mm_and_ps (xmm2, one); /* 0xfffffff -> 1.0 */ + + xmm0 = _mm_and_ps (in1[1], bitmask); + xmm1 = _mm_and_ps (in2[1], bitmask); + xmm0 = _mm_cmpge_ps(xmm0, one); + xmm1 = _mm_cmpge_ps(xmm1, one); + xmm2 = _mm_and_ps (xmm0, xmm1); + out[1] = _mm_and_ps (xmm2, one); + + xmm0 = _mm_and_ps (in1[2], bitmask); + xmm1 = _mm_and_ps (in2[2], bitmask); + xmm0 = _mm_cmpge_ps(xmm0, one); + xmm1 = _mm_cmpge_ps(xmm1, one); + xmm2 = _mm_and_ps (xmm0, xmm1); + out[2] = _mm_and_ps (xmm2, one); + + xmm0 = _mm_and_ps (in1[3], bitmask); + xmm1 = _mm_and_ps (in2[3], bitmask); + xmm0 = _mm_cmpge_ps(xmm0, one); + xmm1 = _mm_cmpge_ps(xmm1, one); + xmm2 = _mm_and_ps (xmm0, xmm1); + out[3] = _mm_and_ps (xmm2, one); in1+=4; in2+=4; @@ -202,25 +202,25 @@ static t_int *scalarandand_tilde_performSSE(t_int *w) while (n--) { __m128 xmm0, xmm1; xmm0 = _mm_and_ps (in[0], bitmask); /* =abs(f); */ - xmm0 = _mm_cmpge_ps(xmm0 , + xmm0 = _mm_cmpge_ps(xmm0, one); /* =(abs(f)>=1.0)=i (a weird cast to integer) */ - xmm0 = _mm_and_ps (xmm0 , scalar); /* =(i0&&i1) */ - out[0] = _mm_and_ps (xmm0 , one); /* 0xfffffff -> 1.0 */ + xmm0 = _mm_and_ps (xmm0, scalar); /* =(i0&&i1) */ + out[0] = _mm_and_ps (xmm0, one); /* 0xfffffff -> 1.0 */ xmm1 = _mm_and_ps (in[1], bitmask); - xmm1 = _mm_cmpge_ps(xmm1 , one); - xmm1 = _mm_and_ps (xmm1 , scalar); - out[1] = _mm_and_ps (xmm1 , one); + xmm1 = _mm_cmpge_ps(xmm1, one); + xmm1 = _mm_and_ps (xmm1, scalar); + out[1] = _mm_and_ps (xmm1, one); xmm0 = _mm_and_ps (in[2], bitmask); - xmm0 = _mm_cmpge_ps(xmm0 , one); - xmm0 = _mm_and_ps (xmm0 , scalar); - out[2] = _mm_and_ps (xmm0 , one); + xmm0 = _mm_cmpge_ps(xmm0, one); + xmm0 = _mm_and_ps (xmm0, scalar); + out[2] = _mm_and_ps (xmm0, one); xmm1 = _mm_and_ps (in[3], bitmask); - xmm1 = _mm_cmpge_ps(xmm1 , one); - xmm1 = _mm_and_ps (xmm1 , scalar); - out[3] = _mm_and_ps (xmm1 , one); + xmm1 = _mm_cmpge_ps(xmm1, one); + xmm1 = _mm_and_ps (xmm1, scalar); + out[3] = _mm_and_ps (xmm1, one); in +=4; out+=4; @@ -278,32 +278,29 @@ static void scalarandand_tilde_dsp(t_scalarandand_tilde *x, t_signal **sp) } } -static void andand_tilde_help(t_object*x) +static void andand_tilde_help(t_object* UNUSED(x)) { post("\n"HEARTSYMBOL " &&~\t\t:: logical AND operation on 2 signals"); } -void setup_0x260x26_tilde(void) +ZEXY_SETUP void setup_0x260x26_tilde(void) { - andand_tilde_class = class_new(gensym("&&~"), - (t_newmethod)andand_tilde_new, 0, - sizeof(t_andand_tilde), 0, A_GIMME, 0); - class_addmethod(andand_tilde_class, (t_method)andand_tilde_dsp, - gensym("dsp"), A_CANT, 0); + andand_tilde_class = zexy_new("&&~", + andand_tilde_new, 0, t_andand_tilde, 0, "*"); + zexy_addmethod(andand_tilde_class, (t_method)andand_tilde_dsp, "dsp", "!"); CLASS_MAINSIGNALIN(andand_tilde_class, t_andand_tilde, x_f); - class_addmethod (andand_tilde_class, (t_method)andand_tilde_help, - gensym("help"), A_NULL); + zexy_addmethod(andand_tilde_class, (t_method)andand_tilde_help, "help", + ""); class_sethelpsymbol(andand_tilde_class, gensym("zigbinops")); - scalarandand_tilde_class = class_new(gensym("&&~"), 0, 0, - sizeof(t_scalarandand_tilde), 0, 0); + scalarandand_tilde_class = zexy_new("&&~", + 0, 0, t_scalarandand_tilde, 0, ""); CLASS_MAINSIGNALIN(scalarandand_tilde_class, t_scalarandand_tilde, x_f); - class_addmethod(scalarandand_tilde_class, (t_method)scalarandand_tilde_dsp, - gensym("dsp"), A_CANT, - 0); - class_addmethod (scalarandand_tilde_class, (t_method)andand_tilde_help, - gensym("help"), A_NULL); + zexy_addmethod(scalarandand_tilde_class, (t_method)scalarandand_tilde_dsp, + "dsp", "!"); + zexy_addmethod(scalarandand_tilde_class, (t_method)andand_tilde_help, + "help", ""); class_sethelpsymbol(scalarandand_tilde_class, gensym("zigbinops")); zexy_register("&&~"); diff --git a/externals/zexy/src/0x2e.c b/externals/zexy/src/0x2e.c index 83f4abc2a1b3bf6e3a411e57bc95ef857ba4e14c..f5b662344cea74b2a465cb21956a8d65e1502c21 100644 --- a/externals/zexy/src/0x2e.c +++ b/externals/zexy/src/0x2e.c @@ -20,8 +20,8 @@ #include "zexy.h" -static t_class *scalmul_class; -static t_class *scalmul_scal_class; +static t_class *scalmul_class=NULL; +static t_class *scalmul_scal_class=NULL; typedef struct _scalmul { t_object x_obj; @@ -156,26 +156,23 @@ static void *scalmul_new(t_symbol* UNUSED(s), int argc, t_atom *argv) return (x); } -static void scalmul_help(t_scalmul*x) +static void scalmul_help(t_scalmul* UNUSED(x)) { post("\n"HEARTSYMBOL " .\t\t:: scalar multiplication (in-product)"); } -void setup_0x2e(void) +ZEXY_SETUP void setup_0x2e(void) { - scalmul_class = class_new(gensym("."), (t_newmethod)scalmul_new, - (t_method)scalmul_free, sizeof(t_scalmul), 0, A_GIMME, 0); + scalmul_class = zexy_new(".", + scalmul_new, scalmul_free, t_scalmul, 0, "*"); class_addlist(scalmul_class, scalmul_lst); - class_addmethod (scalmul_class, (t_method)scalmul_lst2, gensym(""), - A_GIMME, 0); - class_addmethod(scalmul_class, (t_method)scalmul_help, gensym("help"), - A_NULL); + zexy_addmethod(scalmul_class, (t_method)scalmul_lst2, "", "*"); + zexy_addmethod(scalmul_class, (t_method)scalmul_help, "help", ""); - scalmul_scal_class = class_new(gensym("."), 0, (t_method)scalmul_free, - sizeof(t_scalmul), 0, 0); + scalmul_scal_class = zexy_new(".", + 0, scalmul_free, t_scalmul, 0, ""); class_addlist(scalmul_scal_class, scalmul_lst); - class_addmethod(scalmul_scal_class, (t_method)scalmul_help, gensym("help"), - A_NULL); + zexy_addmethod(scalmul_scal_class, (t_method)scalmul_help, "help", ""); class_sethelpsymbol(scalmul_class, gensym("scalarmult")); class_sethelpsymbol(scalmul_scal_class, gensym("scalarmult")); diff --git a/externals/zexy/src/0x3c_tilde.c b/externals/zexy/src/0x3c_tilde.c index 6e278fd96eb2a372dcf303683452bff43aece5e8..78d82a55c54588a5ad96812c459db7f8deeabcde 100644 --- a/externals/zexy/src/0x3c_tilde.c +++ b/externals/zexy/src/0x3c_tilde.c @@ -1,5 +1,5 @@ /* - * <~: signal comparision + * <~: signal comparison * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * @@ -23,7 +23,7 @@ /* ----------------------------- lt_tilde ----------------------------- */ -static t_class *lt_tilde_class, *scalarlt_tilde_class; +static t_class *lt_tilde_class=NULL, *scalarlt_tilde_class=NULL; typedef struct _lt_tilde { t_object x_obj; @@ -33,7 +33,7 @@ typedef struct _lt_tilde { typedef struct _scalarlt_tilde { t_object x_obj; t_float x_f; - t_float x_g; /* inlet value */ + t_float x_g; /* inlet value */ } t_scalarlt_tilde; static void *lt_tilde_new(t_symbol *UNUSED(s), int argc, t_atom *argv) @@ -139,16 +139,16 @@ static t_int *lt_tilde_performSSE(t_int *w) while (n--) { __m128 xmm0, xmm1; xmm0 = _mm_cmplt_ps(in1[0], in2[0]); - out[0] = _mm_and_ps (xmm0 , one); + out[0] = _mm_and_ps (xmm0, one); xmm1 = _mm_cmplt_ps(in1[1], in2[1]); - out[1] = _mm_and_ps (xmm1 , one); + out[1] = _mm_and_ps (xmm1, one); xmm0 = _mm_cmplt_ps(in1[2], in2[2]); - out[2] = _mm_and_ps (xmm0 , one); + out[2] = _mm_and_ps (xmm0, one); xmm1 = _mm_cmplt_ps(in1[3], in2[3]); - out[3] = _mm_and_ps (xmm1 , one); + out[3] = _mm_and_ps (xmm1, one); in1+=4; in2+=4; @@ -234,30 +234,26 @@ static void scalarlt_tilde_dsp(t_scalarlt_tilde *x, t_signal **sp) dsp_add(scalarlt_tilde_perf8, 4, in, &x->x_g, out, (t_int)n); } } -static void lt_tilde_help(t_object*x) +static void lt_tilde_help(t_object* UNUSED(x)) { post("\n"HEARTSYMBOL " <~\t\t:: compare 2 signals"); } -void setup_0x3c_tilde(void) +ZEXY_SETUP void setup_0x3c_tilde(void) { - lt_tilde_class = class_new(gensym("<~"), (t_newmethod)lt_tilde_new, 0, - sizeof(t_lt_tilde), 0, A_GIMME, 0); - class_addmethod(lt_tilde_class, (t_method)lt_tilde_dsp, gensym("dsp"), - A_CANT, 0); + lt_tilde_class = zexy_new("<~", + lt_tilde_new, 0, t_lt_tilde, 0, "*"); + zexy_addmethod(lt_tilde_class, (t_method)lt_tilde_dsp, "dsp", "!"); CLASS_MAINSIGNALIN(lt_tilde_class, t_lt_tilde, x_f); - class_addmethod (lt_tilde_class, (t_method)lt_tilde_help, gensym("help"), - A_NULL); + zexy_addmethod(lt_tilde_class, (t_method)lt_tilde_help, "help", ""); class_sethelpsymbol(lt_tilde_class, gensym("zigbinops")); - scalarlt_tilde_class = class_new(gensym("<~"), 0, 0, - sizeof(t_scalarlt_tilde), 0, 0); + scalarlt_tilde_class = zexy_new("<~", + 0, 0, t_scalarlt_tilde, 0, ""); CLASS_MAINSIGNALIN(scalarlt_tilde_class, t_scalarlt_tilde, x_f); - class_addmethod(scalarlt_tilde_class, (t_method)scalarlt_tilde_dsp, - gensym("dsp"), - A_CANT, 0); - class_addmethod (scalarlt_tilde_class, (t_method)lt_tilde_help, - gensym("help"), A_NULL); + zexy_addmethod(scalarlt_tilde_class, (t_method)scalarlt_tilde_dsp, "dsp", + "!"); + zexy_addmethod(scalarlt_tilde_class, (t_method)lt_tilde_help, "help", ""); class_sethelpsymbol(scalarlt_tilde_class, gensym("zigbinops")); zexy_register("<~"); } diff --git a/externals/zexy/src/0x3d0x3d_tilde.c b/externals/zexy/src/0x3d0x3d_tilde.c index 3430987865663a6fdf7bacff2caab48721f5a69c..75e9c55ab5780de6fed0cbd35e3ca3f76ae666e0 100644 --- a/externals/zexy/src/0x3d0x3d_tilde.c +++ b/externals/zexy/src/0x3d0x3d_tilde.c @@ -20,7 +20,7 @@ #include "zexySIMD.h" /* ----------------------------- eq_tilde ----------------------------- */ -static t_class *eq_tilde_class, *scalareq_tilde_class; +static t_class *eq_tilde_class=NULL, *scalareq_tilde_class=NULL; typedef struct _eq_tilde { t_object x_obj; @@ -30,7 +30,7 @@ typedef struct _eq_tilde { typedef struct _scalareq_tilde { t_object x_obj; t_float x_f; - t_float x_g; /* inlet value */ + t_float x_g; /* inlet value */ } t_scalareq_tilde; static void *eq_tilde_new(t_symbol* UNUSED(s), int argc, t_atom *argv) @@ -137,16 +137,16 @@ static t_int *eq_tilde_performSSE(t_int *w) while (n--) { __m128 xmm0, xmm1; xmm0 = _mm_cmpeq_ps(in1[0], in2[0]); - out[0] = _mm_and_ps (xmm0 , one); + out[0] = _mm_and_ps (xmm0, one); xmm1 = _mm_cmpeq_ps(in1[1], in2[1]); - out[1] = _mm_and_ps (xmm1 , one); + out[1] = _mm_and_ps (xmm1, one); xmm0 = _mm_cmpeq_ps(in1[2], in2[2]); - out[2] = _mm_and_ps (xmm0 , one); + out[2] = _mm_and_ps (xmm0, one); xmm1 = _mm_cmpeq_ps(in1[3], in2[3]); - out[3] = _mm_and_ps (xmm1 , one); + out[3] = _mm_and_ps (xmm1, one); in1+=4; in2+=4; @@ -159,7 +159,7 @@ static t_int *scalareq_tilde_performSSE(t_int *w) { __m128 *in = (__m128 *)(w[1]); __m128 *out = (__m128 *)(w[3]); - float f = *(float *)(w[2]); + t_float f = *(t_float *)(w[2]); __m128 scalar = _mm_set1_ps(f); int n = (int)(w[4])>>4; const __m128 one = _mm_set1_ps(1.f); @@ -234,29 +234,25 @@ static void scalareq_tilde_dsp(t_scalareq_tilde *x, t_signal **sp) } } -static void eq_tilde_help(t_object*x) +static void eq_tilde_help(t_object* UNUSED(x)) { post("\n"HEARTSYMBOL " &&~\t\t:: test 2 signals for equality"); } -void setup_0x3d0x3d_tilde(void) +ZEXY_SETUP void setup_0x3d0x3d_tilde(void) { - eq_tilde_class = class_new(gensym("==~"), (t_newmethod)eq_tilde_new, 0, - sizeof(t_eq_tilde), 0, A_GIMME, 0); - class_addmethod(eq_tilde_class, (t_method)eq_tilde_dsp, gensym("dsp"), - A_CANT, 0); + eq_tilde_class = zexy_new("==~", + eq_tilde_new, 0, t_eq_tilde, 0, "*"); + zexy_addmethod(eq_tilde_class, (t_method)eq_tilde_dsp, "dsp", "!"); CLASS_MAINSIGNALIN(eq_tilde_class, t_eq_tilde, x_f); - class_addmethod (eq_tilde_class, (t_method)eq_tilde_help, gensym("help"), - A_NULL); + zexy_addmethod(eq_tilde_class, (t_method)eq_tilde_help, "help", ""); class_sethelpsymbol(eq_tilde_class, gensym("zigbinops")); - scalareq_tilde_class = class_new(gensym("==~"), 0, 0, - sizeof(t_scalareq_tilde), 0, 0); + scalareq_tilde_class = zexy_new("==~", + 0, 0, t_scalareq_tilde, 0, ""); CLASS_MAINSIGNALIN(scalareq_tilde_class, t_scalareq_tilde, x_f); - class_addmethod(scalareq_tilde_class, (t_method)scalareq_tilde_dsp, - gensym("dsp"), - A_CANT, 0); - class_addmethod (scalareq_tilde_class, (t_method)eq_tilde_help, - gensym("help"), A_NULL); + zexy_addmethod(scalareq_tilde_class, (t_method)scalareq_tilde_dsp, "dsp", + "!"); + zexy_addmethod(scalareq_tilde_class, (t_method)eq_tilde_help, "help", ""); class_sethelpsymbol(scalareq_tilde_class, gensym("zigbinops")); zexy_register("==~"); diff --git a/externals/zexy/src/0x3e_tilde.c b/externals/zexy/src/0x3e_tilde.c index 008a3b1c32fd324c87ce14f9483429e59cb4ed96..0705bc99cba34361db2be05054c70e4178b4385e 100644 --- a/externals/zexy/src/0x3e_tilde.c +++ b/externals/zexy/src/0x3e_tilde.c @@ -1,5 +1,5 @@ /* - * >~: signal comparision + * >~: signal comparison * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * @@ -23,7 +23,7 @@ /* ------------------------ relational~ ----------------------------- */ /* ----------------------------- gt_tilde ----------------------------- */ -static t_class *gt_tilde_class, *scalargt_tilde_class; +static t_class *gt_tilde_class=NULL, *scalargt_tilde_class=NULL; typedef struct _gt_tilde { t_object x_obj; @@ -33,7 +33,7 @@ typedef struct _gt_tilde { typedef struct _scalargt_tilde { t_object x_obj; t_float x_f; - t_float x_g; /* inlet value */ + t_float x_g; /* inlet value */ } t_scalargt_tilde; static void *gt_tilde_new(t_symbol* UNUSED(s), int argc, t_atom *argv) @@ -139,16 +139,16 @@ static t_int *gt_tilde_performSSE(t_int *w) while (n--) { __m128 xmm0, xmm1; xmm0 = _mm_cmpgt_ps(in1[0], in2[0]); - out[0] = _mm_and_ps (xmm0 , one); + out[0] = _mm_and_ps (xmm0, one); xmm1 = _mm_cmpgt_ps(in1[1], in2[1]); - out[1] = _mm_and_ps (xmm1 , one); + out[1] = _mm_and_ps (xmm1, one); xmm0 = _mm_cmpgt_ps(in1[2], in2[2]); - out[2] = _mm_and_ps (xmm0 , one); + out[2] = _mm_and_ps (xmm0, one); xmm1 = _mm_cmpgt_ps(in1[3], in2[3]); - out[3] = _mm_and_ps (xmm1 , one); + out[3] = _mm_and_ps (xmm1, one); in1+=4; in2+=4; @@ -237,30 +237,26 @@ static void scalargt_tilde_dsp(t_scalargt_tilde *x, t_signal **sp) } } -static void gt_tilde_help(t_object*x) +static void gt_tilde_help(t_object* UNUSED(x)) { post("\n"HEARTSYMBOL " >~\t\t:: compare 2 signals"); } -void setup_0x3e_tilde(void) +ZEXY_SETUP void setup_0x3e_tilde(void) { - gt_tilde_class = class_new(gensym(">~"), (t_newmethod)gt_tilde_new, 0, - sizeof(t_gt_tilde), 0, A_GIMME, 0); - class_addmethod(gt_tilde_class, (t_method)gt_tilde_dsp, gensym("dsp"), - A_CANT, 0); + gt_tilde_class = zexy_new(">~", + gt_tilde_new, 0, t_gt_tilde, 0, "*"); + zexy_addmethod(gt_tilde_class, (t_method)gt_tilde_dsp, "dsp", "!"); CLASS_MAINSIGNALIN(gt_tilde_class, t_gt_tilde, x_f); - class_addmethod (gt_tilde_class, (t_method)gt_tilde_help, gensym("help"), - A_NULL); + zexy_addmethod(gt_tilde_class, (t_method)gt_tilde_help, "help", ""); class_sethelpsymbol(gt_tilde_class, gensym("zigbinops")); - scalargt_tilde_class = class_new(gensym(">~"), 0, 0, - sizeof(t_scalargt_tilde), 0, 0); + scalargt_tilde_class = zexy_new(">~", + 0, 0, t_scalargt_tilde, 0, ""); CLASS_MAINSIGNALIN(scalargt_tilde_class, t_scalargt_tilde, x_f); - class_addmethod(scalargt_tilde_class, (t_method)scalargt_tilde_dsp, - gensym("dsp"), - A_CANT, 0); - class_addmethod (scalargt_tilde_class, (t_method)gt_tilde_help, - gensym("help"), A_NULL); + zexy_addmethod(scalargt_tilde_class, (t_method)scalargt_tilde_dsp, "dsp", + "!"); + zexy_addmethod(scalargt_tilde_class, (t_method)gt_tilde_help, "help", ""); class_sethelpsymbol(scalargt_tilde_class, gensym("zigbinops")); zexy_register(">~"); diff --git a/externals/zexy/src/0x7c0x7c_tilde.c b/externals/zexy/src/0x7c0x7c_tilde.c index 558c7609078098b3f9bb3cb29a1fb6e4d9486074..364dde2f06e6ffebd6bccfdd5b40b7c7a07494e8 100644 --- a/externals/zexy/src/0x7c0x7c_tilde.c +++ b/externals/zexy/src/0x7c0x7c_tilde.c @@ -20,7 +20,7 @@ #include "zexySIMD.h" /* ----------------------------- oror_tilde ----------------------------- */ -static t_class *oror_tilde_class, *scalaroror_tilde_class; +static t_class *oror_tilde_class=NULL, *scalaroror_tilde_class=NULL; typedef struct _oror_tilde { t_object x_obj; @@ -30,7 +30,7 @@ typedef struct _oror_tilde { typedef struct _scalaroror_tilde { t_object x_obj; t_float x_f; - t_float x_g; /* inlet value */ + t_float x_g; /* inlet value */ } t_scalaroror_tilde; static void *oror_tilde_new(t_symbol* UNUSED(s), int argc, t_atom *argv) @@ -140,23 +140,23 @@ static t_int *oror_tilde_performSSE(t_int *w) __m128 xmm0, xmm1, xmm2; xmm0 = _mm_cmpneq_ps(in1[0], zero); xmm1 = _mm_cmpneq_ps(in2[0], zero); - xmm2 = _mm_or_ps (xmm0 , xmm1); - out[0] = _mm_and_ps (xmm2 , one); + xmm2 = _mm_or_ps (xmm0, xmm1); + out[0] = _mm_and_ps (xmm2, one); xmm0 = _mm_cmpneq_ps(in1[1], zero); xmm1 = _mm_cmpneq_ps(in2[1], zero); - xmm2 = _mm_or_ps (xmm0 , xmm1); - out[1] = _mm_and_ps (xmm2 , one); + xmm2 = _mm_or_ps (xmm0, xmm1); + out[1] = _mm_and_ps (xmm2, one); xmm0 = _mm_cmpneq_ps(in1[2], zero); xmm1 = _mm_cmpneq_ps(in2[2], zero); - xmm2 = _mm_or_ps (xmm0 , xmm1); - out[2] = _mm_and_ps (xmm2 , one); + xmm2 = _mm_or_ps (xmm0, xmm1); + out[2] = _mm_and_ps (xmm2, one); xmm0 = _mm_cmpneq_ps(in1[3], zero); xmm1 = _mm_cmpneq_ps(in2[3], zero); - xmm2 = _mm_or_ps (xmm0 , xmm1); - out[3] = _mm_and_ps (xmm2 , one); + xmm2 = _mm_or_ps (xmm0, xmm1); + out[3] = _mm_and_ps (xmm2, one); in1+=4; in2+=4; @@ -179,20 +179,20 @@ static t_int *scalaroror_tilde_performSSE(t_int *w) while (n--) { __m128 xmm0, xmm1; xmm0 = _mm_cmpneq_ps(in[0], zero); - xmm1 = _mm_or_ps (xmm0 , scalar); - out[0] = _mm_and_ps (xmm1 , one); + xmm1 = _mm_or_ps (xmm0, scalar); + out[0] = _mm_and_ps (xmm1, one); xmm0 = _mm_cmpneq_ps(in[1], zero); - xmm1 = _mm_or_ps (xmm0 , scalar); - out[1] = _mm_and_ps (xmm1 , one); + xmm1 = _mm_or_ps (xmm0, scalar); + out[1] = _mm_and_ps (xmm1, one); xmm0 = _mm_cmpneq_ps(in[2], zero); - xmm1 = _mm_or_ps (xmm0 , scalar); - out[2] = _mm_and_ps (xmm1 , one); + xmm1 = _mm_or_ps (xmm0, scalar); + out[2] = _mm_and_ps (xmm1, one); xmm0 = _mm_cmpneq_ps(in[3], zero); - xmm1 = _mm_or_ps (xmm0 , scalar); - out[3] = _mm_and_ps (xmm1 , one); + xmm1 = _mm_or_ps (xmm0, scalar); + out[3] = _mm_and_ps (xmm1, one); in +=4; @@ -252,30 +252,27 @@ static void scalaroror_tilde_dsp(t_scalaroror_tilde *x, t_signal **sp) } } -static void oror_tilde_help(t_object*x) +static void oror_tilde_help(t_object* UNUSED(x)) { post("\n"HEARTSYMBOL " &&~\t\t:: logical OR operation on 2 signals"); } -void setup_0x7c0x7c_tilde(void) +ZEXY_SETUP void setup_0x7c0x7c_tilde(void) { - oror_tilde_class = class_new(gensym("||~"), (t_newmethod)oror_tilde_new, 0, - sizeof(t_oror_tilde), 0, A_GIMME, 0); - class_addmethod(oror_tilde_class, (t_method)oror_tilde_dsp, gensym("dsp"), - A_CANT, 0); + oror_tilde_class = zexy_new("||~", + oror_tilde_new, 0, t_oror_tilde, 0, "*"); + zexy_addmethod(oror_tilde_class, (t_method)oror_tilde_dsp, "dsp", "!"); CLASS_MAINSIGNALIN(oror_tilde_class, t_oror_tilde, x_f); - class_addmethod (oror_tilde_class, (t_method)oror_tilde_help, - gensym("help"), A_NULL); + zexy_addmethod(oror_tilde_class, (t_method)oror_tilde_help, "help", ""); class_sethelpsymbol(oror_tilde_class, gensym("zigbinops")); - scalaroror_tilde_class = class_new(gensym("||~"), 0, 0, - sizeof(t_scalaroror_tilde), 0, 0); + scalaroror_tilde_class = zexy_new("||~", + 0, 0, t_scalaroror_tilde, 0, ""); CLASS_MAINSIGNALIN(scalaroror_tilde_class, t_scalaroror_tilde, x_f); - class_addmethod(scalaroror_tilde_class, (t_method)scalaroror_tilde_dsp, - gensym("dsp"), - A_CANT, 0); - class_addmethod (scalaroror_tilde_class, (t_method)oror_tilde_help, - gensym("help"), A_NULL); + zexy_addmethod(scalaroror_tilde_class, (t_method)scalaroror_tilde_dsp, + "dsp", "!"); + zexy_addmethod(scalaroror_tilde_class, (t_method)oror_tilde_help, "help", + ""); class_sethelpsymbol(scalaroror_tilde_class, gensym("zigbinops")); zexy_register("||~"); diff --git a/externals/zexy/src/Makefile.am b/externals/zexy/src/Makefile.am deleted file mode 100644 index 399eb3d0bc21b163fd54345a3f48870fb0171979..0000000000000000000000000000000000000000 --- a/externals/zexy/src/Makefile.am +++ /dev/null @@ -1,250 +0,0 @@ -AUTOMAKE_OPTIONS = foreign -ACLOCAL_AMFLAGS = -I m4 - -pkglib_LTLIBRARIES= - -AM_CFLAGS = -AM_LDFLAGS= -module -avoid-version -shared -shrext .@EXTENSION@ - -if WINDOWS -AM_LDFLAGS+= -no-undefined -endif - -AM_LDFLAGS+= @EXTRA_LTFLAGS@ - -# RTE -AM_CFLAGS += -AM_LDFLAGS+= - -EXTRA_DIST = \ - astyle.rc - -if LIBRARY -pkglib_LTLIBRARIES+=zexy.la -endif LIBRARY -if SINGLEOBJECTS -pkglib_LTLIBRARIES+= \ - 0x260x26_tilde.la \ - 0x2e.la \ - 0x3c_tilde.la \ - 0x3d0x3d_tilde.la \ - 0x3e_tilde.la \ - 0x7c0x7c_tilde.la \ - any2list.la \ - a2l.la \ - abs~.la \ - absgn~.la \ - atoi.la \ - atof.la \ - avg~.la \ - blockmirror~.la \ - blockshuffle~.la \ - blockswap~.la \ - date.la \ - demultiplex~.la \ - demux~.la \ - demultiplex.la \ - demux.la \ - dfreq~.la \ - dirac~.la \ - doublepole~.la \ - drip.la \ - unfold.la \ - envrms~.la \ - fifop.la \ - freadln.la \ - fwriteln.la \ - glue.la \ - index.la \ - length.la \ - lifop.la \ - limiter~.la \ - l2i.la \ - list2int.la \ - list2lists.la \ - l2s.la \ - list2symbol.la \ - l.la \ - lister.la \ - listfind.la \ - liststorage.la \ - longload.la \ - lpt.la \ - lp.la \ - makesymbol.la \ - matchbox.la \ - mavg.la \ - minmax.la \ - msgfile.la \ - multiline~.la \ - mux~.la \ - mux.la \ - multiplex~.la \ - multiplex.la \ - multireceive.la \ - niagara.la \ - noish~.la \ - noisi~.la \ - operating_system.la \ - pack~.la \ - pack.la \ - packel.la \ - pdf~.la \ - prime.la \ - quantize~.la \ - rawprint.la \ - regex.la \ - relay.la \ - repack.la \ - repeat.la \ - route~.la \ - sfplay.la \ - sfrecord.la \ - sgn~.la \ - sigzero~.la \ - sleepgrain.la \ - sort.la \ - step~.la \ - strcmp.la \ - sum.la \ - swap~.la \ - symbol2list.la \ - s2l.la \ - tabdump.la \ - tabminmax.la \ - tabread4~~.la \ - tabset.la \ - tavg~.la \ - time.la \ - unpack~.la \ - unpack.la \ - urn.la \ - wrap.la \ - z~.la -endif SINGLEOBJECTS - -zexy_la_CPPFLAGS=-DZEXY_LIBRARY - - -0x260x260x7e_la_SOURCES = 0x260x260x7e.c -0x2e_la_SOURCES = 0x2e.c -0x3c0x7e_la_SOURCES = 0x3c0x7e.c -0x3d0x3d0x7e_la_SOURCES = 0x3d0x3d0x7e.c -0x3e0x7e_la_SOURCES = 0x3e0x7e.c -0x7c0x7c0x7e_la_SOURCES = 0x7c0x7c0x7e.c -a2l_la_SOURCES = a2l.c -any2list_la_SOURCES = a2l.c -abs__la_SOURCES = abs~.c -absgn__la_SOURCES = absgn~.c -atoi_la_SOURCES = atoi.c -atof_la_SOURCES = atof.c -avg__la_SOURCES = avg~.c -blockmirror__la_SOURCES = blockmirror~.c -blockshuffle__la_SOURCES= blockshuffle~.c -blockswap__la_SOURCES = blockswap~.c -date_la_SOURCES = date.c -demultiplex__la_SOURCES = demultiplex~.c -demux__la_SOURCES = demultiplex~.c -demultiplex_la_SOURCES = demultiplex.c -demux_la_SOURCES = demultiplex.c -dfreq__la_SOURCES = dfreq~.c -dirac__la_SOURCES = dirac~.c -doublepole__la_SOURCES = doublepole~.c -drip_la_SOURCES = drip.c -unfold_la_SOURCES = drip.c -envrms__la_SOURCES = envrms~.c -fifop_la_SOURCES = fifop.c -freadln_la_SOURCES = freadln.c -fwriteln_la_SOURCES = fwriteln.c -glue_la_SOURCES = glue.c -index_la_SOURCES = index.c -length_la_SOURCES = length.c -lifop_la_SOURCES = lifop.c -limiter__la_SOURCES = limiter~.c -list2int_la_SOURCES = list2int.c -l2i_la_SOURCES = list2int.c -list2lists_la_SOURCES = list2lists.c -list2symbol_la_SOURCES = list2symbol.c -l2s_la_SOURCES = list2symbol.c -lister_la_SOURCES = lister.c -l_la_SOURCES = lister.c -listfind_la_SOURCES = listfind.c -liststorage_la_SOURCES = liststorage.c -longload_la_SOURCES = longload.c -if LPT -lpt_la_SOURCES = lpt.c -lp_la_SOURCES = lpt.c -if WINDOWS -lpt_la_SOURCES += winNT_portio.c -lp_la_SOURCES += winNT_portio.c -endif -endif -makesymbol_la_SOURCES = makesymbol.c -matchbox_la_SOURCES = matchbox.c -mavg_la_SOURCES = mavg.c -minmax_la_SOURCES = minmax.c -msgfile_la_SOURCES = msgfile.c -multiline__la_SOURCES = multiline~.c -mux__la_SOURCES = multiplex~.c -multiplex__la_SOURCES = multiplex~.c -mux_la_SOURCES = multiplex.c -multiplex_la_SOURCES = multiplex.c -multireceive_la_SOURCES = multireceive.c -niagara_la_SOURCES = niagara.c -noish__la_SOURCES = noish~.c -noisi__la_SOURCES = noisi~.c -operating_system_la_SOURCES = operating_system.c -pack__la_SOURCES = pack~.c -pack_la_SOURCES = pack.c -packel_la_SOURCES = packel.c -pdf__la_SOURCES = pdf~.c -prime_la_SOURCES = prime.c -quantize__la_SOURCES = quantize~.c -rawprint_la_SOURCES = rawprint.c -regex_la_SOURCES = regex.c -relay_la_SOURCES = relay.c -repack_la_SOURCES = repack.c -repeat_la_SOURCES = repeat.c -route__la_SOURCES = route~.c -sfplay_la_SOURCES = sfplay.c -sfrecord_la_SOURCES = sfrecord.c -sgn__la_SOURCES = sgn~.c -sigzero__la_SOURCES = sigzero~.c -sleepgrain_la_SOURCES = sleepgrain.c -sort_la_SOURCES = sort.c -step__la_SOURCES = step~.c -strcmp_la_SOURCES = strcmp.c -sum_la_SOURCES = sum.c -swap__la_SOURCES = swap~.c -symbol2list_la_SOURCES = symbol2list.c -s2l_la_SOURCES = symbol2list.c -tabdump_la_SOURCES = tabdump.c -tabminmax_la_SOURCES = tabminmax.c -tabread4___la_SOURCES = tabread4~~.c -tabset_la_SOURCES = tabset.c -tavg__la_SOURCES = tavg~.c -time_la_SOURCES = time.c -unpack__la_SOURCES = unpack~.c -unpack_la_SOURCES = unpack.c -urn_la_SOURCES = urn.c -wrap_la_SOURCES = wrap.c -z__la_SOURCES = z~.c - -zexy_la_SOURCES = zexy.c z_zexy.c \ - zexy.h zexySIMD.h z_zexy.h zexyconf.h \ - 0x260x260x7e.c 0x2e.c 0x3c0x7e.c 0x3d0x3d0x7e.c 0x3e0x7e.c 0x7c0x7c0x7e.c \ - a2l.c abs~.c absgn~.c atoi.c atof.c avg~.c \ - blockmirror~.c blockshuffle~.c blockswap~.c \ - date.c demultiplex~.c demultiplex.c dfreq~.c dirac~.c doublepole~.c drip.c envrms~.c \ - fifop.c freadln.c fwriteln.c glue.c index.c length.c lifop.c limiter~.c \ - list2int.c list2lists.c list2symbol.c lister.c listfind.c liststorage.c longload.c lpt.c \ - makesymbol.c matchbox.c mavg.c minmax.c msgfile.c multiline~.c multiplex~.c \ - multiplex.c multireceive.c niagara.c noish~.c noisi~.c operating_system.c pack~.c \ - pack.c packel.c pdf~.c prime.c quantize~.c rawprint.c regex.c relay.c repack.c \ - repeat.c route~.c sfplay.c sfrecord.c sgn~.c sigzero~.c sleepgrain.c sort.c \ - step~.c strcmp.c sum.c swap~.c symbol2list.c tabdump.c tabminmax.c tabread4~~.c \ - tabset.c tavg~.c time.c unpack~.c unpack.c urn.c wrap.c z~.c -if WINDOWS -zexy_la_SOURCES += winNT_portio.c -endif - diff --git a/externals/zexy/src/a2l.c b/externals/zexy/src/a2l.c index 0f9b9044032c827cb9f88a17170d96423ecb998a..c84458e2eca3c5c1b7c68bb4e322283d1c4f663c 100644 --- a/externals/zexy/src/a2l.c +++ b/externals/zexy/src/a2l.c @@ -20,7 +20,7 @@ #include "zexy.h" #include <string.h> -static t_class *a2l_class; +static t_class *a2l_class=NULL; typedef struct _a2l { t_object x_obj; @@ -74,26 +74,29 @@ static void *a2l_new(void) outlet_new(&x->x_obj, 0); return (x); } - -void a2l_setup(void) +static t_class* zclass_setup(const char*name) +{ + t_class *c = zexy_new(name, + a2l_new, 0, t_a2l, 0, ""); + class_addbang (c, a2l_bang); + class_addfloat (c, a2l_float); + class_addsymbol (c, a2l_symbol); + class_addpointer (c, a2l_pointer); + class_addlist (c, a2l_list); + class_addanything(c, a2l_anything); + return c; +} +static void dosetup() { - - a2l_class = class_new(gensym("a2l"), (t_newmethod)a2l_new, - 0, sizeof(t_a2l), 0, 0); - class_addcreator((t_newmethod)a2l_new, gensym("any2list"), 0); - - - class_addbang (a2l_class, a2l_bang); - class_addfloat (a2l_class, a2l_float); - class_addsymbol (a2l_class, a2l_symbol); - class_addpointer (a2l_class, a2l_pointer); - class_addlist (a2l_class, a2l_list); - class_addanything(a2l_class, a2l_anything); - zexy_register("any2list"); + a2l_class=zclass_setup("any2list"); + zclass_setup("a2l"); } - void any2list_setup(void) { - a2l_setup(); + dosetup(); +} +ZEXY_SETUP void a2l_setup(void) +{ + dosetup(); } diff --git a/externals/zexy/src/absgn~.c b/externals/zexy/src/absgn~.c index 52d828927c6e47292f14d2fcf84f13a2c48ae802..697c75a63162c18f3286bde5cace0e08bd814036 100644 --- a/externals/zexy/src/absgn~.c +++ b/externals/zexy/src/absgn~.c @@ -27,7 +27,7 @@ typedef struct _absgn { /* ------------------------ sigABSGN~ ----------------------------- */ -static t_class *sigABSGN_class; +static t_class *sigABSGN_class=NULL; static t_int *sigABSGN_perform(t_int *w) { @@ -38,7 +38,7 @@ static t_int *sigABSGN_perform(t_int *w) while (n--) { t_sample val = *in++; - *out++ = fabsf(val); + *out++ = Z_FABS(val); if (val>0.) { *out2++=1.; @@ -132,16 +132,14 @@ static void *sigABSGN_new(void) return (x); } -void absgn_tilde_setup(void) +ZEXY_SETUP void absgn_tilde_setup(void) { - sigABSGN_class = class_new(gensym("absgn~"), (t_newmethod)sigABSGN_new, 0, - sizeof(t_absgn), 0, A_DEFFLOAT, 0); + sigABSGN_class = zexy_new("absgn~", + sigABSGN_new, 0, t_absgn, 0, ""); CLASS_MAINSIGNALIN(sigABSGN_class, t_absgn, x_f); - class_addmethod(sigABSGN_class, (t_method)sigABSGN_dsp, gensym("dsp"), - A_CANT, 0); + zexy_addmethod(sigABSGN_class, (t_method)sigABSGN_dsp, "dsp", "!"); - class_addmethod(sigABSGN_class, (t_method)sigABSGN_helper, gensym("help"), - 0); + zexy_addmethod(sigABSGN_class, (t_method)sigABSGN_helper, "help", ""); class_sethelpsymbol(sigABSGN_class, gensym("zigbinops")); zexy_register("absgn~"); diff --git a/externals/zexy/src/abs~.c b/externals/zexy/src/abs~.c index c2bf55a28c6060b35d5dc9dee383d5988cd64378..359a86b3d58765a4bef95f03366d9172a5899d32 100644 --- a/externals/zexy/src/abs~.c +++ b/externals/zexy/src/abs~.c @@ -28,7 +28,7 @@ typedef struct _abs { /* ------------------------ sigABS~ ----------------------------- */ -static t_class *sigABS_class; +static t_class *sigABS_class=NULL; static t_int *sigABS_perform(t_int *w) { @@ -37,7 +37,7 @@ static t_int *sigABS_perform(t_int *w) int n = (int)(w[3]); while (n--) { - *out++ = fabsf(*in++); + *out++ = Z_FABS(*in++); } return (w+4); @@ -54,10 +54,10 @@ static t_int *sigABS_performSSE(t_int *w) __m128 bitmask= _mm_loadu_ps((float*)l_bitmask); while (n--) { - out[0] = _mm_and_ps(in[0] , bitmask); - out[1] = _mm_and_ps(in[1] , bitmask); - out[2] = _mm_and_ps(in[2] , bitmask); - out[3] = _mm_and_ps(in[3] , bitmask); + out[0] = _mm_and_ps(in[0], bitmask); + out[1] = _mm_and_ps(in[1], bitmask); + out[2] = _mm_and_ps(in[2], bitmask); + out[3] = _mm_and_ps(in[3], bitmask); in +=4; out+=4; @@ -73,39 +73,39 @@ static t_int *sigABS_performSSE(t_int *w) * assembler */ asm( - ".section .rodata \n" - ".align 16 \n" - "2: \n" - ".long 2147483647 \n" /* bitmask */ - ".long 2147483647 \n" /* 0x7fffffff */ - ".long 2147483647 \n" - ".long 2147483647 \n" + ".section .rodata \n" + ".align 16 \n" + "2: \n" + ".long 2147483647 \n" /* bitmask */ + ".long 2147483647 \n" /* 0x7fffffff */ + ".long 2147483647 \n" + ".long 2147483647 \n" - ".text \n" + ".text \n" - "movaps (2b), %%xmm0 \n" /* xmm0 = bitmask */ - "shrl $4, %2 \n" + "movaps (2b), %%xmm0 \n" /* xmm0 = bitmask */ + "shrl $4, %2 \n" /* loop: *dest = abs(*src) */ - "1: \n" - "movaps (%0,%3), %%xmm1 \n" - "andps %%xmm0, %%xmm1 \n" - "movaps %%xmm1, (%1,%3) \n" + "1: \n" + "movaps (%0,%3), %%xmm1 \n" + "andps %%xmm0, %%xmm1 \n" + "movaps %%xmm1, (%1,%3) \n" - "movaps 16(%0,%3), %%xmm2 \n" - "andps %%xmm0, %%xmm2 \n" - "movaps %%xmm2, 16(%1,%3) \n" + "movaps 16(%0,%3), %%xmm2\n" + "andps %%xmm0, %%xmm2 \n" + "movaps %%xmm2, 16(%1,%3)\n" - "movaps 32(%0,%3), %%xmm3 \n" - "andps %%xmm0, %%xmm3 \n" - "movaps %%xmm3, 32(%1,%3) \n" + "movaps 32(%0,%3), %%xmm3\n" + "andps %%xmm0, %%xmm3 \n" + "movaps %%xmm3, 32(%1,%3)\n" - "movaps 48(%0,%3), %%xmm4 \n" - "andps %%xmm0, %%xmm4 \n" - "movaps %%xmm4, 48(%1,%3) \n" + "movaps 48(%0,%3), %%xmm4\n" + "andps %%xmm0, %%xmm4 \n" + "movaps %%xmm4, 48(%1,%3)\n" - "addl $64, %3 \n" - "loop 1b \n" + "addl $64, %3 \n" + "loop 1b \n" : :"r"(in), "r"(out), "c"(n), "r"(0) :"%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4" @@ -116,7 +116,7 @@ static t_int *sigABS_performSSE(t_int *w) } #endif /* __SSE__ */ -static void sigABS_dsp(t_abs *x, t_signal **sp) +static void sigABS_dsp(t_abs * UNUSED(x), t_signal **sp) { #ifdef __SSE__ if( @@ -150,15 +150,14 @@ static void *sigABS_new(void) return (x); } -void abs_tilde_setup(void) +ZEXY_SETUP void abs_tilde_setup(void) { - sigABS_class = class_new(gensym("abs~"), (t_newmethod)sigABS_new, 0, - sizeof(t_abs), 0, A_DEFFLOAT, 0); + sigABS_class = zexy_new("abs~", + sigABS_new, 0, t_abs, 0, ""); CLASS_MAINSIGNALIN(sigABS_class, t_abs, x_f); - class_addmethod(sigABS_class, (t_method)sigABS_dsp, gensym("dsp"), - A_CANT, 0); + zexy_addmethod(sigABS_class, (t_method)sigABS_dsp, "dsp", "!"); - class_addmethod(sigABS_class, (t_method)sigABS_helper, gensym("help"), 0); + zexy_addmethod(sigABS_class, (t_method)sigABS_helper, "help", ""); class_sethelpsymbol(sigABS_class, gensym("zigbinops")); zexy_register("abs~"); diff --git a/externals/zexy/src/acinclude.m4 b/externals/zexy/src/acinclude.m4 deleted file mode 100644 index 14b472d0c21b58fe36f484c8cab03a471616a714..0000000000000000000000000000000000000000 --- a/externals/zexy/src/acinclude.m4 +++ /dev/null @@ -1,196 +0,0 @@ -dnl Copyright (C) 2005-2006 IOhannes m zmölnig -dnl This file is free software; IOhannes m zmölnig -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -# AC_CHECK_CPPFLAGS(ADDITIONAL-CPPFLAGS, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) -# -# checks whether the $(C) compiler accepts the ADDITIONAL-CPPFLAGS -# if so, they are added to the CPPFLAGS -AC_DEFUN([AC_CHECK_CPPFLAGS], -[ - AC_MSG_CHECKING([whether $CPP accepts "$1"]) - temp_check_cppflags="${CPPFLAGS}" - CPPFLAGS="$1 ${CPPFLAGS}" - AC_PREPROC_IFELSE( - [AC_LANG_SOURCE([[int main(void){return 0;}]])], - [AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no]); CPPFLAGS="${temp_check_cppflags}"]) -])# AC_CHECK_CPPFLAGS - - - -# AC_CHECK_CFLAGS(ADDITIONAL-CFLAGS, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) -# -# checks whether the $(C) compiler accepts the ADDITIONAL-CFLAGS -# if so, they are added to the CFLAGS -AC_DEFUN([AC_CHECK_CFLAGS], -[ - AC_MSG_CHECKING([whether $CC accepts "$1"]) -cat > conftest.c << EOF -int main(){ - return 0; -} -EOF -if $CC $CFLAGS [$1] -o conftest.o conftest.c > /dev/null 2>&1 -then - AC_MSG_RESULT([yes]) - CFLAGS="${CFLAGS} [$1]" - AC_CHECK_CPPFLAGS([$1]) - [$2] -else - AC_MSG_RESULT([no]) - [$3] -fi -])# AC_CHECK_CFLAGS - -# AC_CHECK_CXXFLAGS(ADDITIONAL-CXXFLAGS, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) -# -# checks whether the $(CXX) (c++) compiler accepts the ADDITIONAL-CXXFLAGS -# if so, they are added to the CXXFLAGS -AC_DEFUN([AC_CHECK_CXXFLAGS], -[ - AC_MSG_CHECKING([whether $CXX accepts "$1"]) -cat > conftest.c++ << EOF -int main(){ - return 0; -} -EOF -if $CXX $CPPFLAGS $CXXFLAGS -o conftest.o conftest.c++ [$1] > /dev/null 2>&1 -then - AC_MSG_RESULT([yes]) - CXXFLAGS="${CXXFLAGS} [$1]" - AC_CHECK_CPPFLAGS([$1]) - [$2] -else - AC_MSG_RESULT([no]) - [$3] -fi -])# AC_CHECK_CXXFLAGS - -# AC_CHECK_FRAMEWORK(FRAMEWORK, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) -# -# -AC_DEFUN([AC_CHECK_FRAMEWORK], -[ - AC_MSG_CHECKING([for "$1"-framework]) - - temp_check_ldflags_org="${LDFLAGS}" - LDFLAGS="-framework [$1] ${LDFLAGS}" - - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [temp_check_ldflags_success="yes"],[temp_check_ldflags_success="no"]) - - if test "x$temp_check_ldflags_success" = "xyes"; then - AC_MSG_RESULT([yes]) - [$2] - else - AC_MSG_RESULT([no]) - LDFLAGS="$temp_check_ldflags_org" - [$3] - fi -])# AC_CHECK_FRAMEWORK - -# AC_CHECK_LDFLAGS(ADDITIONAL-LDFLAGS, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) -# -# checks whether the $(LD) linker accepts the ADDITIONAL-LDFLAGS -# if so, they are added to the LDFLAGS -AC_DEFUN([AC_CHECK_LDFLAGS], -[ - AC_MSG_CHECKING([whether linker accepts "$1"]) - temp_check_ldflags_org="${LDFLAGS}" - LDFLAGS="$1 ${LDFLAGS}" - - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [temp_check_ldflags_success="yes"],[temp_check_ldflags_success="no"]) - - if test "x$temp_check_ldflags_success" = "xyes"; then - AC_MSG_RESULT([yes]) - [$2] - else - AC_MSG_RESULT([no]) - LDFLAGS="$temp_check_ldflags_org" - [$3] - fi -])# AC_CHECK_LDFLAGS - - -AC_DEFUN([AC_CHECK_FAT], -[ -AC_ARG_ENABLE(fat-binary, - [ --enable-fat-binary=ARCHS - build an Apple Multi Architecture Binary (MAB); - ARCHS is a comma-delimited list of architectures for - which to build; if ARCHS is omitted, then the package - will be built for all architectures supported by the - platform (e.g. "ppc,i386" for MacOS/X and Darwin; - if this option is disabled or omitted entirely, then - the package will be built only for the target - platform], - [fat_binary=$enableval], [fat_binary=no]) -if test "$fat_binary" != no; then - AC_MSG_CHECKING([target architectures]) - - # Respect TARGET_ARCHS setting from environment if available. - if test -z "$TARGET_ARCHS"; then - # Respect ARCH given to --enable-fat-binary if present. - if test "$fat_binary" != yes; then - TARGET_ARCHS=`echo "$fat_binary" | tr ',' ' '` - else - # Choose a default set of architectures based upon platform. - TARGET_ARCHS="ppc i386" - fi - fi - AC_MSG_RESULT([$TARGET_ARCHS]) - - define([Name],[translit([$1],[./-], [___])]) - # /usr/lib/arch_tool -archify_list $TARGET_ARCHS - []Name="" - for archs in $TARGET_ARCHS - do - []Name="$[]Name -arch $archs" - done - - if test "x$[]Name" != "x"; then - AC_CHECK_CFLAGS($[]Name,,[]Name="") - fi - - if test "x$[]Name" != "x"; then - AC_CHECK_LDFLAGS($[]Name,,[]Name="") - fi - - undefine([Name]) -fi -])# AC_CHECK_FAT - -AC_DEFUN([AC_CHECK_SIMD], -[ -AC_ARG_ENABLE(simd, - [ --enable-simd=ARCHS - enable SIMD optimization; - valid arguments are: SSE2 - ], - [simd=$enableval], [simd=no]) -if test "$simd" != no; then - AC_MSG_CHECKING([SIMD optimization]) - - # Respect SIMD given to --enable-simd if present. - if test "$simd" != yes; then - SIMD=`echo "$simd" | tr ',' ' '` - else - # Choose a default set of architectures based upon platform. - SIMD="SSE2" - fi - AC_MSG_RESULT([$SIMD]) - - for smd in $SIMD - do - case "${smd}" in - SSE2|sse2) - AC_CHECK_CFLAGS([-mfpmath=sse -msse]) - ;; - *) - AC_MSG_RESULT([unknown SIMD instructions: ${smd}]) - ;; - esac - done -fi -])# AC_CHECK_SIMD diff --git a/externals/zexy/src/astyle.rc b/externals/zexy/src/astyle.rc index 0c0c1bc38203b445d70a78c789f5c3dd4157ce0a..1780cc82ebab60706ab208713383fe956cb2d6e7 100644 --- a/externals/zexy/src/astyle.rc +++ b/externals/zexy/src/astyle.rc @@ -1,5 +1,5 @@ ## asytyle configuration for zexy -# usage: astyle --options=astyle.conf *.c *.h +# usage: astyle --options=astyle.rc *.c *.h ## CRLF line-ending lineend=linux diff --git a/externals/zexy/src/atof.c b/externals/zexy/src/atof.c index 8311d8333640870a8671370ce276df51207ab58a..ac113e923ba1197f925fca4b57856727c9074897 100644 --- a/externals/zexy/src/atof.c +++ b/externals/zexy/src/atof.c @@ -21,7 +21,7 @@ #include <stdlib.h> #include <string.h> -static t_class *atof_class; +static t_class *atof_class=NULL; typedef struct _atof { t_object x_obj; @@ -77,11 +77,10 @@ static void *atof_new(void) return (x); } -void atof_setup(void) +ZEXY_SETUP void atof_setup(void) { - atof_class = class_new(gensym("atof"), (t_newmethod)atof_new, - (t_method)atof_free, - sizeof(t_atof), 0, A_DEFFLOAT, 0); + atof_class = zexy_new("atof", + atof_new, atof_free, t_atof, 0, ""); class_addbang(atof_class, (t_method)atof_bang); class_addfloat(atof_class, (t_method)atof_float); diff --git a/externals/zexy/src/atoi.c b/externals/zexy/src/atoi.c index 17e6b99fa1039d01039756f6f833ebec7a750bbf..6557b5d918ae8db3cc5c28953f4facf0b9987e98 100644 --- a/externals/zexy/src/atoi.c +++ b/externals/zexy/src/atoi.c @@ -21,7 +21,7 @@ #include <stdlib.h> #include <string.h> -static t_class *atoi_class; +static t_class *atoi_class=NULL; typedef struct _atoi { t_object x_obj; @@ -95,11 +95,10 @@ static void *atoi_new(void) return (x); } -void atoi_setup(void) +ZEXY_SETUP void atoi_setup(void) { - atoi_class = class_new(gensym("atoi"), (t_newmethod)atoi_new, - (t_method)atoi_free, - sizeof(t_atoi), 0, A_DEFFLOAT, 0); + atoi_class = zexy_new("atoi", + atoi_new, atoi_free, t_atoi, 0, ""); class_addbang(atoi_class, (t_method)atoi_bang); class_addfloat(atoi_class, (t_method)atoi_float); diff --git a/externals/zexy/src/avg~.c b/externals/zexy/src/avg~.c index 669879ca4817d67ae0f8a8d4a60258d4f67ceada..8e028eaffafeb08569327bf59fb9802e2305718c 100644 --- a/externals/zexy/src/avg~.c +++ b/externals/zexy/src/avg~.c @@ -23,7 +23,7 @@ /* tilde object to take absolute value. */ -static t_class *avg_class; +static t_class *avg_class=NULL; typedef struct _avg { t_object x_obj; @@ -71,14 +71,13 @@ static void avg_help(void) } -void avg_tilde_setup(void) +ZEXY_SETUP void avg_tilde_setup(void) { - avg_class = class_new(gensym("avg~"), (t_newmethod)avg_new, 0, - sizeof(t_avg), 0, A_DEFFLOAT, 0); - class_addmethod(avg_class, nullfn, gensym("signal"), 0); - class_addmethod(avg_class, (t_method)avg_dsp, gensym("dsp"), - A_CANT, 0); + avg_class = zexy_new("avg~", + avg_new, 0, t_avg, 0, ""); + zexy_addmethod(avg_class, (t_method)nullfn, "signal", ""); + zexy_addmethod(avg_class, (t_method)avg_dsp, "dsp", "!"); - class_addmethod(avg_class, (t_method)avg_help, gensym("help"), 0); + zexy_addmethod(avg_class, (t_method)avg_help, "help", ""); zexy_register("avg~"); } diff --git a/externals/zexy/src/blockmirror~.c b/externals/zexy/src/blockmirror~.c index 2ad4092cdbb0542267043d139108e1cbd4c1599d..cd42a5a78ea93f68ab28acc0bdd358a31a70df0c 100644 --- a/externals/zexy/src/blockmirror~.c +++ b/externals/zexy/src/blockmirror~.c @@ -26,7 +26,7 @@ {x[0], x[1], ... x[n-1]} --> {x[n-1], x[n-2], ... x[0]} */ -static t_class *blockmirror_class; +static t_class *blockmirror_class=NULL; typedef struct _blockmirror { t_object x_obj; @@ -42,7 +42,7 @@ static void blockmirror_float(t_blockmirror *x, t_floatarg f) static t_int *blockmirror_perform(t_int *w) { - t_blockmirror *x = (t_blockmirror *)(w[1]); + t_blockmirror *x = (t_blockmirror *)(w[1]); t_sample *in = (t_sample *)(w[2]); t_sample *out = (t_sample *)(w[3]); int n = (int)(w[4]); @@ -81,7 +81,7 @@ static void blockmirror_dsp(t_blockmirror *x, t_signal **sp) dsp_add(blockmirror_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, (t_int)sp[0]->s_n); } -static void blockmirror_helper(t_blockmirror*x) +static void blockmirror_helper(t_blockmirror* UNUSED(x)) { post("\n"HEARTSYMBOL " blockmirror~-object for reverting a signal"); post("'help' : view this\n" @@ -104,19 +104,16 @@ static void *blockmirror_new(void) return (x); } -void blockmirror_tilde_setup(void) +ZEXY_SETUP void blockmirror_tilde_setup(void) { - blockmirror_class = class_new(gensym("blockmirror~"), - (t_newmethod)blockmirror_new, - (t_method)blockmirror_free, - sizeof(t_blockmirror), 0, A_NULL); - class_addmethod(blockmirror_class, nullfn, gensym("signal"), 0); - class_addmethod(blockmirror_class, (t_method)blockmirror_dsp, - gensym("dsp"), A_CANT, 0); + blockmirror_class = zexy_new("blockmirror~", + blockmirror_new, blockmirror_free, t_blockmirror, 0, ""); + zexy_addmethod(blockmirror_class, (t_method)nullfn, "signal", ""); + zexy_addmethod(blockmirror_class, (t_method)blockmirror_dsp, "dsp", "!"); class_addfloat(blockmirror_class, blockmirror_float); - class_addmethod(blockmirror_class, (t_method)blockmirror_helper, - gensym("help"), 0); + zexy_addmethod(blockmirror_class, (t_method)blockmirror_helper, "help", + ""); zexy_register("blockmirror~"); } diff --git a/externals/zexy/src/blockshuffle~.c b/externals/zexy/src/blockshuffle~.c index de9b24fc9af6d34efdd0c9efa745a73189e1054a..1c874dd4d358d9db6c4708a4c59ea07e42e652a9 100644 --- a/externals/zexy/src/blockshuffle~.c +++ b/externals/zexy/src/blockshuffle~.c @@ -26,7 +26,7 @@ {x[0], x[1], ... x[n-1]} --> {x[n-1], x[n-2], ... x[0]} */ -static t_class *blockshuffle_class; +static t_class *blockshuffle_class=NULL; typedef struct _blockshuffle { t_object x_obj; @@ -68,8 +68,8 @@ static void blockshuffle_buildindex(t_blockshuffle *x, int blocksize) } } -static void blockshuffle_list(t_blockshuffle *x, t_symbol*s, int argc, - t_atom*argv) +static void blockshuffle_list(t_blockshuffle *x, t_symbol* UNUSED(s), + int argc, t_atom*argv) { int i; if(x->shuffle) { @@ -91,11 +91,11 @@ static t_int *blockshuffle_perform(t_int *w) t_sample *in = (t_sample *)(w[2]); t_sample *out = (t_sample *)(w[3]); int n = (int)(w[4]); - int i=0; t_sample *temp=x->blockbuf; t_int *idx =x->indices; if(idx) { + int i=0; for(i=0; i<n; i++) { temp[i]=in[idx[i]]; } @@ -119,9 +119,10 @@ static void blockshuffle_dsp(t_blockshuffle *x, t_signal **sp) (t_int)sp[0]->s_n); } -static void blockshuffle_helper(void) +static void blockshuffle_helper(t_blockshuffle* UNUSED(x)) { - post("\n"HEARTSYMBOL " blockshuffle~-object for shuffling the samples within a signal-block"); + post("\n"HEARTSYMBOL + " blockshuffle~-object for shuffling the samples within a signal-block"); post("'help' : view this\n" "signal~"); post("outlet : signal~"); @@ -151,19 +152,16 @@ static void *blockshuffle_new(void) return (x); } -void blockshuffle_tilde_setup(void) +ZEXY_SETUP void blockshuffle_tilde_setup(void) { - blockshuffle_class = class_new(gensym("blockshuffle~"), - (t_newmethod)blockshuffle_new, - (t_method)blockshuffle_free, - sizeof(t_blockshuffle), 0, A_NULL); - class_addmethod(blockshuffle_class, nullfn, gensym("signal"), 0); - class_addmethod(blockshuffle_class, (t_method)blockshuffle_dsp, - gensym("dsp"), A_CANT, 0); + blockshuffle_class = zexy_new("blockshuffle~", + blockshuffle_new, blockshuffle_free, t_blockshuffle, 0, ""); + zexy_addmethod(blockshuffle_class, (t_method)nullfn, "signal", ""); + zexy_addmethod(blockshuffle_class, (t_method)blockshuffle_dsp, "dsp", "!"); class_addlist(blockshuffle_class, blockshuffle_list); - class_addmethod(blockshuffle_class, (t_method)blockshuffle_helper, - gensym("help"), 0); + zexy_addmethod(blockshuffle_class, (t_method)blockshuffle_helper, "help", + ""); zexy_register("blockshuffle~"); } diff --git a/externals/zexy/src/blockswap~.c b/externals/zexy/src/blockswap~.c index 15785850f36a879d061990f6ff32634f324b964c..2bdeed2487106ec419477a86a2c72b1ffc85d8a7 100644 --- a/externals/zexy/src/blockswap~.c +++ b/externals/zexy/src/blockswap~.c @@ -25,7 +25,7 @@ {x[0], x[1], ... x[n-1]} --> {x[n-1], x[n-2], ... x[0]} */ -static t_class *blockswap_class; +static t_class *blockswap_class=NULL; typedef struct _blockswap { t_object x_obj; @@ -41,7 +41,7 @@ static void blockswap_float(t_blockswap *x, t_floatarg f) static t_int *blockswap_perform(t_int *w) { - t_blockswap *x = (t_blockswap *)(w[1]); + t_blockswap *x = (t_blockswap *)(w[1]); t_sample *in = (t_sample *)(w[2]); t_sample *out = (t_sample *)(w[3]); int N = (int)(w[4]); @@ -79,9 +79,10 @@ static void blockswap_dsp(t_blockswap *x, t_signal **sp) dsp_add(blockswap_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, (t_int)sp[0]->s_n); } -static void blockswap_helper(t_blockswap *x) +static void blockswap_helper(t_blockswap* UNUSED(x)) { - post("\n"HEARTSYMBOL " blockswap~-object for blockwise-swapping of a signal "); + post("\n"HEARTSYMBOL + " blockswap~-object for blockwise-swapping of a signal "); post("'help' : view this\n" "signal~"); post("outlet : signal~"); @@ -104,18 +105,15 @@ static void *blockswap_new(void) return (x); } -void blockswap_tilde_setup(void) +ZEXY_SETUP void blockswap_tilde_setup(void) { - blockswap_class = class_new(gensym("blockswap~"), - (t_newmethod)blockswap_new, (t_method)blockswap_free, - sizeof(t_blockswap), 0, A_NULL); - class_addmethod(blockswap_class, nullfn, gensym("signal"), 0); - class_addmethod(blockswap_class, (t_method)blockswap_dsp, gensym("dsp"), - A_CANT, 0); + blockswap_class = zexy_new("blockswap~", + blockswap_new, blockswap_free, t_blockswap, 0, ""); + zexy_addmethod(blockswap_class, (t_method)nullfn, "signal", ""); + zexy_addmethod(blockswap_class, (t_method)blockswap_dsp, "dsp", "!"); class_addfloat(blockswap_class, blockswap_float); - class_addmethod(blockswap_class, (t_method)blockswap_helper, - gensym("help"), 0); + zexy_addmethod(blockswap_class, (t_method)blockswap_helper, "help", ""); zexy_register("blockswap~"); } diff --git a/externals/zexy/src/configure b/externals/zexy/src/configure deleted file mode 100755 index 5fe20527196ff72e2bb3a9f74b43eb53cc8ae1fb..0000000000000000000000000000000000000000 --- a/externals/zexy/src/configure +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -TOPDIR=.. - -echo "dummy configure... starting at top: ${TOPDIR}/" - -cd ${TOPDIR}/ - - -./configure $@ diff --git a/externals/zexy/src/date.c b/externals/zexy/src/date.c index a749d57176247ddd6bdfe7e6c8e3891ffd94726f..1e9f26b6d4e0e7cabe6e4552f1f0ba31e6464667 100644 --- a/externals/zexy/src/date.c +++ b/externals/zexy/src/date.c @@ -40,10 +40,15 @@ #include "zexy.h" -#ifdef __WIN32__ -# define USE_TIMEB +#if (defined __WIN32__) +# if (defined __i386__) && (defined __MINGW32__) +/* unless compiling under mingw/32bit, we want USE_TIMEB in redmond-land */ +# else +# define USE_TIMEB +# endif #endif + #ifdef __APPLE__ # include <sys/types.h> /* typedef _BSD_TIME_T_ time_t; */ @@ -61,7 +66,7 @@ /* ----------------------- date --------------------- */ -static t_class *date_class; +static t_class *date_class=NULL; typedef struct _date { t_object x_obj; @@ -79,10 +84,10 @@ typedef struct _date { static void *date_new(t_symbol* UNUSED(s), int argc, t_atom *argv) { t_date *x = (t_date *)pd_new(date_class); - char buf[5]; x->GMT=0; if (argc) { + char buf[5]; atom_string(argv, buf, 5); if (buf[0]=='G' && buf[1]=='M' && buf[2]=='T') { x->GMT = 1; @@ -126,14 +131,13 @@ static void help_date(t_date* UNUSED(x)) post("\ncreation\t::'date [GMT]': show local date or GMT"); } -void date_setup(void) +ZEXY_SETUP void date_setup(void) { - date_class = class_new(gensym("date"), - (t_newmethod)date_new, 0, - sizeof(t_date), 0, A_GIMME, 0); + date_class = zexy_new("date", + date_new, 0, t_date, 0, "*"); class_addbang(date_class, date_bang); - class_addmethod(date_class, (t_method)help_date, gensym("help"), 0); + zexy_addmethod(date_class, (t_method)help_date, "help", ""); zexy_register("date"); } diff --git a/externals/zexy/src/demultiplex.c b/externals/zexy/src/demultiplex.c index ea6cd4a81bdb516fab38b489a7da2ed74b0692ce..ccf341b86ff7b54129990eaf488138e5c0231083 100644 --- a/externals/zexy/src/demultiplex.c +++ b/externals/zexy/src/demultiplex.c @@ -26,7 +26,7 @@ a demultiplexer */ -static t_class *demux_class; +static t_class *demux_class=NULL; typedef struct _demux { t_object x_obj; @@ -34,17 +34,19 @@ typedef struct _demux { int n_out; t_outlet **out, *selected; - + t_float findex; } t_demux; -static void demux_select(t_demux *x, t_float f) +static void demux_select(t_demux *x) { + t_float f = x->findex; int n = ( (f<0) || (f>x->n_out) ) ? 0 : f; x->selected = x->out[n]; } static void demux_list(t_demux *x, t_symbol *s, int argc, t_atom *argv) { + demux_select(x); switch (argc) { case 0: outlet_bang(x->selected); @@ -70,6 +72,7 @@ static void demux_list(t_demux *x, t_symbol *s, int argc, t_atom *argv) } static void demux_any(t_demux *x, t_symbol *s, int argc, t_atom *argv) { + demux_select(x); outlet_anything(x->selected, s, argc, argv); } @@ -80,7 +83,8 @@ static void *demux_new(t_symbol* UNUSED(s), int argc, t_atom* UNUSED(argv)) x->n_out = n - 1; - inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("select")); + x->findex = 0; + floatinlet_new(&x->x_obj, &x->findex); x->out = (t_outlet **)getbytes(n * sizeof(t_outlet *)); for (n=0; n<=x->n_out; n++) { @@ -91,23 +95,25 @@ static void *demux_new(t_symbol* UNUSED(s), int argc, t_atom* UNUSED(argv)) return (x); } - -void demultiplex_setup(void) +static t_class* zclass_setup(const char*name) +{ + t_class*c = zexy_new(name, + demux_new, 0, t_demux, 0, "*"); + class_addanything (c, demux_any); + class_addlist (c, demux_list); + return c; +} +static void dosetup() { - demux_class = class_new(gensym("demultiplex"), (t_newmethod)demux_new, - 0, sizeof(t_demux), 0, A_GIMME, 0); - class_addcreator((t_newmethod)demux_new, gensym("demux"), A_GIMME, 0); - - class_addanything (demux_class, demux_any); - class_addlist (demux_class, demux_list); - - class_addmethod (demux_class, (t_method)demux_select, gensym("select"), - A_DEFFLOAT, 0); - zexy_register("demultiplex"); + demux_class=zclass_setup("demultiplex"); + zclass_setup("demux"); +} +ZEXY_SETUP void demultiplex_setup(void) +{ + dosetup(); } void demux_setup(void) { - demultiplex_setup(); + dosetup(); } - diff --git a/externals/zexy/src/demultiplex~.c b/externals/zexy/src/demultiplex~.c index 4fb7e7876337a459a9c27273feea2e40cde7a5df..c68b1d72b8be60f39564995696aa931efcb43e31 100644 --- a/externals/zexy/src/demultiplex~.c +++ b/externals/zexy/src/demultiplex~.c @@ -19,7 +19,7 @@ #include "zexy.h" -static t_class *demux_class; +static t_class *demux_tilde_class=NULL; typedef struct _demux { t_object x_obj; @@ -79,7 +79,8 @@ static void demux_dsp(t_demux *x, t_signal **sp) static void demux_helper(void) { - post("\n"HEARTSYMBOL " demux~\t:: demultiplex a signal to one of various outlets"); + post("\n"HEARTSYMBOL + " demux~\t:: demultiplex a signal to one of various outlets"); post("<#out>\t : the outlet-number (counting from 0) to witch the inlet is routed" "'help'\t : view this"); post("creation : \"demux~ [arg1 [arg2...]]\"\t: the number of arguments equals the number of outlets\n"); @@ -92,7 +93,7 @@ static void demux_free(t_demux *x) static void *demux_new(t_symbol* UNUSED(s), int argc, t_atom* UNUSED(argv)) { - t_demux *x = (t_demux *)pd_new(demux_class); + t_demux *x = (t_demux *)pd_new(demux_tilde_class); int i; if (!argc) { @@ -113,26 +114,28 @@ static void *demux_new(t_symbol* UNUSED(s), int argc, t_atom* UNUSED(argv)) return (x); } - -void demultiplex_tilde_setup(void) +static t_class* zclass_setup(const char*name) +{ + t_class *c = zexy_new(name, + demux_new, demux_free, t_demux, 0, "*"); + class_addfloat(c, demux_output); + zexy_addmethod(c, (t_method)demux_dsp, "dsp", "!"); + zexy_addmethod(c, (t_method)nullfn, "signal", ""); + + zexy_addmethod(c, (t_method)demux_helper, "help", ""); + return c; +} +static void dosetup() { - demux_class = class_new(gensym("demultiplex~"), (t_newmethod)demux_new, - (t_method)demux_free, sizeof(t_demux), 0, A_GIMME, 0); - class_addcreator((t_newmethod)demux_new, gensym("demux~"), A_GIMME, 0); - - class_addfloat(demux_class, demux_output); - class_addmethod(demux_class, (t_method)demux_dsp, gensym("dsp"), - A_CANT, 0); - class_addmethod(demux_class, nullfn, gensym("signal"), 0); - - class_addmethod(demux_class, (t_method)demux_helper, gensym("help"), 0); - zexy_register("demultiplex~"); + demux_tilde_class=zclass_setup("demultiplex~"); + zclass_setup("demux~"); +} +ZEXY_SETUP void demultiplex_tilde_setup(void) +{ + dosetup(); } void demux_tilde_setup(void) { - demultiplex_tilde_setup(); + dosetup(); } - - - diff --git a/externals/zexy/src/dfreq~.c b/externals/zexy/src/dfreq~.c index 2ad7715751fa40bfb83073b60e2bca91f743c0f6..277c40e8cc0a0bea735a68a251d8175338f353fd 100644 --- a/externals/zexy/src/dfreq~.c +++ b/externals/zexy/src/dfreq~.c @@ -26,7 +26,7 @@ /* datendefinition */ -static t_class *dfreq_class; +static t_class *dfreq_class=NULL; typedef struct _dfreq { t_object x_obj; @@ -99,21 +99,20 @@ static void *dfreq_new(void) static void dfreq_tilde_helper(void) { - post("\n"HEARTSYMBOL " dfreq~\t :: pitch-detector that counts zero-crossings"); + post("\n"HEARTSYMBOL + " dfreq~\t :: pitch-detector that counts zero-crossings"); post("\noutputs a frequency estimate as a stream~ that will be updated every zero-X"); post("\ncreation::\t'dfreq~': that's all"); } -void dfreq_tilde_setup(void) +ZEXY_SETUP void dfreq_tilde_setup(void) { - dfreq_class = class_new(gensym("dfreq~"), (t_newmethod)dfreq_new, 0, - sizeof(t_dfreq), 0, A_NULL); - class_addmethod(dfreq_class, nullfn, gensym("signal"), 0); - class_addmethod(dfreq_class, (t_method)dfreq_dsp, gensym("dsp"), - A_CANT, 0); - - class_addmethod(dfreq_class, (t_method)dfreq_tilde_helper, gensym("help"), - 0); + dfreq_class = zexy_new("dfreq~", + dfreq_new, 0, t_dfreq, 0, ""); + zexy_addmethod(dfreq_class, (t_method)nullfn, "signal", ""); + zexy_addmethod(dfreq_class, (t_method)dfreq_dsp, "dsp", "!"); + + zexy_addmethod(dfreq_class, (t_method)dfreq_tilde_helper, "help", ""); zexy_register("dfreq~"); } diff --git a/externals/zexy/src/dirac~.c b/externals/zexy/src/dirac~.c index 027fee5539284af8472b3db088eefcabc22e9fd5..a4db2e62e3c1bf673b72234d71a40a0fd5a3961e 100644 --- a/externals/zexy/src/dirac~.c +++ b/externals/zexy/src/dirac~.c @@ -24,12 +24,12 @@ /* * This external makes the two main test-functions available : * dirac~: will make a single peak (eg: a 1 in all the 0s) at - * a desired position in the signal-vector - * the position can be passed as an argument when creating the object + * a desired position in the signal-vector + * the position can be passed as an argument when creating the object * * NOTE : the inlets do NOT specify any times but sample-NUMBERS; - * there are 64 samples in a "standard" signal-vector, - * each "lasting" for 1/44100 secs. + * there are 64 samples in a "standard" signal-vector, + * each "lasting" for 1/44100 secs. */ #include "zexy.h" @@ -37,7 +37,7 @@ /* ------------------------ dirac~ ----------------------------- */ -static t_class *dirac_class; +static t_class *dirac_class=NULL; typedef struct _dirac { t_object x_obj; @@ -76,8 +76,8 @@ static t_int *dirac_perform(t_int *w) } #ifndef __WIN32__ -/* LATER: investigate the occurence of zero_perf8() */ -/* it seems, like pd has the symbol zero_perf8(), +/* LATER: investigate the occurrence of zero_perf8() */ +/* it seems, like Pd has the symbol zero_perf8(), * but it is not exported by m_pd.h: * so linux can use it, but w32 not * have to tell miller about that @@ -145,15 +145,14 @@ static void *dirac_new(t_floatarg where) return (x); } -void dirac_tilde_setup(void) +ZEXY_SETUP void dirac_tilde_setup(void) { - dirac_class = class_new(gensym("dirac~"), (t_newmethod)dirac_new, 0, - sizeof(t_dirac), 0, A_DEFFLOAT, 0); + dirac_class = zexy_new("dirac~", + dirac_new, 0, t_dirac, 0, "F"); class_addfloat(dirac_class, dirac_float); class_addbang(dirac_class, dirac_bang); - class_addmethod(dirac_class, (t_method)dirac_dsp, gensym("dsp"), - A_CANT, 0); + zexy_addmethod(dirac_class, (t_method)dirac_dsp, "dsp", "!"); - class_addmethod(dirac_class, (t_method)dirac_helper, gensym("help"), 0); + zexy_addmethod(dirac_class, (t_method)dirac_helper, "help", ""); zexy_register("dirac~"); } diff --git a/externals/zexy/src/doublepole~.c b/externals/zexy/src/doublepole~.c index 650c8a5313f7c3adf4f3d505483465ac57b82a51..13299ed543a909af7a5c0cd2f2f33c5003d9950a 100644 --- a/externals/zexy/src/doublepole~.c +++ b/externals/zexy/src/doublepole~.c @@ -4,7 +4,7 @@ /* "filters", both linear and nonlinear. */ -#include "m_pd.h" +#include "zexy.h" #include <math.h> //* ---------------- doublepole~ - raw doublepole filter ----------------- */ @@ -64,8 +64,8 @@ static t_int *sigdoublepole_perform(t_int *w) return (w+5); } -static void sigdoublepole_list(t_sigdoublepole *x, t_symbol *s, int argc, - t_atom *argv) +static void sigdoublepole_list(t_sigdoublepole *x, t_symbol* UNUSED(s), + int argc, t_atom *argv) { t_float fb1 = atom_getfloatarg(0, argc, argv); t_float fb2 = atom_getfloatarg(1, argc, argv); @@ -93,8 +93,8 @@ stable: c->c_fb2 = fb2; } -static void sigdoublepole_set(t_sigdoublepole *x, t_symbol *s, int argc, - t_atom *argv) +static void sigdoublepole_set(t_sigdoublepole *x, t_symbol* UNUSED(s), + int argc, t_atom *argv) { t_doublepolectl *c = x->x_ctl; c->c_x1 = atom_getfloatarg(0, argc, argv); @@ -109,19 +109,17 @@ static void sigdoublepole_dsp(t_sigdoublepole *x, t_signal **sp) } -void doublepole_tilde_setup(void) +ZEXY_SETUP void doublepole_tilde_setup(void) { - sigdoublepole_class = class_new(gensym("doublepole~"), - (t_newmethod)sigdoublepole_new, - 0, sizeof(t_sigdoublepole), 0, A_GIMME, 0); + sigdoublepole_class = zexy_new("doublepole~", + sigdoublepole_new, 0, t_sigdoublepole, 0, "*"); CLASS_MAINSIGNALIN(sigdoublepole_class, t_sigdoublepole, x_f); - class_addmethod(sigdoublepole_class, (t_method)sigdoublepole_dsp, - gensym("dsp"), A_CANT, 0); + zexy_addmethod(sigdoublepole_class, (t_method)sigdoublepole_dsp, "dsp", + "!"); class_addlist(sigdoublepole_class, sigdoublepole_list); - class_addmethod(sigdoublepole_class, (t_method)sigdoublepole_set, - gensym("set"), - A_GIMME, 0); - class_addmethod(sigdoublepole_class, (t_method)sigdoublepole_set, - gensym("clear"), - A_GIMME, 0); + zexy_addmethod(sigdoublepole_class, (t_method)sigdoublepole_set, "set", + "*"); + zexy_addmethod(sigdoublepole_class, (t_method)sigdoublepole_set, "clear", + "*"); + zexy_register("doublepole~"); } diff --git a/externals/zexy/src/drip.c b/externals/zexy/src/drip.c index 59e504cb6361f3f291491c33ecfbfb1af7b4e58d..cf0ab921f876154efc8c77d6bd4eac7c8781fb8b 100644 --- a/externals/zexy/src/drip.c +++ b/externals/zexy/src/drip.c @@ -28,7 +28,7 @@ you can adjust the drop-speed in [ms] #include "zexy.h" -static t_class *drip_class; +static t_class *drip_class=NULL; typedef struct _drip { t_object x_obj; @@ -197,13 +197,10 @@ static void *drip_new(t_symbol* UNUSED(s), int argc, t_atom *argv) return (x); } -void drip_setup(void) +ZEXY_SETUP void drip_setup(void) { - drip_class = class_new(gensym("drip"), (t_newmethod)drip_new, - (t_method)drip_free, sizeof(t_drip), 0 ,A_GIMME, 0); - - class_addcreator((t_newmethod)drip_new, gensym("unfold"), A_GIMME, 0); - /* for historical reasons */ + drip_class = zexy_new("drip", + drip_new, drip_free, t_drip, 0, "*"); class_addbang (drip_class, drip_bang); class_addlist (drip_class, drip_list); diff --git a/externals/zexy/src/envrms~.c b/externals/zexy/src/envrms~.c index b074414c8f95b3b12690f5f82ea55889e2606256..2cdfc34e758e1e6900a33bbb7dde533651485e23 100644 --- a/externals/zexy/src/envrms~.c +++ b/externals/zexy/src/envrms~.c @@ -26,19 +26,19 @@ #define MAXOVERLAP 10 #define MAXVSTAKEN 64 -t_class *sigenvrms_class; +t_class *sigenvrms_class=NULL; typedef struct sigenvrms { - t_object x_obj; /* header */ - void *x_outlet; /* a "float" outlet */ - void *x_clock; /* a "clock" object */ - t_sample *x_buf; /* a Hanning window */ - int x_phase; /* number of points since last output */ - int x_period; /* requested period of output */ - int x_realperiod; /* period rounded up to vecsize multiple */ - int x_npoints; /* analysis window size in samples */ - t_float x_result; /* result to output */ - t_sample x_sumbuf[MAXOVERLAP]; /* summing buffer */ + t_object x_obj; /* header */ + void *x_outlet; /* a "float" outlet */ + void *x_clock; /* a "clock" object */ + t_sample *x_buf; /* a Hanning window */ + int x_phase; /* number of points since last output */ + int x_period; /* requested period of output */ + int x_realperiod; /* period rounded up to vecsize multiple */ + int x_npoints; /* analysis window size in samples */ + t_float x_result; /* result to output */ + t_sample x_sumbuf[MAXOVERLAP]; /* summing buffer */ } t_sigenvrms; static void sigenvrms_tick(t_sigenvrms *x); @@ -132,13 +132,14 @@ static void sigenvrms_dsp(t_sigenvrms *x, t_signal **sp) } } -static void sigenvrms_tick(t_sigenvrms - *x) /* callback function for the clock */ +/* callback function for the clock */ +static void sigenvrms_tick(t_sigenvrms *x) { outlet_float(x->x_outlet, sqrtf(x->x_result)); } -static void sigenvrms_ff(t_sigenvrms *x) /* cleanup on free */ +/* cleanup on free */ +static void sigenvrms_ff(t_sigenvrms *x) { clock_free(x->x_clock); freebytes(x->x_buf, (x->x_npoints + MAXVSTAKEN) * sizeof(*x->x_buf)); @@ -150,15 +151,13 @@ static void sigenvrms_help(void) } -void envrms_tilde_setup(void) +ZEXY_SETUP void envrms_tilde_setup(void) { - sigenvrms_class = class_new(gensym("envrms~"), (t_newmethod)sigenvrms_new, - (t_method)sigenvrms_ff, sizeof(t_sigenvrms), 0, A_DEFFLOAT, A_DEFFLOAT, 0); - class_addmethod(sigenvrms_class, nullfn, gensym("signal"), 0); - class_addmethod(sigenvrms_class, (t_method)sigenvrms_dsp, gensym("dsp"), - A_CANT, 0); - - class_addmethod(sigenvrms_class, (t_method)sigenvrms_help, gensym("help"), - 0); + sigenvrms_class = zexy_new("envrms~", + sigenvrms_new, sigenvrms_ff, t_sigenvrms, 0, "FF"); + zexy_addmethod(sigenvrms_class, (t_method)nullfn, "signal", ""); + zexy_addmethod(sigenvrms_class, (t_method)sigenvrms_dsp, "dsp", "!"); + + zexy_addmethod(sigenvrms_class, (t_method)sigenvrms_help, "help", ""); zexy_register("envrms~"); } diff --git a/externals/zexy/src/fifop.c b/externals/zexy/src/fifop.c index 36b9b760d3a1706d2e1c01536a88f0033a4fef76..d5c39c0ebfb1096bec767a3a31357afcd648900e 100644 --- a/externals/zexy/src/fifop.c +++ b/externals/zexy/src/fifop.c @@ -31,7 +31,7 @@ * high priority means low numeric value */ -static t_class *fifop_class; +static t_class *fifop_class=NULL; typedef struct _fifop_list { int argc; @@ -103,7 +103,6 @@ static t_fifop_prioritylist*fifop_genprioritylist(t_fifop*x, static int add2fifo(t_fifop_prioritylist*fifoprio, int argc, t_atom *argv) { - t_fifop_list*fifo=0; t_fifop_list*entry=0; if(fifoprio==0) { @@ -127,7 +126,7 @@ static int add2fifo(t_fifop_prioritylist*fifoprio, int argc, t_atom *argv) /* insert entry into fifo */ if(fifoprio->fifo_end) { /* append to the end of the fifo */ - fifo=fifoprio->fifo_end; + t_fifop_list*fifo=fifoprio->fifo_end; /* add new entry to end of fifo */ fifo->next=entry; @@ -205,7 +204,7 @@ static void fifop_bang(t_fifop *x) } static void fifop_query(t_fifop*x) { - z_verbose(1, "%d elements in fifo", (int)x->counter); + verbose(1, "%d elements in fifo", (int)x->counter); outlet_float(x->x_infout, (t_float)x->counter); } @@ -265,9 +264,10 @@ static void fifop_dump(t_fifop*x) } } -static void fifop_help(t_fifop*x) +static void fifop_help(t_fifop* UNUSED(x)) { - post("\n"HEARTSYMBOL " fifop\t\t:: a First-In-First-Out queue with priorities"); + post("\n"HEARTSYMBOL + " fifop\t\t:: a First-In-First-Out queue with priorities"); } @@ -293,23 +293,19 @@ static void *fifop_new(void) return (x); } -void fifop_setup(void) +ZEXY_SETUP void fifop_setup(void) { - fifop_class = class_new(gensym("fifop"), (t_newmethod)fifop_new, - (t_method)fifop_free, sizeof(t_fifop), 0, A_NULL); + fifop_class = zexy_new("fifop", + fifop_new, fifop_free, t_fifop, 0, ""); class_addbang (fifop_class, fifop_bang); class_addlist (fifop_class, fifop_list); - class_addmethod (fifop_class, (t_method)fifop_clear, gensym("clear"), - A_NULL); - class_addmethod (fifop_class, (t_method)fifop_dump, gensym("dump"), - A_NULL); + zexy_addmethod(fifop_class, (t_method)fifop_clear, "clear", ""); + zexy_addmethod(fifop_class, (t_method)fifop_dump, "dump", ""); - class_addmethod (fifop_class, (t_method)fifop_query, gensym("info"), - A_NULL); - class_addmethod (fifop_class, (t_method)fifop_help, gensym("help"), - A_NULL); + zexy_addmethod(fifop_class, (t_method)fifop_query, "info", ""); + zexy_addmethod(fifop_class, (t_method)fifop_help, "help", ""); zexy_register("fifop"); } diff --git a/externals/zexy/src/freadln.c b/externals/zexy/src/freadln.c index af911142a18fb9098e62dcf85e1c27384c304b36..033a39e30893146a8d44dcfcab1f863d6b6c99b8 100644 --- a/externals/zexy/src/freadln.c +++ b/externals/zexy/src/freadln.c @@ -42,14 +42,14 @@ * into the RAM of your system */ -static t_class *freadln_class; +static t_class *freadln_class=NULL; typedef struct freadln { t_object x_ob; FILE *x_file; char *x_filename; char *x_textbuf; - int x_textbuf_length; + size_t x_textbuf_length; t_outlet *x_message_outlet; t_outlet *x_readybang_outlet; @@ -62,7 +62,7 @@ typedef struct freadln { static void freadln_close (t_freadln *x) { if(x->x_file) { - z_fclose(x->x_file); + sys_fclose(x->x_file); } x->x_file=0; if(x->x_filename) { @@ -79,7 +79,7 @@ static void freadln_close (t_freadln *x) static void freadln_open (t_freadln *x, t_symbol *s, t_symbol*type) { char filenamebuf[MAXPDSTRING], *filenamebufptr; - char*dirname=canvas_getdir(x->x_canvas)->s_name; + const char*dirname=canvas_getdir(x->x_canvas)->s_name; int fd, len; post("open: %s", s->s_name); @@ -109,7 +109,7 @@ static void freadln_open (t_freadln *x, t_symbol *s, t_symbol*type) pd_error(x, "%s: failed to open %s", s->s_name, filenamebuf); return; } - z_close(fd); + sys_close(fd); len=strlen(filenamebuf); if (!(x->x_filename=(char*)getbytes(sizeof(char)*(len+strlen( s->s_name)+2)))) { @@ -120,7 +120,7 @@ static void freadln_open (t_freadln *x, t_symbol *s, t_symbol*type) strcpy(x->x_filename,filenamebuf); strcpy(x->x_filename+len,"/"); strcpy(x->x_filename+len+1,filenamebufptr); - if (!(x->x_file=z_fopen(x->x_filename, "r"))) { + if (!(x->x_file=sys_fopen(x->x_filename, "r"))) { pd_error(x, "freadln: failed to fopen %s",x->x_filename); return; } @@ -133,29 +133,32 @@ static void freadln_open (t_freadln *x, t_symbol *s, t_symbol*type) x->x_textbuf_length=MIN_FREADLN_LENGTH; } -static int enlarge_cstr_if_required(const char **c_str, int *len, - const int desired_min_length) +static size_t enlarge_cstr_if_required(const char **c_str, size_t *len, + const size_t desired_min_length) { + size_t L; if ((!(*c_str))||*len==0) { *c_str = (char*) calloc (1,sizeof(char)); return 1; } - if (len[0]<desired_min_length) { + L=*len; + if (L<desired_min_length) { do { - len[0]<<=1; - } while ((len[0]<desired_min_length)&&(len[0]!=0)); - freebytes((char*)*c_str, sizeof(char)*len[0]); - if (!(*c_str=(char*)calloc(len[0],sizeof(char)))) { - len[0]=0; + L<<=1; + } while ((L<desired_min_length)&&(L!=0)); + freebytes((char*)*c_str, sizeof(char)*L); + if (!(*c_str=(char*)calloc(L,sizeof(char)))) { + L=0; } } - return len[0]; + *len = L; + return L; } static int cstr_char_pos(const char *c_str, const char c) { - int cnt=1; if (c_str) { + int cnt=1; do { if (*c_str==c) { return cnt; @@ -175,11 +178,10 @@ static void freadln_readline (t_freadln *x) { int min_length=(x->x_textbuf_length < 1)?1:x->x_textbuf_length; int linebreak_pos=0; - int items_read; + size_t items_read; t_binbuf *bbuf; t_atom *abuf; int abuf_length; - int rewind_after; if (!x->x_file) { pd_error(x, "no file opened for reading"); @@ -211,8 +213,8 @@ static void freadln_readline (t_freadln *x) x->linebreak_chr[0]))==-1) && !(items_read < x->x_textbuf_length)); - if (linebreak_pos-1 < items_read - strlen(x->linebreak_chr)) { - rewind_after=items_read-linebreak_pos; + if (linebreak_pos + strlen(x->linebreak_chr) < items_read + 1 ) { + int rewind_after=items_read-linebreak_pos; fseek(x->x_file,-(long)(rewind_after),SEEK_CUR); } if (linebreak_pos==-1) { @@ -263,16 +265,13 @@ static void *freadln_new(void) return (void *)x; } -void freadln_setup(void) +ZEXY_SETUP void freadln_setup(void) { - freadln_class = class_new(gensym("freadln"), (t_newmethod)freadln_new, - (t_method) freadln_free, sizeof(t_freadln), 0, 0); - class_addmethod(freadln_class, (t_method)freadln_open, gensym("open"), - A_SYMBOL, A_DEFSYM, 0); - class_addmethod(freadln_class, (t_method)freadln_close, gensym("close"), - A_NULL, 0); + freadln_class = zexy_new("freadln", + freadln_new, freadln_free, t_freadln, 0, ""); + zexy_addmethod(freadln_class, (t_method)freadln_open, "open", "sS"); + zexy_addmethod(freadln_class, (t_method)freadln_close, "close", ""); class_addbang(freadln_class, (t_method)freadln_readline); zexy_register("freadln"); } - diff --git a/externals/zexy/src/fwriteln.c b/externals/zexy/src/fwriteln.c index e6309297398c562cbf4a1665d4ab034c9bb59ea5..43ab3bf7d001bcff344a2cfc02d028e4ee6a0395 100644 --- a/externals/zexy/src/fwriteln.c +++ b/externals/zexy/src/fwriteln.c @@ -38,7 +38,7 @@ * iemmatrix */ -static t_class *fwriteln_class; +static t_class *fwriteln_class=NULL; typedef struct fwriteln { t_object x_ob; @@ -46,14 +46,14 @@ typedef struct fwriteln { char *x_filename; char *x_textbuf; char linebreak_chr[3]; - char format_string_afloats[10]; + char format_string_afloats[MAXPDSTRING]; } t_fwriteln; static void fwriteln_close (t_fwriteln *x) { if(x->x_file) { - z_fclose(x->x_file); + sys_fclose(x->x_file); } x->x_file=0; if(x->x_filename) { @@ -94,7 +94,7 @@ static void fwriteln_open (t_fwriteln *x, t_symbol *s, t_symbol*type) strcpy(x->linebreak_chr,";\n"); } - if (!(x->x_file=z_fopen(filename, "w"))) { + if (!(x->x_file=sys_fopen(filename, "w"))) { pd_error(x, "failed to open %128s",filename); free(filename); return; @@ -107,9 +107,9 @@ static void fwriteln_open (t_fwriteln *x, t_symbol *s, t_symbol*type) static void fwriteln_write (t_fwriteln *x, t_symbol *s, int argc, t_atom *argv) { - int length=0; char *text=x->x_textbuf; if (x->x_file) { + int length=0; if ((s!=gensym("list"))||(argv->a_type==A_SYMBOL)) { snprintf(text,MAXPDSTRING,"%s ", s->s_name); text[MAXPDSTRING-1]=0; @@ -189,68 +189,61 @@ static void fwriteln_free (t_fwriteln *x) fwriteln_close(x); } -static void *fwriteln_new(t_symbol *s, int argc, t_atom *argv) +static void *fwriteln_new(t_symbol* UNUSED(s), int argc, t_atom *argv) { +#define MAXFMTSTRING 10 int k; - int width; - int precision; - char float_format[3]="g "; - char width_str[3]=""; - char precision_str[4]=""; - char prefix[3]="%"; + char float_format = 'g'; + char sign=0; + char width_str[MAXFMTSTRING]; + char precision_str[MAXFMTSTRING]; t_fwriteln *x = (t_fwriteln *)pd_new(fwriteln_class); + memset(width_str, 0, MAXFMTSTRING); + memset(precision_str, 0, MAXFMTSTRING); + x->x_filename=0; x->x_file=0; x->x_textbuf=0; + for (k=0; k<argc; k++) { - if (atom_getsymbol(&argv[k])==gensym("p")) { + t_symbol*S = atom_getsymbol(&argv[k]); + if (gensym("p")==S) { if ((k+1>=argc)||(argv[k+1].a_type!=A_FLOAT)) { - post("fwriteln: no value given for precision!"); + pd_error(x, "fwriteln: no value given for precision!"); } else { - precision=atom_getint(&argv[++k]); + int precision=(int)atom_getfloat(&argv[++k]); precision=(precision<0)?0:precision; precision=(precision>30)?30:precision; - snprintf(precision_str,4,".%d",precision); + snprintf(precision_str, MAXFMTSTRING, ".%d",precision); } - } else if (atom_getsymbol(&argv[k])==gensym("w")) { + } else if (gensym("w")==S) { if ((k+1>=argc)||(argv[k+1].a_type!=A_FLOAT)) { - post("fwriteln: no value given for width!"); + pd_error(x, "fwriteln: no value given for width!"); } else { - width=atom_getint(&argv[++k]); + int width=(int)atom_getfloat(&argv[++k]); width=(width<1)?1:width; width=(width>40)?40:width; - snprintf(width_str,3,"%d",width); + snprintf(width_str, MAXFMTSTRING, "%d",width); } - } else if (atom_getsymbol(&argv[k])==gensym("g")) { - float_format[0]='g'; - } else if (atom_getsymbol(&argv[k])==gensym("f")) { - float_format[0]='f'; - } else if (atom_getsymbol(&argv[k])==gensym("e")) { - float_format[0]='e'; - } else if (atom_getsymbol(&argv[k])==gensym("-")) { - strcpy(prefix,"%-"); - } else if (atom_getsymbol(&argv[k])==gensym("+")) { - strcpy(prefix,"%+"); + } else if (gensym("g")==S || gensym("f")==S || gensym("e")==S) { + float_format = S->s_name[0]; + } else if (gensym("-")==S || gensym("+")==S) { + sign = S->s_name[0]; } } - x->format_string_afloats[0]='\0'; - strncat(x->format_string_afloats,prefix,2); - strncat(x->format_string_afloats,width_str,2); - strncat(x->format_string_afloats,precision_str,3); - strncat(x->format_string_afloats,float_format,2); + snprintf(x->format_string_afloats, MAXPDSTRING, "%%%c%s%s%c ", sign, + width_str, precision_str, float_format); return (void *)x; } -void fwriteln_setup(void) + +ZEXY_SETUP void fwriteln_setup(void) { - fwriteln_class = class_new(gensym("fwriteln"), (t_newmethod)fwriteln_new, - (t_method) fwriteln_free, sizeof(t_fwriteln), CLASS_DEFAULT, A_GIMME, 0); - class_addmethod(fwriteln_class, (t_method)fwriteln_open, gensym("open"), - A_SYMBOL, A_DEFSYM, 0); - class_addmethod(fwriteln_class, (t_method)fwriteln_close, gensym("close"), - A_NULL, 0); + fwriteln_class = zexy_new("fwriteln", + fwriteln_new, fwriteln_free, t_fwriteln, CLASS_DEFAULT, "*"); + zexy_addmethod(fwriteln_class, (t_method)fwriteln_open, "open", "sS"); + zexy_addmethod(fwriteln_class, (t_method)fwriteln_close, "close", ""); class_addanything(fwriteln_class, (t_method)fwriteln_write); zexy_register("fwriteln"); } - diff --git a/externals/zexy/src/glue.c b/externals/zexy/src/glue.c index e3a2ee7b7a3c974b54e06861598ed2fc51441de1..124ca5c37ef5a3289213a2f2e58b886b23a3a52d 100644 --- a/externals/zexy/src/glue.c +++ b/externals/zexy/src/glue.c @@ -20,7 +20,7 @@ #include "zexy.h" #include <string.h> -static t_class *glue_class; +static t_class *glue_class=NULL; typedef struct _zglue { t_object x_obj; @@ -105,19 +105,20 @@ static void *glue_new(t_symbol* UNUSED(s), int argc, t_atom *argv) return (x); } -static void glue_help(t_glue*x) +static void glue_help(t_glue* UNUSED(x)) { - post("\n"HEARTSYMBOL " glue\t\t:: glue together 2 lists (like [list append])"); + post("\n"HEARTSYMBOL + " glue\t\t:: glue together 2 lists (like [list append])"); } -void glue_setup(void) +ZEXY_SETUP void glue_setup(void) { - glue_class = class_new(gensym("glue"), (t_newmethod)glue_new, - (t_method)glue_free, sizeof(t_glue), 0, A_GIMME, 0); + glue_class = zexy_new("glue", + glue_new, glue_free, t_glue, 0, "*"); class_addlist(glue_class, glue_lst); - class_addmethod (glue_class, (t_method)glue_lst2, gensym(""), A_GIMME, 0); + zexy_addmethod(glue_class, (t_method)glue_lst2, "", "*"); class_addbang(glue_class, glue_bang); - class_addmethod (glue_class, (t_method)glue_help, gensym("help"), 0); + zexy_addmethod(glue_class, (t_method)glue_help, "help", ""); zexy_register("glue"); } diff --git a/externals/zexy/src/index.c b/externals/zexy/src/index.c index 9848945ddf0e27e182d57960dadaf92f38d7c76c..0b91adf5709c3130f0919fa4e815e9b1febcc3c7 100644 --- a/externals/zexy/src/index.c +++ b/externals/zexy/src/index.c @@ -42,7 +42,7 @@ /* ----------------------- index --------------------- */ -static t_class *index_class; +static t_class *index_class=NULL; typedef struct _index { t_object x_obj; @@ -143,9 +143,9 @@ static void index_add(t_index *x, t_symbol *s, t_float f) || newentry>=x->maxentries)) { /* do some resizing */ int maxentries=(newentry>x->maxentries)?newentry:(x->maxentries*2); - int i; t_symbol**buf=(t_symbol **)getbytes(sizeof(t_symbol *) * maxentries); if(buf!=0) { + int i; memcpy(buf, x->names, sizeof(t_symbol *) * x->maxentries); for(i=x->maxentries; i<maxentries; i++) { buf[i]=0; @@ -162,9 +162,9 @@ static void index_add(t_index *x, t_symbol *s, t_float f) if(newentry>0) { newentry--; if(x->names[newentry]) { /* it is already taken! */ - z_verbose(1, - "index :: couldn't add element '%s' at position %d (already taken)", - s->s_name, newentry+1); + verbose(1, + "index :: couldn't add element '%s' at position %d (already taken)", + s->s_name, newentry+1); outlet_float(x->x_obj.ob_outlet, -1.f); return; } @@ -184,7 +184,7 @@ static void index_add(t_index *x, t_symbol *s, t_float f) error("index :: max number of elements (%d) reached !", x->maxentries); } } else { - z_verbose(1, "index :: element '%s' already exists", s->s_name); + verbose(1, "index :: element '%s' already exists", s->s_name); } /* couldn't add the symbol to our index table */ outlet_float(x->x_obj.ob_outlet, -1.f); @@ -213,7 +213,7 @@ static void index_delete(t_index *x, t_symbol* UNUSED(s), int argc, x->entries--; outlet_float(x->x_obj.ob_outlet, 0.0); } else { - z_verbose(1, "index :: couldn't find element"); + verbose(1, "index :: couldn't find element"); outlet_float(x->x_obj.ob_outlet, -1.0); } } @@ -352,7 +352,7 @@ static void index_free(t_index *x) } -static void index_helper(t_index *x) +static void index_helper(t_index* UNUSED(x)) { endpost(); post(""HEARTSYMBOL " index :: index symbols to indices"); @@ -377,33 +377,26 @@ static void index_helper(t_index *x) post("creation:\"index [<maxelements> [<auto>]]\": creates a <maxelements> sized index"); } -void index_setup(void) +ZEXY_SETUP void index_setup(void) { - index_class = class_new(gensym("index"), - (t_newmethod)index_new, (t_method)index_free, - sizeof(t_index), 0, A_GIMME, 0); + index_class = zexy_new("index", + index_new, index_free, t_index, 0, "*"); class_addsymbol(index_class, index_symbol); - class_addmethod(index_class, (t_method)index_reset, gensym("reset"), 0); - class_addmethod(index_class, (t_method)index_delete, gensym("delete"), - A_GIMME, 0); - /* class_addmethod(index_class, (t_method)index_add, gensym("add"), A_SYMBOL, 0); */ - class_addmethod(index_class, (t_method)index_add, gensym("add"), A_SYMBOL, - A_DEFFLOAT, 0); + zexy_addmethod(index_class, (t_method)index_reset, "reset", ""); + zexy_addmethod(index_class, (t_method)index_delete, "delete", "*"); + zexy_addmethod(index_class, (t_method)index_add, "add", "sF"); - class_addmethod(index_class, (t_method)index_auto, gensym("auto"), - A_FLOAT, 0); - class_addmethod(index_class, (t_method)index_resize, gensym("resize"), - A_FLOAT, 0); + zexy_addmethod(index_class, (t_method)index_auto, "auto", "f"); + zexy_addmethod(index_class, (t_method)index_resize, "resize", "f"); class_addfloat(index_class, (t_method)index_float); class_addbang(index_class, (t_method)index_bang); - class_addmethod(index_class, (t_method)index_sort, gensym("sort"), 0); - class_addmethod(index_class, (t_method)index_compact, gensym("compact"), - 0); - class_addmethod(index_class, (t_method)index_dump, gensym("dump"), 0); + zexy_addmethod(index_class, (t_method)index_sort, "sort", ""); + zexy_addmethod(index_class, (t_method)index_compact, "compact", ""); + zexy_addmethod(index_class, (t_method)index_dump, "dump", ""); - class_addmethod(index_class, (t_method)index_helper, gensym("help"), 0); + zexy_addmethod(index_class, (t_method)index_helper, "help", ""); zexy_register("index"); } diff --git a/externals/zexy/src/length.c b/externals/zexy/src/length.c index 3a745d5b82af89d4776507dd6fa482279ce9c8fc..c42d7d548ec74e0e609116feca3ad6f4e121ee80 100644 --- a/externals/zexy/src/length.c +++ b/externals/zexy/src/length.c @@ -19,7 +19,7 @@ #include "zexy.h" -static t_class *length_class; +static t_class *length_class=NULL; typedef struct _length { t_object x_obj; } t_length; @@ -42,10 +42,10 @@ static void *length_new(void) return (x); } -void length_setup(void) +ZEXY_SETUP void length_setup(void) { - length_class = class_new(gensym("length"), (t_newmethod)length_new, 0, - sizeof(t_length), 0, A_DEFFLOAT, 0); + length_class = zexy_new("length", + length_new, 0, t_length, 0, ""); class_addlist(length_class, (t_method)length_list); class_addanything(length_class, (t_method)length_any); diff --git a/externals/zexy/src/lifop.c b/externals/zexy/src/lifop.c index 8dd0963da2df191a9a2db596724a2c8ca90bbe0f..133bc4e4363b3a99cfdd054caccbf362b8c5f3ef 100644 --- a/externals/zexy/src/lifop.c +++ b/externals/zexy/src/lifop.c @@ -32,7 +32,7 @@ * high priority means low numeric value */ -static t_class *lifop_class; +static t_class *lifop_class=NULL; typedef struct _lifop_list { int argc; @@ -189,7 +189,7 @@ static void lifop_bang(t_lifop *x) } static void lifop_query(t_lifop*x) { - z_verbose(1, "%d elements in lifo", (int)x->counter); + verbose(1, "%d elements in lifo", (int)x->counter); outlet_float(x->x_infout, (t_float)x->counter); } @@ -270,27 +270,24 @@ static void *lifop_new(void) return (x); } -static void lifop_help(t_lifop*x) +static void lifop_help(t_lifop*UNUSED(x)) { - post("\n"HEARTSYMBOL " lifop\t\t:: a Last-In-First-Out queue with priorities"); + post("\n"HEARTSYMBOL + " lifop\t\t:: a Last-In-First-Out queue with priorities"); } -void lifop_setup(void) +ZEXY_SETUP void lifop_setup(void) { - lifop_class = class_new(gensym("lifop"), (t_newmethod)lifop_new, - (t_method)lifop_free, sizeof(t_lifop), 0, A_NULL); + lifop_class = zexy_new("lifop", + lifop_new, lifop_free, t_lifop, 0, ""); class_addbang (lifop_class, lifop_bang); class_addlist (lifop_class, lifop_list); - class_addmethod (lifop_class, (t_method)lifop_clear, gensym("clear"), - A_NULL); - class_addmethod (lifop_class, (t_method)lifop_dump, gensym("dump"), - A_NULL); + zexy_addmethod(lifop_class, (t_method)lifop_clear, "clear", ""); + zexy_addmethod(lifop_class, (t_method)lifop_dump, "dump", ""); - class_addmethod (lifop_class, (t_method)lifop_query, gensym("info"), - A_NULL); - class_addmethod (lifop_class, (t_method)lifop_help, gensym("help"), - A_NULL); + zexy_addmethod(lifop_class, (t_method)lifop_query, "info", ""); + zexy_addmethod(lifop_class, (t_method)lifop_help, "help", ""); zexy_register("lifop"); } diff --git a/externals/zexy/src/limiter~.c b/externals/zexy/src/limiter~.c index 153058b3d6d3f7fcae097a576da215b76f3760a8..17b7d0d76d3b1aaf9737adda377e71a2de33ed55 100644 --- a/externals/zexy/src/limiter~.c +++ b/externals/zexy/src/limiter~.c @@ -1,7 +1,8 @@ /* * limiter~: limit/compress signals * - * (c) 1999-2011 IOhannes m zmölnig, forum::fÃŒr::umlÀute, institute of electronic music and acoustics (iem) + * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, + * institute of electronic music and acoustics (iem) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -22,10 +23,10 @@ /* --------------------------------- limiter/compressor --------------------------------- - for details on how it works watch out for "http://iem.kug.ac.at/~zmoelnig/pd" + for details on how it works watch out for "http://users.iem.at/zmoelnig/pd" ...and search for "limiter" - mail2me4more!n4m8ion : zmoelnig@iem.kug.ac.at + mail2me4more!n4m8ion : zmoelnig@iem.at */ /* @@ -33,7 +34,7 @@ the limiter is based on Falkner's thesis "Entwicklung eines digitalen Stereo-limiters mit Hilfe des Signalprozessors DSP56001" pp.14 - 2108:forum::fÃŒr::umlÀute:1999 all rights reserved and no warranties... + 2108:forum::für::umläute:1999 all rights reserved and no warranties... see GNU-license for details */ @@ -73,7 +74,7 @@ static t_sample SINC[9]; -#define PI 3.1415926535897932384626433832795029L /* pi */ +#define PI 3.1415926535897932384626433832795029L /* pi */ static void init_sinc(void) { @@ -89,7 +90,7 @@ static void init_sinc(void) /* ------------------------------------------------------------------------------------ */ /* first define the structs... */ -static t_class *limiter_class; +static t_class *limiter_class=NULL; typedef struct _limctl { /* variables changed by user */ @@ -99,42 +100,42 @@ typedef struct _limctl { } t_limctl; typedef struct _cmpctl { - t_float treshold, - ratio; /* uclimit is the very same is the limiter1-limit (decalculated relative to our treshold) */ + t_float threshold, + ratio; /* uclimit is the very same is the limiter1-limit (decalculated relative to our threshold) */ t_float uclimit, - climit_inverse; /* climit == compressed limit (uclimit == uncompressed limit) */ + climit_inverse; /* climit == compressed limit (uclimit == uncompressed limit) */ - t_float limiter_limit; /* start limiting (stop compressing); == tresh/limit; */ + t_float limiter_limit; /* start limiting (stop compressing); == tresh/limit; */ t_float treshdB, oneminusratio; } t_cmpctl; typedef struct _inbuf { - t_sample* ringbuf; - int buf_position; + t_sample* ringbuf; + int buf_position; } t_inbuf; typedef struct _limiter { - t_object x_obj; + t_object x_obj; - int number_of_inlets, s_n; + int number_of_inlets, s_n; /* variables changed by process */ - t_sample amplification; - t_float samples_left, still_left; + t_sample amplification; + t_float samples_left, still_left; - int mode; + int mode; - t_limctl *val1, *val2; - t_cmpctl *cmp; + t_limctl *val1, *val2; + t_cmpctl *cmp; - /* note : limit is not the same for val1 & val2 : - * at val1 it is the limit of the INPUT_VALUE - * at val2 it is the limit for the AMPLIFICATION (in fact it is abs_limit1/abs_limit2) + /* note: limit is not the same for val1 & val2 : + * at val1 it is the limit of the INPUT_VALUE + * at val2 it is the limit for the AMPLIFICATION (in fact it is abs_limit1/abs_limit2) */ - t_inbuf* in; - int buf_size; + t_inbuf *in; + int buf_size; } t_limiter; @@ -161,7 +162,7 @@ static void set_uclimit(t_limiter *x) { t_cmpctl *c = x->cmp; t_float limit = x->val1->limit, limitdB = rmstodb(limit), ratio = c->ratio, - tresh = c->treshold, treshdB = rmstodb(tresh); + tresh = c->threshold, treshdB = rmstodb(tresh); c->climit_inverse = limit / tresh; c->uclimit = tresh / dbtorms(treshdB+(limitdB - treshdB)/ratio); @@ -172,15 +173,15 @@ static void set_uclimit(t_limiter *x) /* settings */ -static void set_treshold(t_limiter *x, t_float treshold) +static void set_threshold(t_limiter *x, t_float threshold) { t_cmpctl *c = x->cmp; - t_float tresh = dbtorms (treshold); + t_float tresh = dbtorms (threshold); if (tresh > x->val1->limit) { tresh = x->val1->limit; } - c->treshold = tresh; + c->threshold = tresh; set_uclimit(x); } @@ -246,8 +247,8 @@ static void set_limit(t_limiter *x, t_floatarg limit) } x->val1->limit = dbtorms(limit); - if (x->val1->limit < x->cmp->treshold) { - x->cmp->treshold = x->val1->limit; + if (x->val1->limit < x->cmp->threshold) { + x->cmp->threshold = x->val1->limit; } set_uclimit(x); } @@ -264,15 +265,15 @@ static void set_limits(t_limiter *x, t_floatarg limit1, t_floatarg limit2) lim2 = dbtorms(limit2); if (lim2 < lim1) { - lim2 = 2*lim1; /* this is to prevent lim2 (which should trigger the FAST regulation) */ - x->mode = 0; /* to underrun the SLOW regulation; this would cause distortion */ + lim2 = 2*lim1; /* this is to prevent lim2 (which should trigger the FAST regulation) */ + x->mode = 0; /* to underrun the SLOW regulation; this would cause distortion */ } x->val1->limit = lim1; x->val2->limit = lim1/lim2; - if (lim1 < x->cmp->treshold) { - x->cmp->treshold = lim1; + if (lim1 < x->cmp->threshold) { + x->cmp->threshold = lim1; } set_uclimit(x); } @@ -286,8 +287,8 @@ static void set1(t_limiter *x, t_floatarg limit, t_floatarg hold, x->val1->hold_samples = calc_holdsamples(hold, x->buf_size); x->val1->change_of_amplification = calc_coa(release); - if (lim < x->cmp->treshold) { - x->cmp->treshold = lim; + if (lim < x->cmp->threshold) { + x->cmp->threshold = lim; } set_uclimit(x); } @@ -305,13 +306,13 @@ static void set2(t_limiter *x, t_floatarg limit, t_floatarg hold, static void set_compressor(t_limiter *x, t_floatarg limit, - t_floatarg treshold, t_floatarg ratio) + t_floatarg threshold, t_floatarg ratio) { t_cmpctl *c = x->cmp; t_float lim = dbtorms(limit); - t_float tresh = dbtorms(treshold); + t_float tresh = dbtorms(threshold); - if ((limit == 0) && (treshold == 0) && (ratio == 0)) { + if ((limit == 0) && (threshold == 0) && (ratio == 0)) { set_mode(x, COMPRESS); return; } @@ -325,7 +326,7 @@ static void set_compressor(t_limiter *x, t_floatarg limit, c->ratio = ratio; x->val1->limit = lim; - c->treshold = tresh; + c->threshold = tresh; set_uclimit(x); set_mode(x, COMPRESS); @@ -368,12 +369,12 @@ static void status(t_limiter *x) break; case COMPRESS: post("%d-channel compressor @ %fkHz\n" - "\noutput-limit\t= %fdB\ntreshold\t= %fdB\ninput-limit\t= %f\nratio\t\t= 1:%f\n" + "\noutput-limit\t= %fdB\nthreshold\t= %fdB\ninput-limit\t= %f\nratio\t\t= 1:%f\n" "\nhold\t\t= %fms\nrelease\t\t= %fms\n" "\namplify\t\t= %fdB\n", x->number_of_inlets, sr, - rmstodb(c->treshold * c->climit_inverse), rmstodb(c->treshold), - rmstodb(c->treshold / c->uclimit), 1./c->ratio, + rmstodb(c->threshold * c->climit_inverse), rmstodb(c->threshold), + rmstodb(c->threshold / c->uclimit), 1./c->ratio, (v1->hold_samples) / sr, LN2 / (log(v1->change_of_amplification) * sr), rmstodb(x->amplification)); } @@ -399,9 +400,9 @@ static void limiter_tilde_helper(t_limiter *x) "\n'set2 <limit2><htime2><rtime2>'\t: set crack-limiter"); break; case COMPRESS: - poststring("\n'ratio <compressratio>'\t\t: set compressratio (Ã…Å“0.5Ã…Å“ instead of Ã…Å“1:2Ã…Å“)" - "\n'treshold <treshold>'\t\t: set treshold of the compressor" - "\n'compress <limit><treshold><ratio>'\t: set compressor" + poststring("\n'ratio <compressratio>'\t\t: set compressratio ('0.5' instead of '1:2')" + "\n'threshold <threshold>'\t\t: set threshold of the compressor" + "\n'compress <limit><threshold><ratio>'\t: set compressor" "\n..........note that <limit> is the same for COMPRESSOR and LIMITER.........."); break; default: @@ -410,21 +411,21 @@ static void limiter_tilde_helper(t_limiter *x) poststring("\n'print'\t\t\t\t: view actual settings" "\n'help'\t\t\t\t: view this\n"); poststring("\ncreating arguments are :\n" - "\"limiter~ [<in1> [<in2> [<in3> [...]]]]\": <in*> may be anything\n"); + "\"limiter~ [<in1> [<in2> [<in3> [...]]]]\": <in*> may be anything\n"); endpost(); } -/* ------------------------------------------------------------------------------------ */ -/* now do the dsp - thing */ -/* ------------------------------------------------------------------------------------ */ +/* ---------------------- */ +/* now do the dsp - thing */ +/* ---------------------- */ static t_int *oversampling_maxima(t_int *w) { - t_limiter *x = (t_limiter *)w[1]; - t_inbuf *buf = (t_inbuf *)w[2]; - t_sample *in = (t_sample *)w[3]; - t_sample *out = (t_sample *)w[4]; + t_limiter *x = (t_limiter *)w[1]; + t_inbuf *buf = (t_inbuf *) w[2]; + t_sample *in = (t_sample *) w[3]; + t_sample *out = (t_sample *) w[4]; int n = x->s_n; int bufsize = x->buf_size; @@ -468,7 +469,7 @@ static t_int *oversampling_maxima(t_int *w) sinccurrent = SINC[4] * current; - os1= fabsf(SINC[0] * last4 + + os1= Z_FABS(SINC[0] * last4 + SINC[1] * last3 + SINC[2] * last2 + SINC[3] * last1 + @@ -478,7 +479,7 @@ static t_int *oversampling_maxima(t_int *w) SINC[7] * next3 + SINC[8] * next4); - os2= fabsf(SINC[0] * next4 + + os2= Z_FABS(SINC[0] * next4 + SINC[1] * next3 + SINC[2] * next2 + SINC[3] * next1 + @@ -488,7 +489,7 @@ static t_int *oversampling_maxima(t_int *w) SINC[7] * last3 + SINC[8] * last4); - max = fabsf(current); + max = Z_FABS(current); #if 0 if(max>1. || os1>1. || os2>1.) @@ -527,34 +528,34 @@ static t_int *limiter_perform(t_int *w) t_limiter *x=(t_limiter *)w[1]; int n = x->s_n; - t_sample *in = (t_sample *)w[2]; - t_sample *out= (t_sample *)w[3]; + t_sample *in = (t_sample *)w[2]; + t_sample *out = (t_sample *)w[3]; - t_limctl *v1 = (t_limctl *)(x->val1); - t_limctl *v2 = (t_limctl *)(x->val2); - t_cmpctl *c = (t_cmpctl *)(x->cmp); + t_limctl *v1 = (t_limctl *)(x->val1); + t_limctl *v2 = (t_limctl *)(x->val2); + t_cmpctl *c = (t_cmpctl *)(x->cmp); /* now let's make things a little bit faster */ /* these MUST NOT be changed by process */ - const t_float limit = v1->limit; - const t_float holdlong = v1->hold_samples; - const t_float coa_long = v1->change_of_amplification; + const t_float limit = v1->limit; + const t_float holdlong = v1->hold_samples; + const t_float coa_long = v1->change_of_amplification; - const t_float alimit = v2->limit; - const t_float holdshort = v2->hold_samples; - const t_float coa_short = v2->change_of_amplification; + const t_float alimit = v2->limit; + const t_float holdshort = v2->hold_samples; + const t_float coa_short = v2->change_of_amplification; - t_float tresh = c->treshold; + t_float tresh = c->threshold; t_float uclimit = c->uclimit; t_float climit_inv = c->climit_inverse; t_float oneminusratio = c->oneminusratio; /* these will be changed by process */ - t_float amp = x->amplification; - t_float samplesleft = x->samples_left; - t_float stillleft = x->still_left; + t_float amp = x->amplification; + t_float samplesleft = x->samples_left; + t_float stillleft = x->still_left; /* an intern variable... */ t_float max_val; @@ -564,7 +565,7 @@ static t_int *limiter_perform(t_int *w) while (n--) { max_val = *in; - /* the MAIN routine for the 1-treshold-limiter */ + /* the MAIN routine for the 1-threshold-limiter */ if ((max_val * amp) > limit) { amp = limit / max_val; @@ -620,7 +621,7 @@ static t_int *limiter_perform(t_int *w) while (n--) { max_val = *in; - /* the MAIN routine for the compressor (very similar to the 1-treshold-limiter) */ + /* the MAIN routine for the compressor (very similar to the 1-threshold-limiter) */ if (max_val * amp > tresh) { amp = tresh / max_val; @@ -637,8 +638,7 @@ static t_int *limiter_perform(t_int *w) } else { *out++ = amp * climit_inv; /* amp must fit for limiting : amp(new) = limit/maxval; = amp(old)*limitOUT/tresh; */ - } - else { + } else { *out++ = 1.; } @@ -653,8 +653,8 @@ static t_int *limiter_perform(t_int *w) } /* now return the goodies */ - x->amplification = amp; - x->samples_left = samplesleft; + x->amplification = amp; + x->samples_left = samplesleft; return (w+4); } @@ -688,7 +688,7 @@ static void limiter_dsp(t_limiter *x, t_signal **sp) /* ------------------------------------------------------------------------------------ */ /* finally do the creation - things */ -static void *limiter_new(t_symbol *s, int argc, t_atom *argv) +static void *limiter_new(t_symbol *UNUSED(s), int argc, t_atom *argv) { t_limiter *x = (t_limiter *)pd_new(limiter_class); int i = 0; @@ -700,10 +700,10 @@ static void *limiter_new(t_symbol *s, int argc, t_atom *argv) set_bufsize(x, 0); } - if (argc > 64) { + if (argc > 64) { argc=64; } - if (argc == 0) { + if (argc == 0) { argc=1; } @@ -719,8 +719,8 @@ static void *limiter_new(t_symbol *s, int argc, t_atom *argv) while (i < x->number_of_inlets) { int n; t_sample* buf = (t_sample *)getbytes(sizeof(*buf) * x->buf_size); - x->in[i].ringbuf = buf; - x->in[i].buf_position = 0; + x->in[i].ringbuf = buf; + x->in[i].buf_position = 0; for (n = 0; n < x->buf_size; n++) { x->in[i].ringbuf[n] = 0.; } @@ -729,16 +729,16 @@ static void *limiter_new(t_symbol *s, int argc, t_atom *argv) x->val1 = (t_limctl *)getbytes(sizeof(t_limctl)); x->val2 = (t_limctl *)getbytes(sizeof(t_limctl)); - x->cmp = (t_cmpctl *)getbytes(sizeof(t_cmpctl)); + x->cmp = (t_cmpctl *)getbytes(sizeof(t_cmpctl)); x->cmp->ratio = 1.; - x->cmp->treshold = 1; + x->cmp->threshold = 1; set1(x, 100, 30, 139); set2(x, 110, 5, 14.2); - x->amplification= 1; - x->samples_left = x->still_left = x->mode = 0; + x->amplification = 1; + x->samples_left = x->still_left = x->mode = 0; return (x); } @@ -749,9 +749,9 @@ static void limiter_free(t_limiter *x) freebytes(x->val1, sizeof(t_limctl)); freebytes(x->val2, sizeof(t_limctl)); - freebytes(x->cmp , sizeof(t_cmpctl)); + freebytes(x->cmp, sizeof(t_cmpctl)); - while (i < x->number_of_inlets) { + while (i < x->number_of_inlets) { freebytes(x->in[i++].ringbuf, x->buf_size * sizeof(t_sample)); } @@ -765,50 +765,39 @@ static void limiter_free(t_limiter *x) -void limiter_tilde_setup(void) +ZEXY_SETUP void limiter_tilde_setup(void) { init_sinc(); - limiter_class = class_new(gensym("limiter~"), (t_newmethod)limiter_new, - (t_method)limiter_free, - sizeof(t_limiter), 0, A_GIMME, 0); - - class_addmethod(limiter_class, nullfn, gensym("signal"), 0); - class_addmethod(limiter_class, (t_method)limiter_dsp, gensym("dsp"), - A_CANT, 0); - - class_addmethod(limiter_class, (t_method)limiter_tilde_helper, - gensym("help"), 0); - class_addmethod(limiter_class, (t_method)status, gensym("print"), 0); - - class_addmethod(limiter_class, (t_method)set_mode, gensym("mode"), A_FLOAT, - 0); - class_addmethod(limiter_class, (t_method)set_LIMIT, gensym("LIMIT"), 0); - class_addmethod(limiter_class, (t_method)set_CRACK, gensym("CRACK"), 0); - class_addmethod(limiter_class, (t_method)set_COMPRESS, gensym("COMPRESS"), - 0); - - - class_addmethod(limiter_class, (t_method)set_treshold, gensym("tresh"), - A_FLOAT, 0); - class_addmethod(limiter_class, (t_method)set_treshold, gensym("treshold"), - A_FLOAT, 0); - class_addmethod(limiter_class, (t_method)set_ratio, gensym("ratio"), - A_FLOAT, 0); - class_addmethod(limiter_class, (t_method)set1, gensym("set"), A_FLOAT, - A_FLOAT, A_FLOAT, 0); - class_addmethod(limiter_class, (t_method)set2, gensym("set2"), A_FLOAT, - A_FLOAT, A_FLOAT, 0); - class_addmethod(limiter_class, (t_method)set_compressor,gensym("compress"), - A_FLOAT, A_FLOAT, A_FLOAT, 0); - - class_addmethod(limiter_class, (t_method)set_limits, gensym("limits"), - A_FLOAT, A_FLOAT, 0); - class_addmethod(limiter_class, (t_method)set_limit, gensym("limit"), - A_FLOAT, 0); + limiter_class = zexy_new("limiter~", + limiter_new, limiter_free, t_limiter, 0, "*"); + + zexy_addmethod(limiter_class, (t_method)nullfn, "signal", ""); + zexy_addmethod(limiter_class, (t_method)limiter_dsp, "dsp", "!"); + + zexy_addmethod(limiter_class, (t_method)limiter_tilde_helper, "help", ""); + zexy_addmethod(limiter_class, (t_method)status, "print", ""); + + zexy_addmethod(limiter_class, (t_method)set_mode, "mode", "f"); + zexy_addmethod(limiter_class, (t_method)set_LIMIT, "LIMIT", ""); + zexy_addmethod(limiter_class, (t_method)set_CRACK, "CRACK", ""); + zexy_addmethod(limiter_class, (t_method)set_COMPRESS, "COMPRESS", ""); + + + zexy_addmethod(limiter_class, (t_method)set_threshold, "tresh", "f"); + zexy_addmethod(limiter_class, (t_method)set_threshold, "treshold", "f"); + zexy_addmethod(limiter_class, (t_method)set_threshold, "thresh", "f"); + zexy_addmethod(limiter_class, (t_method)set_threshold, "threshold", "f"); + zexy_addmethod(limiter_class, (t_method)set_ratio, "ratio", "f"); + zexy_addmethod(limiter_class, (t_method)set1, "set", "fff"); + zexy_addmethod(limiter_class, (t_method)set2, "set2", "fff"); + zexy_addmethod(limiter_class, (t_method)set_compressor, "compress", "fff"); + + zexy_addmethod(limiter_class, (t_method)set_limits, "limits", "ff"); + zexy_addmethod(limiter_class, (t_method)set_limit, "limit", "f"); class_addfloat (limiter_class, set_limit); - class_addmethod(limiter_class, (t_method)reset, gensym("reset"), 0); + zexy_addmethod(limiter_class, (t_method)reset, "reset", ""); zexy_register("limiter~"); } diff --git a/externals/zexy/src/list2int.c b/externals/zexy/src/list2int.c index 82e2df7e02ff98e552771560873fd84a4634a4db..181ae2490be1488546d3b8e595ac415329eecd5d 100644 --- a/externals/zexy/src/list2int.c +++ b/externals/zexy/src/list2int.c @@ -20,7 +20,7 @@ #include "zexy.h" #include <string.h> -static t_class *list2int_class; +static t_class *list2int_class=NULL; static void list2int_any(t_mypdlist *x, t_symbol *s, int argc, t_atom *argv) @@ -75,22 +75,29 @@ static void mypdlist_free(t_mypdlist *x) { freebytes(x->x_list, x->x_n * sizeof(t_atom)); } - -void list2int_setup(void) +static t_class* zclass_setup(const char*name) +{ + t_class *c = zexy_new(name, + list2int_new, mypdlist_free, t_mypdlist, 0, "*"); + class_addanything(c, list2int_any); + class_addlist(c, list2int_any); + class_addbang(c, list2int_bang); + class_addfloat(c, list2int_float); + class_addsymbol(c, list2int_symbol); + class_addpointer(c, list2int_pointer); + return c; +} +static void dosetup() { - list2int_class = class_new(gensym("list2int"), (t_newmethod)list2int_new, - (t_method)mypdlist_free, sizeof(t_mypdlist), 0, A_GIMME, 0); - class_addcreator((t_newmethod)list2int_new, gensym("l2i"), A_GIMME, 0); - class_addanything(list2int_class, list2int_any); - class_addlist(list2int_class, list2int_any); - class_addbang(list2int_class, list2int_bang); - class_addfloat(list2int_class, list2int_float); - class_addsymbol(list2int_class, list2int_symbol); - class_addpointer(list2int_class, list2int_pointer); zexy_register("list2int"); + list2int_class=zclass_setup("list2int"); + zclass_setup("l2i"); +} +ZEXY_SETUP void list2int_setup(void) +{ + dosetup(); } - void l2i_setup(void) { - list2int_setup(); + dosetup(); } diff --git a/externals/zexy/src/list2lists.c b/externals/zexy/src/list2lists.c index f0279837d42e1cbd1a1f25a96cc79774af9f5da9..9c4eb80588c8a749081eb77a537ffbbaa944adff 100644 --- a/externals/zexy/src/list2lists.c +++ b/externals/zexy/src/list2lists.c @@ -1,5 +1,5 @@ /* - * list2lists: split a list into several sublists given by their lenghts + * list2lists: split a list into several sublists given by their lengths * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * @@ -29,7 +29,7 @@ # define DEBUGFUN(x) #endif -static t_class *list2lists_class; +static t_class *list2lists_class=NULL; typedef struct _list2lists { t_object x_obj; @@ -44,7 +44,7 @@ typedef struct _list2lists { -static void list2lists_list2(t_list2lists*x,t_symbol*s, int argc, +static void list2lists_list2(t_list2lists*x,t_symbol*UNUSED(s), int argc, t_atom*argv) { if(x->x_length!=0) { @@ -132,21 +132,19 @@ static void *list2lists_new(t_symbol* UNUSED(s), int argc, t_atom *argv) } -static void list2lists_help(t_list2lists*x) +static void list2lists_help(t_list2lists*UNUSED(x)) { - post("\n"HEARTSYMBOL " list2lists\t\t:: split lists into multiple sublists based on matches"); + post("\n"HEARTSYMBOL + " list2lists\t\t:: split lists into multiple sublists based on matches"); } -void list2lists_setup(void) +ZEXY_SETUP void list2lists_setup(void) { - list2lists_class = class_new(gensym("list2lists"), - (t_newmethod)list2lists_new, - (t_method)list2lists_free, sizeof(t_list2lists), 0, A_GIMME, 0); + list2lists_class = zexy_new("list2lists", + list2lists_new, list2lists_free, t_list2lists, 0, "*"); class_addlist (list2lists_class, list2lists_list); - class_addmethod (list2lists_class, (t_method)list2lists_list2, - gensym("lst2"), A_GIMME, 0); + zexy_addmethod(list2lists_class, (t_method)list2lists_list2, "lst2", "*"); - class_addmethod(list2lists_class, (t_method)list2lists_help, - gensym("help"), A_NULL); + zexy_addmethod(list2lists_class, (t_method)list2lists_help, "help", ""); zexy_register("list2lists"); } diff --git a/externals/zexy/src/list2symbol.c b/externals/zexy/src/list2symbol.c index 03d0ac2ced2f0bda6b51b18ba2b2eb6dce2b6691..205e3db6dda7d3051a8c913ec6d9833fb9062438 100644 --- a/externals/zexy/src/list2symbol.c +++ b/externals/zexy/src/list2symbol.c @@ -23,7 +23,7 @@ /* ------------------------- list2symbol ------------------------------- */ -static t_class *list2symbol_class; +static t_class *list2symbol_class=NULL; typedef struct _list2symbol { t_object x_obj; @@ -34,11 +34,6 @@ typedef struct _list2symbol { t_outlet*x_outlet; } t_list2symbol; -static void list2symbol_connector(t_list2symbol *x, t_symbol *s) -{ - x->connector = s; -} - static void list2symbol_bang(t_list2symbol *x) { t_atom *argv=x->ap; @@ -46,7 +41,7 @@ static void list2symbol_bang(t_list2symbol *x) char *result = 0; int length = 0, len=0; int i= argc; - char *connector=0; + const char *connector=0; char connlen=0; char*buffer = (char*)getbytes(MAXPDSTRING*sizeof(char)); if(x->connector) { @@ -84,7 +79,7 @@ static void list2symbol_bang(t_list2symbol *x) /* 2nd create the symbol */ if (x->s) { - char *buf = x->s->s_name; + const char *buf = x->s->s_name; int buflen=strlen(buf); strncpy(result+len, buf, length-len); len+=buflen; @@ -140,28 +135,21 @@ static void list2symbol_anything(t_list2symbol *x, t_symbol *s, int argc, list2symbol_bang(x); } -static void list2symbol_list(t_list2symbol *x, t_symbol *s, int argc, +static void list2symbol_list(t_list2symbol *x, t_symbol *UNUSED(s), + int argc, t_atom *argv) { list2symbol_anything(x, 0, argc, argv); } -static void *list2symbol_new(t_symbol *s, int argc, t_atom *argv) +static void *list2symbol_new(t_symbol *UNUSED(s), int argc, t_atom *argv) { t_list2symbol *x = (t_list2symbol *)pd_new(list2symbol_class); x->x_outlet=outlet_new(&x->x_obj, 0); - x->x_inlet2=inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("symbol"), - gensym("")); - -#if 0 - /* old behaviour: the argument list is used as the list-to-be-converted */ - x->connector = gensym(" "); - list2symbol_anything(x, 0, argc, argv); -#else - /* new behaviour: set the delimiter with the argument */ - list2symbol_connector(x, (argc)?atom_getsymbol(argv):gensym(" ")); -#endif + x->x_inlet2=symbolinlet_new(&x->x_obj, &x->connector); + /* set the delimiter with the argument */ + x->connector = (argc)?atom_getsymbol(argv):gensym(" "); return (x); } @@ -176,24 +164,26 @@ static void list2symbol_free(t_list2symbol *x) inlet_free(x->x_inlet2); } - -void list2symbol_setup(void) +static t_class* zclass_setup(const char*name) +{ + t_class*c = zexy_new(name, + list2symbol_new, list2symbol_free, t_list2symbol, 0, "*"); + class_addbang (c, list2symbol_bang); + class_addlist (c, list2symbol_list); + class_addanything(c, list2symbol_anything); + return c; +} +static void dosetup() { - list2symbol_class = class_new(gensym("list2symbol"), - (t_newmethod)list2symbol_new, - (t_method)list2symbol_free, sizeof(t_list2symbol), 0, - A_GIMME, 0); - - class_addcreator((t_newmethod)list2symbol_new, gensym("l2s"), A_GIMME, 0); - class_addbang (list2symbol_class, list2symbol_bang); - class_addlist (list2symbol_class, list2symbol_list); - class_addanything(list2symbol_class, list2symbol_anything); - class_addmethod (list2symbol_class, (t_method)list2symbol_connector, - gensym(""), A_SYMBOL, 0); - zexy_register("list2symbol"); + list2symbol_class=zclass_setup("list2symbol"); + zclass_setup("l2s"); +} +ZEXY_SETUP void list2symbol_setup(void) +{ + dosetup(); } void l2s_setup(void) { - list2symbol_setup(); + dosetup(); } diff --git a/externals/zexy/src/lister.c b/externals/zexy/src/lister.c index 4b7084b41dcffdbf165aafdbe6f01b6a06c575ff..e654b482ccbf3d3397884a0ccd852de516185c1b 100644 --- a/externals/zexy/src/lister.c +++ b/externals/zexy/src/lister.c @@ -19,24 +19,8 @@ #include "zexy.h" -#ifdef HAVE_ALLOCA_H -# include <alloca.h> -#endif +static t_class *lister_class = NULL; -#define LIST_NGETBYTE 100 /* bigger that this we use alloc, not alloca */ - - -static t_class *mypdlist_class; - -#ifdef HAVE_ALLOCA_H -# define ATOMS_ALLOCA(x, n) ((x) = (t_atom *)((n) < LIST_NGETBYTE ? \ - alloca((n) * sizeof(t_atom)) : getbytes((n) * sizeof(t_atom)))) -# define ATOMS_FREEA(x, n) ( \ - ((n) < LIST_NGETBYTE || (freebytes((x), (n) * sizeof(t_atom)), 0))) -#else -# define ATOMS_ALLOCA(x, n) ((x) = (t_atom *)getbytes((n) * sizeof(t_atom))) -# define ATOMS_FREEA(x, n) (freebytes((x), (n) * sizeof(t_atom))) -#endif static void atoms_copy(int argc, t_atom *from, t_atom *to) { @@ -57,7 +41,8 @@ static void mypdlist_storelist(t_mypdlist *x, int argc, t_atom *argv) atoms_copy(argc, argv, x->x_list); } -static void mypdlist_secondlist(t_mypdlist *x, t_symbol *s, int argc, +static void mypdlist_secondlist(t_mypdlist *x, t_symbol *UNUSED(s), + int argc, t_atom *argv) { mypdlist_storelist(x, argc, argv); @@ -66,11 +51,10 @@ static void mypdlist_secondlist(t_mypdlist *x, t_symbol *s, int argc, static void mypdlist_bang(t_mypdlist *x) { int outc=x->x_n; - t_atom*outv; - ATOMS_ALLOCA(outv, outc); + t_atom*outv = (t_atom*)getbytes(outc * sizeof(t_atom)); atoms_copy(x->x_n, x->x_list, outv); outlet_list(x->x_obj.ob_outlet, gensym("list"), outc, outv); - ATOMS_FREEA(outv, outc); + freebytes(outv, outc * sizeof(t_atom)); } @@ -87,9 +71,9 @@ static void mypdlist_free(t_mypdlist *x) freebytes(x->x_list, x->x_n * sizeof(t_atom)); } -static void *mypdlist_new(t_symbol *s, int argc, t_atom *argv) +static void *mypdlist_new(t_symbol *UNUSED(s), int argc, t_atom *argv) { - t_mypdlist *x = (t_mypdlist *)pd_new(mypdlist_class); + t_mypdlist *x = (t_mypdlist *)pd_new(lister_class); outlet_new(&x->x_obj, 0); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("list"), gensym("lst2")); @@ -105,29 +89,33 @@ static void *mypdlist_new(t_symbol *s, int argc, t_atom *argv) } -static void mypdlist_help(t_mypdlist*x) +static void mypdlist_help(t_mypdlist*UNUSED(x)) { - post("\n"HEARTSYMBOL " lister\t\t:: basic list storage (use pd>=0.39 for real [list] objects)"); + post("\n"HEARTSYMBOL + " lister\t\t:: basic list storage (use pd>=0.39 for real [list] objects)"); } -void lister_setup(void) +static t_class* zclass_setup(const char*name) +{ + t_class *c = zexy_new(name, + mypdlist_new, mypdlist_free, t_mypdlist, 0, "*"); + class_addbang (c, mypdlist_bang); + class_addlist (c, mypdlist_list); + zexy_addmethod(c, (t_method)mypdlist_secondlist, "lst2", "*"); + zexy_addmethod(c, (t_method)mypdlist_help, "help", ""); + return c; +} +static void dosetup() { - mypdlist_class = class_new(gensym("lister"), (t_newmethod)mypdlist_new, - (t_method)mypdlist_free, sizeof(t_mypdlist), 0, A_GIMME, 0); - /* i don't know how to get this work with name=="list" !!! */ - - class_addcreator((t_newmethod)mypdlist_new, gensym("l"), A_GIMME, 0); - - class_addbang (mypdlist_class, mypdlist_bang); - class_addlist (mypdlist_class, mypdlist_list); - class_addmethod (mypdlist_class, (t_method)mypdlist_secondlist, - gensym("lst2"), A_GIMME, 0); - - class_addmethod(mypdlist_class, (t_method)mypdlist_help, gensym("help"), - A_NULL); zexy_register("lister"); + lister_class = zclass_setup("lister"); + zclass_setup("l"); +} +ZEXY_SETUP void lister_setup(void) +{ + dosetup(); } void l_setup(void) { - lister_setup(); + dosetup(); } diff --git a/externals/zexy/src/listfind.c b/externals/zexy/src/listfind.c index fe0df1d7ffeb128f82407ec53dd8bd317ff18648..829d2db507956623b97b0ef933ffd193e99d12c8 100644 --- a/externals/zexy/src/listfind.c +++ b/externals/zexy/src/listfind.c @@ -1,5 +1,5 @@ /* - * listfind: find a sublist in a list and return the index of the occurence (or indices if there are more) + * listfind: find a sublist in a list and return the index of the occurrence (or indices if there are more) * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * @@ -29,7 +29,7 @@ # define DEBUGFUN(x) #endif -static t_class *listfind_class; +static t_class *listfind_class=NULL; typedef struct _listfind { @@ -45,7 +45,8 @@ typedef struct _listfind { -static void listfind_list2(t_listfind*x,t_symbol*s, int argc, t_atom*argv) +static void listfind_list2(t_listfind*x,t_symbol*UNUSED(s), int argc, + t_atom*argv) { if(x->x_argv!=0) { freebytes(x->x_argv, sizeof(t_atom)*x->x_argc); @@ -67,7 +68,7 @@ static void listfind_list2(t_listfind*x,t_symbol*s, int argc, t_atom*argv) DEBUGFUN(post("list2: %d %x", x->x_argc, x->x_argv)); } -static int atom_equals(t_atom*a1, t_atom*a2) +static int UNUSED_FUNCTION(atom_equals) (t_atom*a1, t_atom*a2) { if(a1->a_type!=a2->a_type) { return 0; @@ -167,7 +168,7 @@ static void listfind_doit(t_outlet*out, int longcount, t_atom*longlist, freebytes(ap, length*sizeof(t_atom)); } -static void listfind_list(t_listfind *x, t_symbol *s, int argc, +static void listfind_list(t_listfind *x, t_symbol *UNUSED(s), int argc, t_atom *argv) { #if 0 @@ -217,20 +218,19 @@ static void *listfind_new(t_symbol* UNUSED(s), int argc, t_atom *argv) } -static void listfind_help(t_listfind*x) +static void listfind_help(t_listfind*UNUSED(x)) { - post("\n"HEARTSYMBOL " listfind\t\t:: split lists into multiple sublists based on matches"); + post("\n"HEARTSYMBOL + " listfind\t\t:: split lists into multiple sublists based on matches"); } -void listfind_setup(void) +ZEXY_SETUP void listfind_setup(void) { - listfind_class = class_new(gensym("listfind"), (t_newmethod)listfind_new, - (t_method)listfind_free, sizeof(t_listfind), 0, A_GIMME, 0); + listfind_class = zexy_new("listfind", + listfind_new, listfind_free, t_listfind, 0, "*"); class_addlist (listfind_class, listfind_list); - class_addmethod (listfind_class, (t_method)listfind_list2, gensym("lst2"), - A_GIMME, 0); + zexy_addmethod(listfind_class, (t_method)listfind_list2, "lst2", "*"); - class_addmethod(listfind_class, (t_method)listfind_help, gensym("help"), - A_NULL); + zexy_addmethod(listfind_class, (t_method)listfind_help, "help", ""); zexy_register("listfind"); } diff --git a/externals/zexy/src/liststorage.c b/externals/zexy/src/liststorage.c index 7139cee85c3374125f1e96e7dab71ef4e4587f04..afcd7b0fe1fe04bce54d558d6da33368daafca4e 100644 --- a/externals/zexy/src/liststorage.c +++ b/externals/zexy/src/liststorage.c @@ -62,7 +62,7 @@ typedef struct _liststorage { t_msglist**x_slots; } t_liststorage; -static t_class *liststorage_class; +static t_class *liststorage_class=NULL; /* ************************************************************************ */ @@ -234,16 +234,14 @@ static void liststorage_bang(t_liststorage *x) } /* add a new list to the current slot */ -static void liststorage_add(t_liststorage *x, t_symbol *s, int ac, +static void liststorage_add(t_liststorage *x, t_symbol *UNUSED(s), int ac, t_atom *av) { - t_msglist*list=NULL; int slot=_liststorage_checkslot(x, "attempting to add data to invalid slot", 1); if(slot<0) { return; } - list=_liststorage_getslot(x, slot); x->x_slots[slot]=_liststorage_add2slot(x->x_slots[slot], ac, av); } @@ -271,7 +269,7 @@ static void liststorage_clearall(t_liststorage *x) static void liststorage_insert(t_liststorage *x, t_floatarg f) { int current=x->x_currentslot; - int slot=-1; + int slot; int i=0; x->x_currentslot=f; @@ -394,43 +392,39 @@ static void *liststorage_new(t_floatarg f) return (x); } -void liststorage_setup(void) +ZEXY_SETUP void liststorage_setup(void) { - liststorage_class = class_new(gensym("liststorage"), - (t_newmethod)liststorage_new, - (t_method)liststorage_free, sizeof(t_liststorage), 0, A_DEFFLOAT, 0); + liststorage_class = zexy_new("liststorage", + liststorage_new, liststorage_free, t_liststorage, 0, "F"); /* recall all lists from the current slot */ class_addbang(liststorage_class, (t_method)liststorage_bang); /* add a new list to the current slot */ - class_addmethod(liststorage_class, (t_method)liststorage_add, - gensym("add"), A_GIMME, 0); + zexy_addmethod(liststorage_class, (t_method)liststorage_add, "add", "*"); /* clear the current slot */ - class_addmethod(liststorage_class, (t_method)liststorage_clear, - gensym("clear"), 0); + zexy_addmethod(liststorage_class, (t_method)liststorage_clear, "clear", + ""); /* clear all slots */ - class_addmethod(liststorage_class, (t_method)liststorage_clearall, - gensym("clearall"), 0); + zexy_addmethod(liststorage_class, (t_method)liststorage_clearall, + "clearall", ""); /* add a new list to the current slot */ - class_addmethod(liststorage_class, (t_method)liststorage_slot, - gensym("slot"), A_FLOAT, 0); + zexy_addmethod(liststorage_class, (t_method)liststorage_slot, "slot", "f"); /* insert an empty slot at (before) given position */ - class_addmethod(liststorage_class, (t_method)liststorage_insert, - gensym("insert"), A_DEFFLOAT, 0); + zexy_addmethod(liststorage_class, (t_method)liststorage_insert, "insert", + "F"); /* remove empty slots */ - class_addmethod(liststorage_class, (t_method)liststorage_compress, - gensym("compress"), 0); + zexy_addmethod(liststorage_class, (t_method)liststorage_compress, + "compress", ""); /* get the number of slots */ - class_addmethod(liststorage_class, (t_method)liststorage_info, - gensym("info"), 0); + zexy_addmethod(liststorage_class, (t_method)liststorage_info, "info", ""); zexy_register("liststorage"); } diff --git a/externals/zexy/src/longload.c b/externals/zexy/src/longload.c index 0e914e7d7c6b9775417e570daf0b5677bb48b4ce..d07f0e09d54f535a59c30f4e75f3b66ecd609a74 100644 --- a/externals/zexy/src/longload.c +++ b/externals/zexy/src/longload.c @@ -28,7 +28,7 @@ #endif -static t_class *longload_class; +static t_class *longload_class=NULL; typedef struct _longload { t_object x_obj; @@ -55,13 +55,9 @@ static void *longload_new(t_float f) return (x); } -void longload_setup(void) +ZEXY_SETUP void longload_setup(void) { - longload_class = class_new(gensym("longload"), - (t_newmethod)longload_new, - 0, - sizeof(t_longload), - CLASS_NOINLET, - A_DEFFLOAT, 0); + longload_class = zexy_new("longload", + longload_new, 0, t_longload, CLASS_NOINLET, "F"); zexy_register("longload"); } diff --git a/externals/zexy/src/lpt.c b/externals/zexy/src/lpt.c index 809d7181ed89c3c5e946364af20287cebdd781e0..7e7ea24723d46b98892493c78e079ac4874158db 100644 --- a/externals/zexy/src/lpt.c +++ b/externals/zexy/src/lpt.c @@ -31,7 +31,6 @@ TODO: test for timeouts,... thanks to - Olaf Matthes: porting to WindozeNT/2000/XP Thomas Musil: adding "control-output" and "input" */ #define BASE0 0x3bc @@ -42,130 +41,286 @@ #define MODE_IOPL 0 #define MODE_NONE -1 +#if defined __linux__ +# ifndef Z_WANT_LPT +# define Z_WANT_LPT 1 +# endif +#elif defined __WIN32__ +// ag: We don't have the requisite dlls, disabled for now. +#define Z_WANT_LPT 0 +# if defined __i386__ +# ifndef Z_WANT_LPT +# define Z_WANT_LPT 1 +# endif +# define INPOUT_DLL "inpout32.dll" +# elif defined __x86_64__ +# ifndef Z_WANT_LPT +# define Z_WANT_LPT 1 +# endif +# define INPOUT_DLL "inpoutx64.dll" +# else +# warning lpt-support on Windows requires InpOut32, which is only available for i386/amd64 +# endif +#else +# warning no lpt-support for this OS +#endif + +#ifndef Z_WANT_LPT +# define Z_WANT_LPT 0 +#endif + #include "zexy.h" /* ----------------------- lpt --------------------- */ -#ifdef Z_WANT_LPT +#if Z_WANT_LPT # include <stdlib.h> # include <errno.h> -# ifdef HAVE_LINUX_PPDEV_H -# include <unistd.h> -# include <sys/ioctl.h> -# include <linux/ppdev.h> -# include <linux/parport.h> -# include <fcntl.h> -# include <stdio.h> -# endif /* HAVE_LINUX_PPDEV_H */ +# if defined __WIN32__ +#include "windows.h" +typedef void (__stdcall *lpOut32)(short, short); +typedef short (__stdcall *lpInp32)(short); +typedef BOOL (__stdcall *lpIsInpOutDriverOpen)(void); +typedef BOOL (__stdcall *lpIsXP64Bit)(void); + +/* Some global function pointers (messy but fine for an example) */ +lpOut32 gfpOut32; +lpInp32 gfpInp32; +lpIsInpOutDriverOpen gfpIsInpOutDriverOpen; +lpIsXP64Bit gfpIsXP64Bit; +/* the handle to the DLL, so we can close it once all [lpt]-objects have been deleted */ +static HINSTANCE hInpOutDll; +/* reference count for the DLL-handle */ +static int z_inpout32_refcount = 0; + +static int z_getWinErr(char*outstr, size_t len) +{ + wchar_t*errstr; + size_t i; + DWORD err = GetLastError(); + outstr[0] = 0; + if(!err) { + return 0; + } + errstr=calloc(len, sizeof(wchar_t)); + FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), errstr, len, NULL); + for(i=0; i<len; i++) { + wchar_t wc = errstr[i]; + char c = ((wc>=0) && (wc<128))?((char)(wc)):'?'; + if((10 == c) || (13 == c)) { + c = ' '; + } + outstr[i] = c; + } + free(errstr); + outstr[len-1] = 0; + return err; +} +static void z_findfile(const char*filename, char*buf, size_t bufsize) +{ + char *bufptr; + int fd = open_via_path(".", filename, "", buf, &bufptr, bufsize, 0); -# ifdef __WIN32__ -/* on windoze everything is so complicated... */ -extern int read_parport(int port); -extern void write_parport(int port, int value); -extern int open_port(int port); + if (fd < 0) { + snprintf(buf, bufsize-1, "%s", filename); + } else { + sys_close(fd); + snprintf(buf, bufsize-1, "%s/%s", buf, bufptr); + } + buf[bufsize-1] = 0; + +} -static int ioperm(int port, int a, int b) +static int z_inpout32_ctor() { - if(open_port(port) == -1) { - return(1); + if(!z_inpout32_refcount) { + char filename[MAXPDSTRING]; + z_findfile(INPOUT_DLL, filename, MAXPDSTRING); + + SetLastError(0); + hInpOutDll = LoadLibrary ( filename ); + if ( hInpOutDll == NULL ) { + char errstring[MAXPDSTRING]; + int err = z_getWinErr(errstring, MAXPDSTRING); + error("unable to open %s for accessing the parallel-port!", INPOUT_DLL); + error("error[%d]: %s", err, errstring); + error("make sure you have InpOut32 installed"); + error("--> http://www.highrez.co.uk/downloads/inpout32/"); + return 0; + } + gfpOut32 = (lpOut32)GetProcAddress(hInpOutDll, "Out32"); + gfpInp32 = (lpInp32)GetProcAddress(hInpOutDll, "Inp32"); + gfpIsInpOutDriverOpen = (lpIsInpOutDriverOpen)GetProcAddress(hInpOutDll, + "IsInpOutDriverOpen"); + gfpIsXP64Bit = (lpIsXP64Bit)GetProcAddress(hInpOutDll, "IsXP64Bit"); } - return(0); -} + z_inpout32_refcount++; -static int iopl(int i) + if (!gfpIsInpOutDriverOpen()) { + error("unable to start InpOut32 driver!"); + return 0; + } + return z_inpout32_refcount; +} +static void z_inpout32_dtor() { - return(-1); + z_inpout32_refcount--; + if(!z_inpout32_refcount) { + gfpOut32 = NULL; + gfpInp32 = NULL; + gfpIsInpOutDriverOpen = NULL; + gfpIsXP64Bit = NULL; + FreeLibrary ( hInpOutDll ); + } +} +static void sys_outb(unsigned char byte, unsigned short int port) +{ + if(gfpOut32) { + gfpOut32(port, byte); + } +} +static int sys_inb(unsigned short int port) +{ + if(gfpInp32) { + return gfpInp32(port); + } + return 0; } -static void sys_outb(unsigned char byte, int port) +/* on windoze everything is so complicated... */ +static int ioperm(unsigned short int UNUSED(port), + int UNUSED(a), int UNUSED(b)) { - write_parport(port, byte); + return(0); } -static int sys_inb(int port) + +static int iopl(int UNUSED(i)) { - return read_parport(port); + return(-1); } -# else + +# elif defined (__linux__) /* thankfully there is linux */ +# include <unistd.h> +# include <sys/ioctl.h> +# include <linux/ppdev.h> +# include <linux/parport.h> +# include <fcntl.h> +# include <stdio.h> # include <sys/io.h> -static void sys_outb(unsigned char byte, int port) +static void sys_outb(unsigned char byte, unsigned short int port) { outb(byte, port); } -static int sys_inb(int port) +static int sys_inb(unsigned short int port) { return inb(port); } -# endif /* __WIN32__ */ -#endif /* Z_WANT_LP */ + +# else +static void sys_outb(unsigned char UNUSED(byte), + unsigned short int UNUSED(port)) +{} +static int sys_inb(unsigned short int UNUSED(port)) +{ + return 0; +} +# endif /* OS */ +#endif /* Z_WANT_LPT */ static int count_iopl = 0; -static t_class *lpt_class; +static t_class *lpt_class=NULL; typedef struct _lpt { t_object x_obj; - unsigned long port; + unsigned short int port; int device; /* file descriptor of device, in case we are using one ...*/ int mode; /* MODE_IOPERM, MODE_IOPL */ } t_lpt; +#if Z_WANT_LPT static void lpt_float(t_lpt *x, t_floatarg f) { -#ifdef Z_WANT_LPT unsigned char b = f; -# ifdef HAVE_LINUX_PPDEV_H +#ifdef __linux__ if (x->device>0) { ioctl (x->device, PPWDATA, &b); } else -# endif +#endif if (x->port) { sys_outb(b, x->port+0); } -#endif /* Z_WANT_LPT */ } static void lpt_control(t_lpt *x, t_floatarg f) { -#ifdef Z_WANT_LPT unsigned char b = f; -# ifdef HAVE_LINUX_PPDEV_H +#ifdef __linux__ if (x->device>0) { ioctl (x->device, PPWCONTROL, &b); } else -# endif +#endif if (x->port) { sys_outb(b, x->port+2); } -#endif /* Z_WANT_LPT */ } static void lpt_bang(t_lpt *x) { -#ifdef Z_WANT_LPT -# ifdef HAVE_LINUX_PPDEV_H +#ifdef __linux__ if (x->device>0) { unsigned char b=0; ioctl (x->device, PPRCONTROL, &b); outlet_float(x->x_obj.ob_outlet, (t_float)b); } else -# endif - if (x->port) { +#endif + if (x->port) { outlet_float(x->x_obj.ob_outlet, (t_float)sys_inb(x->port+1)); } -#endif /* Z_WANT_LPT */ } +static void lpt_free(t_lpt *x) +{ +#ifdef __linux__ + if (x->device>0) { + ioctl (x->device, PPRELEASE); + sys_close(x->device); + x->device=0; + } else +#endif + if (x->port) { + if (x->mode==MODE_IOPERM && ioperm(x->port, 8, 0)) { + error("lpt: couldn't clean up device"); + } else if (x->mode==MODE_IOPL && (!--count_iopl) && iopl(0)) { + error("lpt: couldn't clean up device"); + } + } +#ifdef __WIN32__ + z_inpout32_dtor(); +#endif +} + +#else +static void lpt_float(t_lpt *x, t_floatarg f) { ; } +static void lpt_control(t_lpt *x, t_floatarg f) { ; } +static void lpt_bang(t_lpt *x) { ; } +static void lpt_free(t_lpt *x) { ; } +#endif /* Z_WANT_LPT */ + static void *lpt_new(t_symbol *s, int argc, t_atom *argv) { t_lpt *x = (t_lpt *)pd_new(lpt_class); - char*devname = argc ? atom_getsymbol(argv)->s_name : &s_; + const char*devname=0; + long int hexport = 0; + if(s==gensym("lp")) { error("lpt: the use of 'lp' has been deprecated; use 'lpt' instead"); } @@ -177,18 +332,21 @@ static void *lpt_new(t_symbol *s, int argc, t_atom *argv) x->port = 0; x->device = -1; -#ifdef Z_WANT_LPT +#if Z_WANT_LPT if ((argc==0)||(argv->a_type==A_FLOAT)) { /* FLOAT specifies a parallel port */ switch ((int)((argc)?atom_getfloat(argv):0)) { case 0: x->port = BASE0; + devname="lpt0"; break; case 1: x->port = BASE1; + devname="lpt1"; break; case 2: x->port = BASE2; + devname="lpt2"; break; default: error("lpt : only lpt0, lpt1 and lpt2 are accessible"); @@ -196,30 +354,31 @@ static void *lpt_new(t_symbol *s, int argc, t_atom *argv) return (x); } } else { - /* SYMBOL might be a file or a hex port-number; - we ignore the file (device) case by now; - LATER think about this - */ + /* SYMBOL might be a file or a hex port-number */ + devname=atom_getsymbol(argv)->s_name; x->device=-1; - x->port=strtol(devname, 0, 16); + hexport=strtol(devname, 0, 16); + if((hexport >= 0) && (hexport <= 0xFFFF)) { + x->port = hexport; + } if(0==x->port) { -#ifdef HAVE_LINUX_PPDEV_H - x->device = z_open(devname, O_RDWR); +#ifdef __linux__ + x->device = sys_open(devname, O_RDWR); if(x->device<=0) { error("lpt: bad device %s", devname); return(x); } else { if (ioctl (x->device, PPCLAIM)) { perror ("PPCLAIM"); - z_close (x->device); + sys_close (x->device); x->device=-1; } } -#endif /* HAVE_LINUX_PPDEV_H */ +#endif /* __linux__ */ } } - if ((x->device<0) && (!x->port || x->port>65535)) { + if ((x->device<0) && (!x->port)) { error("lpt : bad port %x", x->port); x->port = 0; return (x); @@ -227,7 +386,7 @@ static void *lpt_new(t_symbol *s, int argc, t_atom *argv) if (x->device<0) { /* this is ugly: when using a named device, * we are currently assuming that we have read/write-access - * of course, this is not necessary true + * of course, this is not necessarily true */ /* furthermore, we might also use the object * withOUT write permissions @@ -255,15 +414,20 @@ static void *lpt_new(t_symbol *s, int argc, t_atom *argv) return (x); } } +#ifdef __WIN32__ + z_inpout32_ctor(); +#else if(x->device>0) { post("lpt: connected to device %s", devname); } else { post("lpt: connected to port %x in mode '%s'", x->port, (x->mode==MODE_IOPL)?"iopl":"ioperm"); } +#endif if (x->mode==MODE_IOPL) { post("lpt-warning: this might seriously damage your pc..."); } + #else error("zexy has been compiled without [lpt]!"); count_iopl=0; @@ -274,27 +438,6 @@ static void *lpt_new(t_symbol *s, int argc, t_atom *argv) return (x); } -static void lpt_free(t_lpt *x) -{ -#ifdef Z_WANT_LPT -# ifdef HAVE_LINUX_PPDEV_H - if (x->device>0) { - ioctl (x->device, PPRELEASE); - z_close(x->device); - x->device=0; - } else -# endif - if (x->port) { - if (x->mode==MODE_IOPERM && ioperm(x->port, 8, 0)) { - error("lpt: couldn't clean up device"); - } else if (x->mode==MODE_IOPL && (!--count_iopl) && iopl(0)) { - error("lpt: couldn't clean up device"); - } - } -#endif /* Z_WANT_LPT */ -} - - static void lpt_helper(t_lpt*UNUSED(x)) { post("\n"HEARTSYMBOL " lpt :: direct access to the parallel port"); @@ -303,18 +446,16 @@ static void lpt_helper(t_lpt*UNUSED(x)) post("\t\t\"lpt <portaddr>\": connect to port @ <portaddr> (hex)"); } -void lpt_setup(void) +ZEXY_SETUP void lpt_setup(void) { - lpt_class = class_new(gensym("lpt"), - (t_newmethod)lpt_new, (t_method)lpt_free, - sizeof(t_lpt), 0, A_GIMME, 0); - class_addcreator((t_newmethod)lpt_new, gensym("lp"), A_GIMME, 0); + lpt_class = zexy_new("lpt", + lpt_new, lpt_free, t_lpt, 0, "*"); + //class_addcreator((t_newmethod)lpt_new, gensym("lp"), A_GIMME, 0); class_addfloat(lpt_class, (t_method)lpt_float); - class_addmethod(lpt_class, (t_method)lpt_control, gensym("control"), - A_FLOAT, 0); + zexy_addmethod(lpt_class, (t_method)lpt_control, "control", "f"); class_addbang(lpt_class, (t_method)lpt_bang); - class_addmethod(lpt_class, (t_method)lpt_helper, gensym("help"), 0); + zexy_addmethod(lpt_class, (t_method)lpt_helper, "help", ""); zexy_register("lpt"); } diff --git a/externals/zexy/src/makealias.sh b/externals/zexy/src/makealias.sh index 43559ba658059e4b13afdc7a95b174a0819e7217..e6535af70696a15cb0df64078418c4e90a4821a9 100755 --- a/externals/zexy/src/makealias.sh +++ b/externals/zexy/src/makealias.sh @@ -1,6 +1,6 @@ #!/bin/sh -EXTENSIONS=".pd -help.pd .pd_linux .pd_darwin .pd_freebsd .dll .b_i386 .l_ia64 .l_i386 .d_fat .d_i386 .d_ppc .m_i386" +EXTENSIONS=".pd -help.pd .pd_linux .pd_darwin .pd_freebsd .dll .b_i386 .l_ia64 .l_i386 .d_fat .d_i386 .d_ppc .m_i386" ALIASFILE=$1 shift diff --git a/externals/zexy/src/makesource.sh b/externals/zexy/src/makesource.sh index f4e462956ccb08dfe834672ec96c688220166fde..d9f7ba88637e38082ea986853026684bdef62e69 100755 --- a/externals/zexy/src/makesource.sh +++ b/externals/zexy/src/makesource.sh @@ -1,71 +1,67 @@ #!/bin/sh -ZEXY_H=z_zexy.h ZEXY_C=z_zexy.c - -GREP=grep -AWK=awk -SED=sed - ################################# ## functions -head_h() { - echo "/* zexy-setup autogenerated header-file" - echo " * generated by \"$0\"" - echo " * !! DO NOT MANUALLY EDIT !!" - echo " */" - echo - echo "#ifndef Z_ZEXY_H__" - echo "#define Z_ZEXY_H__" +mycolumn() { + cat } +COLUMN=$(which column 2>/dev/null || echo mycolumn) + +head_c() { + cat <<EOL +/* zexy-setup autogenerated setup-file + * generated by "$0" + * !! DO NOT MANUALLY EDIT !! + */ -foot_h() { - echo "" - echo "void z_zexy_setup(void);" - echo "#endif /* Z_ZEXY_H__ */" - echo "" +/* forward declarations */ +EOL } -head_c() { - echo "/* zexy-setup autogenerated setup-file" - echo " * generated by \"$0\"" - echo " * !! DO NOT MANUALLY EDIT !!" - echo " */" - echo - echo "#include \"$ZEXY_H\"" - echo - echo "void z_zexy_setup(void)" - echo "{" +middle_c() { + cat <<EOL + +void z_zexy_setup(void) +{ +EOL } -foot_c() { - echo "}" - echo +tail_c() { + cat <<EOL +} +EOL } -setup_names() { -find . -name "*.c" -not -name zexy.c -not -name z_zexy.c | sort | while read f; do - i=${f##*/} - i=${i%.c} - SETUPNAME=$(echo $i | sed -e "s/.*0x.*/setup_&/g" -e "s/~/_tilde/g" -e "/0x/! s/.*/&_setup/") - if grep -w ${SETUPNAME} $f > /dev/null; then - echo ${SETUPNAME} ${i} - fi -done +get_setup_functions() { + find * -name "*.c" -not -name "* *" -exec grep ZEXY_SETUP {} + \ + | sed -e 's|(.*||' -e 's|:.* | |' \ + | LANG=C sort -u } -################################## -## body -head_h > $ZEXY_H -head_c > $ZEXY_C +forward_declarations() { + get_setup_functions | while read file setup; do + echo "void ${setup}(void); /* ${file} */" + done +} + +call_setup() { + get_setup_functions | while read file setup; do + echo " ${setup}();" + done +} -setup_names | while read SETUPNAME i; do - echo "void ${SETUPNAME}(void); /* $i */" >> $ZEXY_H - echo " ${SETUPNAME}(); /* $i */" >> $ZEXY_C -done -foot_h >> $ZEXY_H -foot_c >> $ZEXY_C +################################## +## body +zexy_c() { + head_c + forward_declarations | "${COLUMN}" -t -c 76 + middle_c + call_setup + tail_c +} +zexy_c | tee "${ZEXY_C}" diff --git a/externals/zexy/src/makesymbol.c b/externals/zexy/src/makesymbol.c index b92eb53a772fc07399983927b2ec78ced594f89c..03a62126d2c043aea7e8ed46d465e55eca138317 100644 --- a/externals/zexy/src/makesymbol.c +++ b/externals/zexy/src/makesymbol.c @@ -47,13 +47,13 @@ /* ----------------------- makesymbol --------------------- */ -static t_class *makesymbol_class; +static t_class *makesymbol_class=NULL; typedef struct _makesymbol { t_object x_obj; t_symbol *x_sym; - char* mask; + const char* mask; char* buf; } t_makesymbol; @@ -70,7 +70,7 @@ static void reset_mask(t_makesymbol *x, t_symbol *s) typedef char cstring[MAXSTRINGLENG]; -static t_symbol* list2symbol(char *masque, int argc, t_atom *argv) +static t_symbol* list2symbol(const char *masque, int argc, t_atom *argv) { cstring*buf=(cstring*)getbytes(MAXSTRINGARGS*sizeof(cstring)); cstring buffer; @@ -146,19 +146,16 @@ static void makesymbol_helper(t_makesymbol* UNUSED(x)) "%s"); } -void makesymbol_setup(void) +ZEXY_SETUP void makesymbol_setup(void) { - makesymbol_class = class_new(gensym("makesymbol"), - (t_newmethod)makesymbol_new, (t_method)makesymbol_free, - sizeof(t_makesymbol), 0, A_GIMME, 0); + makesymbol_class = zexy_new("makesymbol", + makesymbol_new, makesymbol_free, t_makesymbol, 0, "*"); class_addlist(makesymbol_class, makesymbol_list); class_addbang(makesymbol_class, makesymbol_bang); - class_addmethod(makesymbol_class, (t_method)reset_mask, gensym("sym1"), - A_SYMBOL, 0); + zexy_addmethod(makesymbol_class, (t_method)reset_mask, "sym1", "s"); - class_addmethod(makesymbol_class, (t_method)makesymbol_helper, - gensym("help"), 0); + zexy_addmethod(makesymbol_class, (t_method)makesymbol_helper, "help", ""); zexy_register("makesymbol"); } diff --git a/externals/zexy/src/matchbox.c b/externals/zexy/src/matchbox.c index 07899d9ec413578b0bcc2d673c10d80a54c5a83a..59ce26837e17de2b1f71b99149f4012fe94ab5d8 100644 --- a/externals/zexy/src/matchbox.c +++ b/externals/zexy/src/matchbox.c @@ -28,6 +28,7 @@ #include "zexy.h" +#include "zexy_strndup.h" #define MATCHBOX_EXACT 0 #define MATCHBOX_OSC 1 @@ -47,7 +48,7 @@ /* match the atoms of 2 lists */ -static t_class *matchbox_class; +static t_class *matchbox_class=NULL; typedef struct _listlist { @@ -212,8 +213,8 @@ static int OSC_PatternMatch (const char * pattern, const char * test, } case ']' : case '}' : - z_verbose(1, "[matchbox]: spurious %c in OSC-pattern \".../%s/...\"", - pattern[0], theWholePattern); + verbose(1, "[matchbox]: spurious %c in OSC-pattern \".../%s/...\"", + pattern[0], theWholePattern); return FALSE; case '[' : return OSC_MatchBrackets (pattern,test, theWholePattern); @@ -246,8 +247,8 @@ static int OSC_MatchBrackets (const char *pattern, const char *test, const char *p = pattern; if (pattern[1] == 0) { - z_verbose(1, "[matchbox]: unterminated [ in OSC-pattern \".../%s/...\"", - theWholePattern); + verbose(1, "[matchbox]: unterminated [ in OSC-pattern \".../%s/...\"", + theWholePattern); return FALSE; } @@ -258,8 +259,8 @@ static int OSC_MatchBrackets (const char *pattern, const char *test, while (*p != ']') { if (*p == 0) { - z_verbose(1, "[matchbox]: unterminated [ in OSC-pattern \".../%s/...\"", - theWholePattern); + verbose(1, "[matchbox]: unterminated [ in OSC-pattern \".../%s/...\"", + theWholePattern); return FALSE; } if (p[1] == '-' && p[2] != 0) { @@ -285,8 +286,8 @@ advance: while (*p != ']') { if (*p == 0) { - z_verbose(1, "[matchbox]: unterminated [ in OSC-pattern \".../%s/...\"", - theWholePattern); + verbose(1, "[matchbox]: unterminated [ in OSC-pattern \".../%s/...\"", + theWholePattern); return FALSE; } p++; @@ -303,8 +304,8 @@ static int OSC_MatchList (const char *pattern, const char *test, for(restOfPattern = pattern; *restOfPattern != '}'; restOfPattern++) { if (*restOfPattern == 0) { - z_verbose(1, "[matchbox]: unterminated { in OSC-pattern \".../%s/...\"", - theWholePattern); + verbose(1, "[matchbox]: unterminated { in OSC-pattern \".../%s/...\"", + theWholePattern); return FALSE; } } @@ -349,14 +350,16 @@ static int atommatch_osc(t_atom*pattern, t_atom*test) int result = FALSE; if(pattern->a_type==A_SYMBOL) { - s_pattern=pattern->a_w.w_symbol->s_name; + s_pattern=zexy_strndup(pattern->a_w.w_symbol->s_name, MAXPDSTRING); + pattern_size = strnlen(s_pattern, MAXPDSTRING); } else { pattern_size=sizeof(char)*MAXPDSTRING; s_pattern=(char*)getbytes(pattern_size); atom_string(pattern, s_pattern, pattern_size); } if(test->a_type==A_SYMBOL) { - s_test=test->a_w.w_symbol->s_name; + s_test=zexy_strndup(test->a_w.w_symbol->s_name, MAXPDSTRING); + test_size = strnlen(s_test, MAXPDSTRING); } else { test_size=sizeof(char)*MAXPDSTRING; s_test=(char*)getbytes(test_size); @@ -398,7 +401,8 @@ static int atommatch_regex(regex_t*pattern, t_atom*test) } if(test->a_type==A_SYMBOL) { - s_test=test->a_w.w_symbol->s_name; + s_test=zexy_strndup(test->a_w.w_symbol->s_name, MAXPDSTRING); + test_size = strnlen(s_test, MAXPDSTRING); } else { test_size=sizeof(char)*MAXPDSTRING; s_test=(char*)getbytes(test_size); @@ -452,7 +456,8 @@ static t_listlist*matchlistlist_regex(unsigned int*numresults, int pattern_size=0; t_atom*pattern=p_argv+i; if(pattern->a_type==A_SYMBOL) { - s_pattern=pattern->a_w.w_symbol->s_name; + s_pattern=zexy_strndup(pattern->a_w.w_symbol->s_name, MAXPDSTRING); + pattern_size=strnlen(s_pattern, MAXPDSTRING); } else { pattern_size=sizeof(char)*MAXPDSTRING; s_pattern=(char*)getbytes(pattern_size); @@ -460,7 +465,7 @@ static t_listlist*matchlistlist_regex(unsigned int*numresults, } regexpressions[i]=(regex_t*)getbytes(sizeof(regex_t)); if(regcomp(regexpressions[i], s_pattern, flags)) { - z_verbose(1, "[matchbox]: invalid regular expression: %s", s_pattern); + verbose(1, "[matchbox]: invalid regular expression: %s", s_pattern); if(regexpressions[i]) { freebytes(regexpressions[i], sizeof(regex_t)); } @@ -593,7 +598,8 @@ static t_listlist*matchlistlist(unsigned int*numresults, } -static void matchbox_list(t_matchbox*x, t_symbol*s, int argc, t_atom*argv) +static void matchbox_list(t_matchbox*x, t_symbol*UNUSED(s), int argc, + t_atom*argv) { unsigned int results=0; int mode=x->x_mode; @@ -609,13 +615,14 @@ static void matchbox_list(t_matchbox*x, t_symbol*s, int argc, t_atom*argv) } } -static void matchbox_add(t_matchbox*x, t_symbol*s, int argc, t_atom*argv) +static void matchbox_add(t_matchbox*x, t_symbol*UNUSED(s), int argc, + t_atom*argv) { /* 1st match, whether we already have this entry */ if(matchlistlist(0, x->x_lists, argc, argv, MATCHBOX_EXACT, FALSE)) { /* already there, skip the rest */ - z_verbose(1, - "[matchbox]: refusing to add already existing list to buffer..."); + verbose(1, + "[matchbox]: refusing to add already existing list to buffer..."); return; } @@ -624,7 +631,7 @@ static void matchbox_add(t_matchbox*x, t_symbol*s, int argc, t_atom*argv) x->x_numlists++; } -static void matchbox_delete(t_matchbox*x, t_symbol*s, int argc, +static void matchbox_delete(t_matchbox*x, t_symbol*UNUSED(s), int argc, t_atom*argv) { unsigned int results=0; @@ -691,7 +698,7 @@ static void matchbox_mode(t_matchbox*x, t_symbol*s) } } -static void *matchbox_new(t_symbol *s, int argc, t_atom*argv) +static void *matchbox_new(t_symbol *UNUSED(s), int argc, t_atom*argv) { t_matchbox *x = (t_matchbox *)pd_new(matchbox_class); @@ -724,36 +731,30 @@ static void matchbox_free(t_matchbox *x) x->x_lists=0; } -static void matchbox_help(t_matchbox*x) +static void matchbox_help(t_matchbox*UNUSED(x)) { post("\n"HEARTSYMBOL " matchbox\t\t:: find a list in a pool of lists"); } -void matchbox_setup(void) +ZEXY_SETUP void matchbox_setup(void) { #ifdef MATCHBOX_OSC post("matchbox: OSC-pattern matching code (c) Matt Wright, CNMAT"); #endif /* MATCHBOX_OSC */ - matchbox_class = class_new(gensym("matchbox"), (t_newmethod)matchbox_new, - (t_method)matchbox_free, sizeof(t_matchbox), 0, A_GIMME, 0); + matchbox_class = zexy_new("matchbox", + matchbox_new, matchbox_free, t_matchbox, 0, "*"); class_addlist (matchbox_class, matchbox_list); - class_addmethod(matchbox_class, (t_method)matchbox_add, gensym("add"), - A_GIMME, 0); - class_addmethod(matchbox_class, (t_method)matchbox_delete, - gensym("delete"), A_GIMME, 0); - class_addmethod(matchbox_class, (t_method)matchbox_clear, gensym("clear"), - A_NULL, 0); - class_addmethod(matchbox_class, (t_method)matchbox_dump, gensym("dump"), - A_NULL); + zexy_addmethod(matchbox_class, (t_method)matchbox_add, "add", "*"); + zexy_addmethod(matchbox_class, (t_method)matchbox_delete, "delete", "*"); + zexy_addmethod(matchbox_class, (t_method)matchbox_clear, "clear", ""); + zexy_addmethod(matchbox_class, (t_method)matchbox_dump, "dump", ""); - class_addmethod(matchbox_class, (t_method)matchbox_mode, gensym("mode"), - A_SYMBOL, 0); + zexy_addmethod(matchbox_class, (t_method)matchbox_mode, "mode", "s"); - class_addmethod(matchbox_class, (t_method)matchbox_help, gensym("help"), - A_NULL); + zexy_addmethod(matchbox_class, (t_method)matchbox_help, "help", ""); zexy_register("matchbox"); } diff --git a/externals/zexy/src/mavg.c b/externals/zexy/src/mavg.c index 943dbb60378cef422865ab2c439e82b87077f2f2..9f45d8f61838018cc50179b24aff57651bcf0693 100644 --- a/externals/zexy/src/mavg.c +++ b/externals/zexy/src/mavg.c @@ -19,7 +19,7 @@ #include "zexy.h" -static t_class *mavg_class; +static t_class *mavg_class=NULL; typedef struct _mavg { t_object x_obj; @@ -32,21 +32,25 @@ typedef struct _mavg { static void mavg_resize(t_mavg *x, t_float f) { - int i; + int i = (int)f; t_float *dumbuf; - f = (int)f; - if ((f<1) || (f == x->size)) { + if ((i<1) || (i == x->size)) { return; } - freebytes(x->buf, sizeof(t_float)*x->size); - x->n_inv = 1.0/f; - x->size = f; - x->buf = getbytes(sizeof(t_float)*x->size); + dumbuf = getbytes(sizeof(t_float)*i); + if(!dumbuf) { + pd_error(x, "unable to allocate memory for %d elements", i); + return; + } + if(x->buf) { + freebytes(x->buf, sizeof(t_float)*x->size); + } + x->buf = x->wp = dumbuf; + x->size = i; + x->n_inv = 1.0/(t_float)i; - dumbuf = x->wp = x->buf; - i = x->size; while(i--) { *dumbuf++ = x->avg; } @@ -58,6 +62,9 @@ static void mavg_set(t_mavg *x, t_symbol* UNUSED(s), int argc, int i = x->size; t_float *dummy = x->buf; t_float f=(argc)?atom_getfloat(argv):x->avg; + if(!x->buf) { + return; + } while (i--) { *dummy++=f; @@ -71,6 +78,9 @@ static void mavg_float(t_mavg *x, t_float f) int i = x->size; t_float dummy = 0; t_float *dumb = x->buf; + if(!x->buf) { + return; + } *x->wp++ = f; if (x->wp == x->buf + x->size) { @@ -90,19 +100,15 @@ static void *mavg_new(t_floatarg f) { t_mavg *x = (t_mavg *)pd_new(mavg_class); int i = (f<1)?2:f; - t_float *dumbuf; outlet_new(&x->x_obj, gensym("float")); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("")); + x->size = 0; + x->buf = x->wp = NULL; + x->n_inv = 0.; + x->avg = 0.; - x->buf = x->wp = (t_float *)getbytes(sizeof(t_float) * i); - x->size = i; - x->n_inv = 1.0f/(t_float)i; - - dumbuf = x->buf; - while (i--) { - *dumbuf++=0; - } + mavg_resize(x, i); return (x); } @@ -112,17 +118,16 @@ static void mavg_help(void) post("mavg\t:: moving average filter"); } -void mavg_setup(void) +ZEXY_SETUP void mavg_setup(void) { - mavg_class = class_new(gensym("mavg"), (t_newmethod)mavg_new, 0, - sizeof(t_mavg), 0, A_DEFFLOAT, 0); + mavg_class = zexy_new("mavg", + mavg_new, 0, t_mavg, 0, "F"); class_addfloat(mavg_class, (t_method)mavg_float); - class_addmethod(mavg_class, (t_method)mavg_help, gensym("help"), 0); - class_addmethod(mavg_class, (t_method)mavg_set, gensym("set"), A_GIMME, 0); - class_addmethod(mavg_class, (t_method)mavg_resize, gensym(""), A_DEFFLOAT, - 0); + zexy_addmethod(mavg_class, (t_method)mavg_help, "help", ""); + zexy_addmethod(mavg_class, (t_method)mavg_set, "set", "*"); + zexy_addmethod(mavg_class, (t_method)mavg_resize, "", "F"); zexy_register("mavg"); } diff --git a/externals/zexy/src/minmax.c b/externals/zexy/src/minmax.c index 4dfb6f927b58417a3f7626ecf9e9bfa11b1945aa..39c4103b9d4d26d52d2971fb71c58097933f0017 100644 --- a/externals/zexy/src/minmax.c +++ b/externals/zexy/src/minmax.c @@ -20,7 +20,7 @@ #include "zexy.h" -static t_class *minmax_class; +static t_class *minmax_class=NULL; typedef struct _minmax { t_object x_obj; @@ -76,14 +76,14 @@ static void minmax_help(void) post("minmax\t:: get minimum and maximum of a list of floats"); } -void minmax_setup(void) +ZEXY_SETUP void minmax_setup(void) { - minmax_class = class_new(gensym("minmax"), (t_newmethod)minmax_new, 0, - sizeof(t_minmax), 0, A_DEFFLOAT, 0); + minmax_class = zexy_new("minmax", + minmax_new, 0, t_minmax, 0, ""); class_addlist(minmax_class, (t_method)minmax_list); class_addbang(minmax_class, (t_method)minmax_bang); - class_addmethod(minmax_class, (t_method)minmax_help, gensym("help"), 0); + zexy_addmethod(minmax_class, (t_method)minmax_help, "help", ""); zexy_register("minmax"); } diff --git a/externals/zexy/src/msgfile.c b/externals/zexy/src/msgfile.c index 9fa3604ca89de41b00e7d756175d2fae6f81ccd0..8fefdaaf17be12d3303ac14be3dbc22143f92604 100644 --- a/externals/zexy/src/msgfile.c +++ b/externals/zexy/src/msgfile.c @@ -42,17 +42,33 @@ /* ****************************************************************************** */ /* msgfile : save and load messages... */ -#define PD_MODE 0 -#define CR_MODE 1 -#define CSV_MODE 2 -/* modi - PD : separate items by ' '; seperate lines by ";\n" - looks like a PD-file - CR : separate items by ' '; seperate lines by " \n" - how you would expect a file to look like - CSV: separate items by ','; seperate lines by " \n" - spreadsheet: each argument gets its own column -*/ +typedef enum { + /* PD + * separate items by whitespace (' ', '\t'), separate lines by ";" + * looks like a Pd-file */ + FORMAT_PD = 0, + /* FUDI + * separate items by whitespace (' ', '\t'), separate lines by ";" + * looks like a Pd-file, but uses our own parser (to better handle escaped linebreaks) */ + FORMAT_FUDI = 0, + /* CR + * separate items by whitespace (' ', '\t'), separate lines by linebreaks ("\n") + * how you would expect a file to look like + * (use Pd's parser that has some quirks with escaped linebreaks) */ + FORMAT_CR, + /* TXT: + * separate items by whitespace (' ', '\t'), separate lines by "\n" + * how you would expect a file to look like + * (uses our own parser that handles escaped '\n' better!) */ + FORMAT_TXT, + /* CSV: separate items by ','; separate lines by " \n" + * spreadsheet: each argument gets its own column + * with proper escaping of everything */ + FORMAT_CSV, + + /* illegal format */ + FORMAT_ILLEGAL, +} t_msgfile_format; typedef struct _msglist { @@ -67,7 +83,7 @@ typedef struct _msgfile { t_object x_obj; /* everything */ t_outlet *x_secondout; /* "done" */ - int mode; + t_msgfile_format format; t_msglist *start; @@ -81,7 +97,7 @@ typedef struct _msgfile { } t_msgfile; -static t_class *msgfile_class; +static t_class *msgfile_class=NULL; @@ -94,7 +110,47 @@ static void msgfile_end(t_msgfile *x); static void msgfile_goto(t_msgfile *x, t_float f); /* ************************************************************************ */ -/* help functions */ +/* helper functions */ + +static t_msgfile_format symbol2format(t_msgfile*x, t_symbol*s) +{ + if (!s || gensym("")==s) { + return x->format; + } + if (gensym("pd")==s) { + return FORMAT_PD; + } + if (gensym("fudi")==s) { + return FORMAT_FUDI; + } + if (gensym("cr")==s) { + return FORMAT_CR; + } + if (gensym("txt")==s) { + return FORMAT_TXT; + } + if (gensym("csv")==s) { + return FORMAT_CSV; + } + pd_error(x, "msgfile: ignoring unknown format: '%s'", s->s_name); + return x->format; +} + +static int is_float(t_atom*a) +{ + return (a && A_FLOAT == a->a_type); +} + +static int node_count(t_msgfile *x) +{ + t_msglist *dummy = x->start; + unsigned int counter = 0; + while (dummy && dummy->next) { + counter++; + dummy = dummy->next; + } + return counter; +} static int node_wherearewe(t_msgfile *x) { @@ -128,12 +184,14 @@ static void write_currentnode(t_msgfile *x, int ac, t_atom *av) newsize = cur->n + ac; - ap = (t_atom *)getbytes(newsize * sizeof(t_atom)); - memcpy(ap, cur->thislist, cur->n * sizeof(t_atom)); - cur->thislist = ap; - memcpy(cur->thislist + cur->n, av, ac * sizeof(t_atom)); + ap = (t_atom*)resizebytes(cur->thislist, cur->n * sizeof(t_atom), + newsize * sizeof(t_atom)); + if (ap) { + cur->thislist = ap; + memcpy(cur->thislist + cur->n, av, ac * sizeof(t_atom)); - cur->n = newsize; + cur->n = newsize; + } } static void delete_currentnode(t_msgfile *x) @@ -271,14 +329,7 @@ static void delete_region(t_msgfile *x, int start, int stop) int newwhere, oldwhere = node_wherearewe(x); /* get the number of lists in the buffer */ - t_msglist *dummy = x->start; - int counter = 0; - - /* go to the end of the buffer */ - while (dummy && dummy->next) { - counter++; - dummy = dummy->next; - } + int counter = node_count(x); if ((stop > counter) || (stop == -1)) { stop = counter; @@ -332,25 +383,350 @@ static int atomcmp(t_atom *this, t_atom *that) } -static void msgfile_binbuf2listbuf(t_msgfile *x, t_binbuf *bbuf) +static t_atomtype str2atom(const char*atombuf, t_atom*ap, + int force_symbol) +{ + if(!force_symbol) { + double f = 0; + unsigned int count=0; + int x = sscanf(atombuf, "%lg%n", &f, &count); + if(x && strlen(atombuf)==count) { + SETFLOAT(ap, f); + return A_FLOAT; + } + } + SETSYMBOL(ap, gensym(atombuf)); + return A_SYMBOL; +} + +static const char*parse_csv(const char*src, char dst[MAXPDSTRING], + int *_eol, int*_quoted) +{ + size_t len = 0; + int quoted = (src[0] == '"'); + *_eol = 0; + *_quoted = quoted; + if (quoted) { + src++; + } + + while(*src) { + if (!quoted || '"' == src[0]) { + switch (src[quoted]) { + default: + break; + case '\n': /* EOL */ + *_eol = 1; + /* fallthrough */ + case ',': /* EOC */ + if(len<MAXPDSTRING) { + dst[len++]=0; + } + dst[MAXPDSTRING-1] = 0; + return src+1+quoted; + case '"': /* quote */ + if(quoted) { + src++; + } + break; + } + } + if(len<MAXPDSTRING) { + dst[len++]=*src; + } + src++; + } + dst[MAXPDSTRING-1] = 0; + return src; +} + +static const char*parse_fudi(const char*src, char dst[MAXPDSTRING], + int *_eol, int*_quoted) { - int ac = binbuf_getnatom(bbuf); - t_atom *ap = binbuf_getvec(bbuf); + size_t len = 0; + *_quoted = 0; + *_eol = 0; + + while(*src) { + char c = *src++; + char c2; + switch (c) { + case '\\': /* quoting */ + c2=c; + c=*src++; + switch(c) { + case ',': + case ';': + case '\t': + case ' ': + case '\n': + case '\r': + break; + default: + if(len<MAXPDSTRING) { + dst[len++]=c2; + } + break; + } + break; + case ';': + *_eol = 1; + case '\n': + case '\r': /* EOL/EOA */ + case '\t': + case ' ': /* EOA */ + goto atomend; + break; + } + if(len<MAXPDSTRING) { + dst[len++]=c; + } + } +atomend: + if(len<MAXPDSTRING) { + dst[len++]=0; + } - while (ac--) { - if (ap->a_type == A_SEMI) { + while(*src) { + switch(*src) { + /* skip remaining whitespace */ + case '\n': + case '\r': + case ' ': + case '\t': + break; + default: + return src; + } + src++; + } + return src; +} + +static const char*parse_txt(const char*src, char dst[MAXPDSTRING], + int *_eol, int*_quoted) +{ + size_t len = 0; + *_quoted = 0; + *_eol = 0; + + while(*src) { + char c = *src++; + char c2; + switch (c) { + case '\\': /* quoting */ + c2=c; + c=*src++; + switch(c) { + case ',': + case ';': + case '\t': + case ' ': + case '\n': + case '\r': + break; + default: + if(len<MAXPDSTRING) { + dst[len++]=c2; + } + break; + } + break; + case '\n': + case '\r': /* EOL/EOA */ + *_eol = 1; + case '\t': + case ' ': /* EOA */ + goto atomend; + break; + } + if(len<MAXPDSTRING) { + dst[len++]=c; + } + } +atomend: + if(len<MAXPDSTRING) { + dst[len++]=0; + } + + while(*src) { + switch(*src) { + /* skip remaining whitespace */ + case '\n': + case '\r': + *_eol = 1; + case ' ': + case '\t': + break; + default: + return src; + } + src++; + } + return src; +} + +typedef const char*(*t_parsefn)(const char*src, char dst[MAXPDSTRING], + int *_eol, int*_symbol); + +static void msgfile_str2parse(t_msgfile *x, const char*src, + t_parsefn parsefn) +{ + t_binbuf*bbuf=binbuf_new(); + char atombuf[MAXPDSTRING + 1]; + while(*src) { + int issymbol = 0; + int iseol = 0; + src = parsefn(src, atombuf, &iseol, &issymbol); + atombuf[MAXPDSTRING] = 0; + if(*atombuf) { + t_atom a; + str2atom(atombuf, &a, issymbol); + binbuf_add(bbuf, 1, &a); + } + if(iseol) { + t_atom*argv = binbuf_getvec(bbuf); + int argc = binbuf_getnatom(bbuf); add_currentnode(x); - } else { - write_currentnode(x, 1, ap); + write_currentnode(x, argc, argv); + binbuf_clear(bbuf); } - ap++; } + do { + t_atom*argv = binbuf_getvec(bbuf); + int argc = binbuf_getnatom(bbuf); + if(argc) { + add_currentnode(x); + write_currentnode(x, argc, argv); + } + } while(0); + binbuf_free(bbuf); delete_emptynodes(x); } +static int nextsemi(t_atom*argv, int argc) +{ + int count = 0; + for(count=0; count<argc; count++) { + if (A_SEMI==argv[count].a_type) { + return count + 1; + } + } + return 0; +} +static void msgfile_addbinbuf(t_msgfile *x, t_binbuf*bbuf) +{ + t_atom*argv = binbuf_getvec(bbuf); + int argc = binbuf_getnatom(bbuf); + while(argc>0) { + int next = nextsemi(argv, argc); + if(next>1) { + add_currentnode(x); + write_currentnode(x, next-1, argv); + } else if (next<1) { + add_currentnode(x); + write_currentnode(x, argc, argv); + break; + } + argv+=next; + argc-=next; + } + delete_emptynodes(x); +} + +static char* escape_pd(const char*src, char*dst) +{ + /* ',' -> '\,'; ' ' -> '\ ' */ + char*dptr = dst; + while(*src) { + switch(*src) { + default: + break; +#if 0 + /* Pd already escapes these for us... */ + case ',': + case ';': +#endif + case ' ': + case '\n': + case '\r': + case '\t': + *dptr++ = '\\'; + break; + case 0: + *dptr++ = 0; + return dst; + } + *dptr++=*src++; + } + *dptr++ = 0; + return dst; +} +static char* escape_csv(const char*src, char*dst) +{ + /* if there are special characters in the string, quote everything */ + int needsquotes = 0; + const char*sptr; + char*dptr = dst; + for(sptr = src; *sptr; sptr++) { + switch(*sptr) { + default: + break; + case ',': + case '"': + case '\n': + needsquotes = 1; + break; + } + if(needsquotes) { + break; + } + } + if (needsquotes) { + *dptr++ = '"'; + } + + for(sptr = src; *sptr; sptr++) { + switch(*sptr) { + default: + break; + + /* unescape "\," and "\;" */ + case '\\': + switch(sptr[1]) { + default: + break; + case ',': + case ';': + case '\\': + sptr++; + break; + } + break; + } + + /* escape quotes */ + switch(*sptr) { + default: + break; + case '"': + *dptr++ = '"'; + break; + } + *dptr++=*sptr; + } + + if (needsquotes) { + *dptr++ = '"'; + } + *dptr++ = 0; + return dst; +} + +typedef char*(*t_escapefn)(const char*src, char*dst); /* ************************************************************************ */ @@ -427,10 +803,31 @@ static void msgfile_clear(t_msgfile *x) } } -static void msgfile_delete(t_msgfile *x, t_symbol *s, int ac, t_atom *av) +static int atom2rangeint(t_atom*a, int range) { + t_float f = atom_getfloat(a); + if (f>range) { + return range; + } + if (f<-range) { + return -range; + } + return (unsigned int)f; +} +static void msgfile_delete(t_msgfile *x, t_symbol *UNUSED(s), int ac, + t_atom *av) +{ + int count = node_count(x); + int pos = atom2rangeint(av+0, count); + if (!is_float(av)) { + pd_error(x, "[msgfile] illegal deletion index %s", + atom_getsymbol(av)->s_name); + return; + } + if (count<1) { + return; + } if (ac==1) { - int pos = atom_getfloat(av); int oldwhere = node_wherearewe(x); if (pos<0) { @@ -443,8 +840,13 @@ static void msgfile_delete(t_msgfile *x, t_symbol *s, int ac, t_atom *av) delete_currentnode(x); msgfile_goto(x, oldwhere); } else if (ac==2) { - int pos1 = atom_getfloat(av++); - int pos2 = atom_getfloat(av); + int pos1 = pos; + int pos2 = atom2rangeint(av+1, count); + if (!is_float(av+1)) { + pd_error(x, "[msgfile] illegal deletion range %s", + atom_getsymbol(av+1)->s_name); + return; + } if ((pos1 < pos2) || (pos2 == -1)) { if (pos2+1) { @@ -461,13 +863,15 @@ static void msgfile_delete(t_msgfile *x, t_symbol *s, int ac, t_atom *av) } } -static void msgfile_add(t_msgfile *x, t_symbol *s, int ac, t_atom *av) +static void msgfile_add(t_msgfile *x, t_symbol *UNUSED(s), int ac, + t_atom *av) { msgfile_end(x); add_currentnode(x); write_currentnode(x, ac, av); } -static void msgfile_add2(t_msgfile *x, t_symbol *s, int ac, t_atom *av) +static void msgfile_add2(t_msgfile *x, t_symbol *UNUSED(s), int ac, + t_atom *av) { msgfile_end(x); if (x->current) { @@ -483,7 +887,8 @@ static void msgfile_add2(t_msgfile *x, t_symbol *s, int ac, t_atom *av) x->current = x->current->next; } } -static void msgfile_append(t_msgfile *x, t_symbol *s, int ac, t_atom *av) +static void msgfile_append(t_msgfile *x, t_symbol *UNUSED(s), int ac, + t_atom *av) { add_currentnode(x); write_currentnode(x, ac, av); @@ -500,14 +905,16 @@ static void msgfile_append2(t_msgfile *x, t_symbol *s, int ac, t_atom *av) msgfile_append(x, s, ac, av); } } -static void msgfile_insert(t_msgfile *x, t_symbol *s, int ac, t_atom *av) +static void msgfile_insert(t_msgfile *x, t_symbol *UNUSED(s), int ac, + t_atom *av) { t_msglist *cur = x->current; insert_currentnode(x); write_currentnode(x, ac, av); x->current = cur; } -static void msgfile_insert2(t_msgfile *x, t_symbol *s, int ac, t_atom *av) +static void msgfile_insert2(t_msgfile *x, t_symbol *UNUSED(s), int ac, + t_atom *av) { t_msglist *cur = x->current; if ((x->current) && (x->current->previous)) { @@ -523,7 +930,8 @@ static void msgfile_set(t_msgfile *x, t_symbol *s, int ac, t_atom *av) msgfile_add(x, s, ac, av); } -static void msgfile_replace(t_msgfile *x, t_symbol *s, int ac, t_atom *av) +static void msgfile_replace(t_msgfile *x, t_symbol *UNUSED(s), int ac, + t_atom *av) { if(x->current) { if(x->current->thislist) { @@ -600,7 +1008,8 @@ static void msgfile_bang(t_msgfile *x) } } -static void msgfile_find(t_msgfile *x, t_symbol *s, int ac, t_atom *av) +static void msgfile_find(t_msgfile *x, t_symbol *UNUSED(s), int ac, + t_atom *av) { t_msglist *found = 0; t_msglist *cur=x->current; @@ -663,8 +1072,8 @@ static void msgfile_where(t_msgfile *x) static void msgfile_sort(t_msgfile *x, t_symbol *s0, t_symbol*s1, t_symbol*r) { - post("sorting not implemented yet: '%s', '%s' -> '%s'", s0->s_name, - s1->s_name, r->s_name); + pd_error(x, "sorting not implemented yet: '%s', '%s' -> '%s'", s0->s_name, + s1->s_name, r->s_name); #if 0 @@ -707,47 +1116,76 @@ static void msgfile_sort(t_msgfile *x, t_symbol *s0, t_symbol*s1, /* file I/O */ static void msgfile_read2(t_msgfile *x, t_symbol *filename, - t_symbol *format) + t_symbol *sformat) { int rmode = 0; int fd=0; FILE*fil=NULL; - long readlength, length, pos; + long readlength, length; char filnam[MAXPDSTRING]; char buf[MAXPDSTRING], *bufptr, *readbuf; - char *charbinbuf=NULL, *cbb; - int charbinbuflength=0; - char*dirname=canvas_getdir(x->x_canvas)->s_name; + const char*dirname=canvas_getdir(x->x_canvas)->s_name; + t_parsefn parsefn = 0; - int mode = x->mode; - char separator, eol; - - t_binbuf *bbuf = binbuf_new(); + t_msgfile_format format = symbol2format(x, sformat); #ifdef __WIN32__ rmode |= O_BINARY; #endif + switch(format) { + case FORMAT_CSV: + parsefn = parse_csv; + break; + case FORMAT_TXT: + parsefn = parse_txt; + break; + case FORMAT_FUDI: + parsefn = parse_fudi; + break; + default: + parsefn = 0; + } + + if( !parsefn ) { + /* use Pd's own parser + * this gives somewhat weird results with escaped LF, + * but is consistent with how [textfile] reads the data + */ + t_binbuf*bbuf = binbuf_new(); + binbuf_read_via_canvas(bbuf, filename->s_name, x->x_canvas, + (FORMAT_CR == format)); + msgfile_addbinbuf(x, bbuf); + binbuf_free(bbuf); + return; + } + + /* cannot use Pd's binbuf parser, so we do our own thing */ + fd = open_via_path(dirname, filename->s_name, "", buf, &bufptr, MAXPDSTRING, 0); if (fd < 0) { /* open via path failed, fall back */ - fd=z_open(filename->s_name, rmode); + fd=sys_open(filename->s_name, rmode); if(fd < 0) { pd_error(x, "can't open in %s/%s", dirname, filename->s_name); return; } else { - z_close(fd); - sprintf(filnam, "%s", filename->s_name); + sys_close(fd); + snprintf(filnam, MAXPDSTRING, "%s", filename->s_name); } } else { - z_close(fd); - sprintf(filnam, "%s/%s", buf, bufptr); + sys_close(fd); + if(snprintf(filnam, MAXPDSTRING, "%s/%s", buf, bufptr) < 0) { + pd_error(x, "can't create in '%s/%s'", buf, bufptr); + return; + } } + filnam[MAXPDSTRING-1]=0; - fil=z_fopen(filnam, "rb"); + fil=sys_fopen(filnam, "rb"); if(fil==NULL) { pd_error(x, "could not open '%s'", filnam); return; @@ -756,95 +1194,30 @@ static void msgfile_read2(t_msgfile *x, t_symbol *filename, length=ftell(fil); fseek(fil, 0, SEEK_SET); - if (!(readbuf = t_getbytes(length))) { + if (!(readbuf = t_getbytes(length+1))) { pd_error(x, "msgfile_read: could not reserve %ld bytes to read into", length); - z_fclose(fil); + sys_fclose(fil); return; } - if (gensym("cr")==format) { - mode = CR_MODE; - } else if (gensym("csv")==format) { - mode = CSV_MODE; - } else if (gensym("pd")==format) { - mode = PD_MODE; - } else if (*format->s_name) { - pd_error(x, "msgfile_read: unknown flag: %s", format->s_name); - } - - switch (mode) { - case CR_MODE: - separator = ' '; - eol = '\n'; - break; - case CSV_MODE: - separator = ','; - eol = ' '; - break; - default: - separator = '\n'; - eol = ';'; - break; - } - /* read */ if ((readlength = fread(readbuf, sizeof(char), length, fil)) < length) { pd_error(x, "msgfile_read: unable to read %s: %ld of %ld", filnam, readlength, length); - z_fclose(fil); - t_freebytes(readbuf, length); + sys_fclose(fil); + t_freebytes(readbuf, length+1); return; } - /* close */ - z_fclose(fil); - - /* convert separators and eols to what pd expects in a binbuf*/ - bufptr=readbuf; - -# define MSGFILE_HEADROOM 1024 - charbinbuflength=2*length+MSGFILE_HEADROOM; - - charbinbuf=(char*)getbytes(charbinbuflength); - - cbb=charbinbuf; - for(pos=0; pos<charbinbuflength; pos++) { - charbinbuf[pos]=0; - } - - *cbb++=';'; - pos=1; - while (readlength--) { - if(pos>=charbinbuflength) { - pd_error(x, "msgfile: read error (headroom %d too small!)", - MSGFILE_HEADROOM); - goto read_error; - break; - } - if (*bufptr == separator) { - *cbb = ' '; - } else if (*bufptr==eol) { - *cbb++=';'; - pos++; - *cbb='\n'; - } else { - *cbb=*bufptr; - } + sys_fclose(fil); - bufptr++; - cbb++; - pos++; - } + /* we overallocated readbuf by 1, so we can store a terminating 0 */ + readbuf[length] = 0; - /* convert to binbuf */ - binbuf_text(bbuf, charbinbuf, charbinbuflength); - msgfile_binbuf2listbuf(x, bbuf); + msgfile_str2parse(x, readbuf, parsefn); -read_error: - binbuf_free(bbuf); - t_freebytes(readbuf, length); - t_freebytes(charbinbuf, charbinbuflength); + t_freebytes(readbuf, length+1); } static void msgfile_read(t_msgfile *x, t_symbol *filename, t_symbol *format) @@ -853,48 +1226,31 @@ static void msgfile_read(t_msgfile *x, t_symbol *filename, msgfile_read2(x, filename, format); } + static void msgfile_write(t_msgfile *x, t_symbol *filename, - t_symbol *format) + t_symbol *sformat) { char buf[MAXPDSTRING]; - t_binbuf *bbuf = binbuf_new(); t_msglist *cur = x->start; - char *mytext = 0, *dumtext; char filnam[MAXPDSTRING]; - int textlen = 0, i; - char separator, eol; - int mode = x->mode; + t_msgfile_format format = symbol2format(x, sformat); + int errcount = 0; + t_escapefn escapefn = escape_pd; FILE *f=0; - while(cur) { - binbuf_add(bbuf, cur->n, cur->thislist); - binbuf_addsemi(bbuf); - cur = cur->next; - } - - if(format&&gensym("")!=format) { - if(gensym("cr")==format) { - mode = CR_MODE; - } else if(gensym("csv")==format) { - mode = CSV_MODE; - } else if(gensym("pd")==format) { - mode = PD_MODE; - } else if(format&&format->s_name) { - pd_error(x, "msgfile_write: ignoring unknown flag: %s", format->s_name); - } - } - - switch (mode) { - case CR_MODE: + switch (format) { + case FORMAT_TXT: + case FORMAT_CR: separator = ' '; - eol = ' '; + eol = 0; break; - case CSV_MODE: + case FORMAT_CSV: separator = ','; - eol = ' '; + eol = 0; + escapefn = escape_csv; break; default: separator = ' '; @@ -902,37 +1258,54 @@ static void msgfile_write(t_msgfile *x, t_symbol *filename, break; } - binbuf_gettext(bbuf, &mytext, &textlen); - dumtext = mytext; - i = textlen; - - while(i--) { - if (*dumtext==' ') { - *dumtext=separator; - } else if ((*dumtext==';') && (dumtext[1]=='\n')) { - *dumtext = eol; - } - dumtext++; - } /* open */ canvas_makefilename(x->x_canvas, filename->s_name, buf, MAXPDSTRING); sys_bashfilename(buf, filnam); - if (!(f = z_fopen(filnam, "w"))) { + f = sys_fopen(filnam, "w"); + if (!f) { pd_error(x, "msgfile : failed to open %s", filnam); - } else { - /* write */ - if (fwrite(mytext, textlen*sizeof(char), 1, f) < 1) { - pd_error(x, "msgfile : failed to write %s", filnam); - } + return; } - /* close */ - if (f) { - z_fclose(f); + + for(cur = x->start; cur; cur=cur->next) { + int i; + for(i=0; i<cur->n; i++) { + t_atom*a = cur->thislist + i; + switch(a->a_type) { + case A_FLOAT: + errcount += (fprintf(f, "%g", atom_getfloat(a)) < 1); + break; + case A_POINTER: + errcount += (fprintf(f, "%p", a->a_w.w_gpointer) < 1); + break; + default: { + int mylen = 0; + char mytext[MAXPDSTRING]; + char mytext2[MAXPDSTRING*2]; + atom_string(a, mytext, MAXPDSTRING); + escapefn(mytext, mytext2); + mylen = strnlen(mytext2, MAXPDSTRING); + errcount += (fwrite(mytext2, mylen, sizeof(char), f) < 1); + } + } + if(i + 1 < cur->n) { + errcount += (fwrite(&separator, sizeof(char), 1, f) < 1); + } + } + if(eol) { + errcount += (fwrite(&eol, sizeof(char), 1, f) < 1); + } + errcount += (fwrite("\n", sizeof(char), 1, f) < 1); } - binbuf_free(bbuf); + if (errcount > 0) { + pd_error(x, "msgfile : failed to write '%s': % d errors", filnam, + errcount); + } + /* close */ + sys_fclose(f); } /* ********************************** */ @@ -947,8 +1320,8 @@ static void msgfile_print(t_msgfile *x) while (cur) { t_msglist *dum=cur; int i; - j++; startpost("line %d:", j); + j++; for (i = 0; i < dum->n; i++) { t_atom *a = dum->thislist + i; postatom(1, a); @@ -958,7 +1331,7 @@ static void msgfile_print(t_msgfile *x) } } -static void msgfile_help(t_msgfile *x) +static void msgfile_help(t_msgfile *UNUSED(x)) { post("\n"HEARTSYMBOL " msgfile\t:: handle and store files of lists"); post("goto <n>\t: goto line <n>" @@ -984,10 +1357,10 @@ static void msgfile_help(t_msgfile *x) "\nfind <list>\t: search for <list>" "\nread <file> [<format>]\t: read <file> as <format>" "\nwrite <file> [<format>]\t: write <file> as <format>" - "\n\t\t: valid <formats> are\t: PD, CR, CSV" + "\n\t\t: valid <formats> are\t: pd, cr, fudi, txt, csv" "\n\nprint\t\t: show buffer (for debugging)" "\nhelp\t\t: show this help"); - post("creation: \"msgfile [<format>]\": <format> defines fileaccess-mode(default is PD)"); + post("creation: \"msgfile [<format>]\": <format> defines fileaccess-mode(default is 'pd')"); } static void msgfile_free(t_msgfile *x) { @@ -995,7 +1368,7 @@ static void msgfile_free(t_msgfile *x) freebytes(x->current, sizeof(t_msglist)); } -static void *msgfile_new(t_symbol *s, int argc, t_atom *argv) +static void *msgfile_new(t_symbol *UNUSED(s), int argc, t_atom *argv) { t_msgfile *x = (t_msgfile *)pd_new(msgfile_class); @@ -1004,19 +1377,10 @@ static void *msgfile_new(t_symbol *s, int argc, t_atom *argv) x->start = 0; x->previous= 0; - x->mode=PD_MODE; /* that's the default */ + x->format=FORMAT_PD; /* that's the default */ if ((argc==1) && (argv->a_type == A_SYMBOL)) { - t_symbol*mode=atom_getsymbol(argv); - if (gensym("cr") == mode) { - x->mode = CR_MODE; - } else if (gensym("csv")== mode) { - x->mode = CSV_MODE; - } else if (gensym("pd") == mode) { - x->mode = PD_MODE; - } else { - pd_error(x, "msgfile: unknown argument %s", argv->a_w.w_symbol->s_name); - } + x->format = symbol2format(x, atom_getsymbol(argv)); } outlet_new(&x->x_obj, gensym("list")); @@ -1029,74 +1393,49 @@ static void *msgfile_new(t_symbol *s, int argc, t_atom *argv) return (x); } -void msgfile_setup(void) +ZEXY_SETUP void msgfile_setup(void) { - msgfile_class = class_new(gensym("msgfile"), (t_newmethod)msgfile_new, - (t_method)msgfile_free, sizeof(t_msgfile), 0, A_GIMME, 0); - class_addmethod(msgfile_class, (t_method)msgfile_goto, gensym("goto"), - A_DEFFLOAT, 0); - class_addmethod(msgfile_class, (t_method)msgfile_rewind, gensym("rewind"), - 0); - class_addmethod(msgfile_class, (t_method)msgfile_rewind, gensym("begin"), - 0); - class_addmethod(msgfile_class, (t_method)msgfile_end, gensym("end"), 0); - - class_addmethod(msgfile_class, (t_method)msgfile_next, gensym("next"), - A_DEFFLOAT, 0); - class_addmethod(msgfile_class, (t_method)msgfile_prev, gensym("prev"), - A_DEFFLOAT, 0); - - class_addmethod(msgfile_class, (t_method)msgfile_skip, gensym("skip"), - A_DEFFLOAT, 0); - - class_addmethod(msgfile_class, (t_method)msgfile_set, gensym("set"), - A_GIMME, 0); - - class_addmethod(msgfile_class, (t_method)msgfile_clear, gensym("clear"), - 0); - class_addmethod(msgfile_class, (t_method)msgfile_delete, gensym("delete"), - A_GIMME, 0); - - class_addmethod(msgfile_class, (t_method)msgfile_add, gensym("add"), - A_GIMME, 0); - class_addmethod(msgfile_class, (t_method)msgfile_add2, gensym("add2"), - A_GIMME, 0); - class_addmethod(msgfile_class, (t_method)msgfile_append, gensym("append"), - A_GIMME, 0); - class_addmethod(msgfile_class, (t_method)msgfile_append2, - gensym("append2"), A_GIMME, 0); - class_addmethod(msgfile_class, (t_method)msgfile_insert, gensym("insert"), - A_GIMME, 0); - class_addmethod(msgfile_class, (t_method)msgfile_insert2, - gensym("insert2"), A_GIMME, 0); - - class_addmethod(msgfile_class, (t_method)msgfile_replace, - gensym("replace"), A_GIMME, 0); - - class_addmethod(msgfile_class, (t_method)msgfile_find, gensym("find"), - A_GIMME, 0); - - class_addmethod(msgfile_class, (t_method)msgfile_read, gensym("read"), - A_SYMBOL, A_DEFSYM, 0); - class_addmethod(msgfile_class, (t_method)msgfile_read2, gensym("read2"), - A_SYMBOL, A_DEFSYM, 0); - class_addmethod(msgfile_class, (t_method)msgfile_write, gensym("write"), - A_SYMBOL, A_DEFSYM, 0); - class_addmethod(msgfile_class, (t_method)msgfile_print, gensym("print"), - 0); - class_addmethod(msgfile_class, (t_method)msgfile_flush, gensym("flush"), - 0); + msgfile_class = zexy_new("msgfile", + msgfile_new, msgfile_free, t_msgfile, 0, "*"); + zexy_addmethod(msgfile_class, (t_method)msgfile_goto, "goto", "F"); + zexy_addmethod(msgfile_class, (t_method)msgfile_rewind, "rewind", ""); + zexy_addmethod(msgfile_class, (t_method)msgfile_rewind, "begin", ""); + zexy_addmethod(msgfile_class, (t_method)msgfile_end, "end", ""); + zexy_addmethod(msgfile_class, (t_method)msgfile_next, "next", "F"); + zexy_addmethod(msgfile_class, (t_method)msgfile_prev, "prev", "F"); + + zexy_addmethod(msgfile_class, (t_method)msgfile_skip, "skip", "F"); + + zexy_addmethod(msgfile_class, (t_method)msgfile_set, "set", "*"); + + zexy_addmethod(msgfile_class, (t_method)msgfile_clear, "clear", ""); + zexy_addmethod(msgfile_class, (t_method)msgfile_delete, "delete", "*"); + + zexy_addmethod(msgfile_class, (t_method)msgfile_add, "add", "*"); + zexy_addmethod(msgfile_class, (t_method)msgfile_add2, "add2", "*"); + zexy_addmethod(msgfile_class, (t_method)msgfile_append, "append", "*"); + zexy_addmethod(msgfile_class, (t_method)msgfile_append2, "append2", "*"); + zexy_addmethod(msgfile_class, (t_method)msgfile_insert, "insert", "*"); + zexy_addmethod(msgfile_class, (t_method)msgfile_insert2, "insert2", "*"); + + zexy_addmethod(msgfile_class, (t_method)msgfile_replace, "replace", "*"); + + zexy_addmethod(msgfile_class, (t_method)msgfile_find, "find", "*"); + + zexy_addmethod(msgfile_class, (t_method)msgfile_read, "read", "sS"); + zexy_addmethod(msgfile_class, (t_method)msgfile_read2, "read2", "sS"); + zexy_addmethod(msgfile_class, (t_method)msgfile_write, "write", "sS"); + zexy_addmethod(msgfile_class, (t_method)msgfile_print, "print", ""); + zexy_addmethod(msgfile_class, (t_method)msgfile_flush, "flush", ""); class_addbang(msgfile_class, msgfile_bang); - class_addmethod(msgfile_class, (t_method)msgfile_this, gensym("this"), 0); - class_addmethod(msgfile_class, (t_method)msgfile_where, gensym("where"), - 0); + zexy_addmethod(msgfile_class, (t_method)msgfile_this, "this", ""); + zexy_addmethod(msgfile_class, (t_method)msgfile_where, "where", ""); - class_addmethod(msgfile_class, (t_method)msgfile_sort, gensym("sort"), - A_SYMBOL, A_SYMBOL, A_SYMBOL, 0); + zexy_addmethod(msgfile_class, (t_method)msgfile_sort, "sort", "sss"); - class_addmethod(msgfile_class, (t_method)msgfile_help, gensym("help"), 0); + zexy_addmethod(msgfile_class, (t_method)msgfile_help, "help", ""); zexy_register("msgfile"); } diff --git a/externals/zexy/src/multiline~.c b/externals/zexy/src/multiline~.c index fea4f3d2218fc0d8c07d6993fce576c65da7a957..23765e32436da664828def02bd36025f3642e36e 100644 --- a/externals/zexy/src/multiline~.c +++ b/externals/zexy/src/multiline~.c @@ -38,7 +38,7 @@ /* --------------------------- multiline~ ---------------------------------- */ -static t_class *mline_class; +static t_class *mline_class=NULL; typedef struct _mline { t_object x_obj; @@ -233,12 +233,9 @@ static void *mline_new(t_symbol* UNUSED(s), int argc, t_atom *argv) { t_mline *x = (t_mline *)pd_new(mline_class); int i; - t_atom sane_default[1]; if (!argc) { argc = 1; - SETFLOAT(sane_default, 0.); - argv = sane_default; x->time = 0; } else { x->time = atom_getfloat(argv+argc-1); @@ -288,25 +285,23 @@ static void *mline_new(t_symbol* UNUSED(s), int argc, t_atom *argv) } -static void mline_help(t_mline*x) +static void mline_help(t_mline*UNUSED(x)) { - post("\n"HEARTSYMBOL " multiline~\t:: ramped multiplication of multiple signals"); + post("\n"HEARTSYMBOL + " multiline~\t:: ramped multiplication of multiple signals"); } -void multiline_tilde_setup(void) +ZEXY_SETUP void multiline_tilde_setup(void) { - mline_class = class_new(gensym("multiline~"), (t_newmethod)mline_new, - (t_method)mline_free, - sizeof(t_mline), 0, A_GIMME, 0); + mline_class = zexy_new("multiline~", + mline_new, mline_free, t_mline, 0, "*"); - class_addmethod(mline_class, (t_method)mline_dsp, gensym("dsp"), - A_CANT, 0); - class_addmethod(mline_class, nullfn, gensym("signal"), 0); + zexy_addmethod(mline_class, (t_method)mline_dsp, "dsp", "!"); + zexy_addmethod(mline_class, (t_method)nullfn, "signal", ""); - class_addmethod(mline_class, (t_method)mline_list, gensym(""), A_GIMME, 0); - class_addmethod(mline_class, (t_method)mline_stop, gensym("stop"), 0); + zexy_addmethod(mline_class, (t_method)mline_list, "", "*"); + zexy_addmethod(mline_class, (t_method)mline_stop, "stop", ""); - class_addmethod (mline_class, (t_method)mline_help, gensym("help"), - A_NULL); + zexy_addmethod(mline_class, (t_method)mline_help, "help", ""); zexy_register("multiline_tilde"); } diff --git a/externals/zexy/src/multiplex.c b/externals/zexy/src/multiplex.c index 24faeea8a136b68af3a9c911f0d17f3719d96b35..264c3d1d96bbe4ec6ea33badfe048e53b194e5d7 100644 --- a/externals/zexy/src/multiplex.c +++ b/externals/zexy/src/multiplex.c @@ -23,8 +23,9 @@ /* * THINK: should the selector-inlet be the first or the last ??? * pros/cons: - * the 1st inlet being the selector is not consistant with pd (hot/cold) - * but as it since the hot inlet is selectable, the whole object is not really consitant + * the 1st inlet being the selector is not consistent with pd (hot/cold) + * but it since the hot inlet is selectable, the whole object is not really + * consistent * numbering would have to start with 1 (for the 1st not-leftmost inlet) * if the selector is rightmost this would mean: cold is right(most), hot is (somewhere) left * numbering would be ok @@ -43,15 +44,15 @@ a multiplexer */ -static t_class *mux_class; -static t_class *muxproxy_class; +static t_class *mux_class=NULL; +static t_class *muxproxy_class=NULL; typedef struct _mux { t_object x_obj; struct _muxproxy **x_proxy; int i_count; - int i_selected; + t_float f_selected; t_inlet **in; } t_mux; @@ -62,26 +63,21 @@ typedef struct _muxproxy { int id; } t_muxproxy; -static void mux_select(t_mux *x, t_float f) -{ - x->i_selected=f; -} - static void mux_anything(t_muxproxy *y, t_symbol *s, int argc, t_atom *argv) { t_mux*x=y->p_master; - if(y->id==x->i_selected) { + if(y->id==(int)x->f_selected) { outlet_anything(x->x_obj.ob_outlet, s, argc, argv); } } -static void *mux_new(t_symbol *s, int argc, t_atom *argv) +static void *mux_new(t_symbol *UNUSED(s), int argc, t_atom *UNUSED(argv)) { int n = (argc < 2)?2:argc; t_mux *x = (t_mux *)pd_new(mux_class); - x->i_selected=0; + x->f_selected=0; x->i_count = n; x->in = (t_inlet **)getbytes(x->i_count * sizeof(t_inlet *)); x->x_proxy = (t_muxproxy**)getbytes(x->i_count * sizeof(t_muxproxy*)); @@ -93,7 +89,7 @@ static void *mux_new(t_symbol *s, int argc, t_atom *argv) x->in[n] = inlet_new ((t_object*)x, (t_pd*)x->x_proxy[n], 0,0); } - inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("")); + floatinlet_new(&x->x_obj, &x->f_selected); outlet_new(&x->x_obj, 0); return (x); @@ -124,27 +120,26 @@ static void mux_free(t_mux*x) /* pd_free(&y->p_pd); */ } - -void multiplex_setup(void) +static t_class* zclass_setup(const char*name) +{ + t_class*c = zexy_new(name, + mux_new, mux_free, t_mux, CLASS_NOINLET, "*"); + return c; +} +static void dosetup() { - mux_class = class_new(gensym("multiplex"), (t_newmethod)mux_new, - (t_method)mux_free, sizeof(t_mux), CLASS_NOINLET, A_GIMME, 0); - class_addcreator((t_newmethod)mux_new, gensym("mux"), A_GIMME, 0); - - class_addmethod (mux_class, (t_method)mux_select, gensym(""), A_DEFFLOAT, - 0); - - muxproxy_class = class_new(0, 0, 0, - sizeof(t_muxproxy), - CLASS_PD | CLASS_NOINLET, 0); - class_addanything(muxproxy_class, mux_anything); - - zexy_register("multiplex"); + mux_class=zclass_setup("multiplex"); + zclass_setup("mux"); + muxproxy_class = zexy_new("multiplex proxy", + 0, 0, t_muxproxy, CLASS_PD | CLASS_NOINLET, ""); + class_addanything(muxproxy_class, mux_anything); +} +ZEXY_SETUP void multiplex_setup(void) +{ + dosetup(); } - void mux_setup(void) { - multiplex_setup(); + dosetup(); } - diff --git a/externals/zexy/src/multiplex~.c b/externals/zexy/src/multiplex~.c index 86de9c5604a5a1154508d691e7eee875e92f6298..d8c782b13d1e6ed593bc1f8905fd19cc67793cc3 100644 --- a/externals/zexy/src/multiplex~.c +++ b/externals/zexy/src/multiplex~.c @@ -19,7 +19,7 @@ #include "zexy.h" -static t_class *mux_tilde_class; +static t_class *mux_tilde_class=NULL; typedef struct _mux { t_object x_obj; @@ -69,7 +69,8 @@ static void mux_tilde_dsp(t_mux *x, t_signal **sp) static void mux_tilde_helper(void) { - post("\n"HEARTSYMBOL " multiplex~\t:: multiplex a one of various signals to one outlet"); + post("\n"HEARTSYMBOL + " multiplex~\t:: multiplex a one of various signals to one outlet"); post("<#out>\t : the inlet-number (counting from 0) witch is routed to the outlet" "'help'\t : view this"); post("creation : \"mux~ [arg1 [arg2...]]\"\t: the number of arguments equals the number of inlets\n"); @@ -106,25 +107,31 @@ static void *mux_tilde_new(t_symbol* UNUSED(s), int argc, return (x); } +static t_class* zclass_setup(const char*name) +{ + t_class*c = zexy_new(name, + mux_tilde_new, mux_tilde_free, t_mux, 0, "*"); + + /* ouch, that hurts... */ + class_addfloat(c, mux_tilde_input); -void multiplex_tilde_setup(void) + zexy_addmethod(c, (t_method)mux_tilde_dsp, "dsp", "!"); + zexy_addmethod(c, (t_method)nullfn, "signal", ""); + + zexy_addmethod(c, (t_method)mux_tilde_helper, "help", ""); + return c; +} +static void dosetup() { - mux_tilde_class = class_new(gensym("multiplex~"), - (t_newmethod)mux_tilde_new, (t_method)mux_tilde_free, sizeof(t_mux), 0, - A_GIMME, 0); - class_addcreator((t_newmethod)mux_tilde_new, gensym("mux~"), A_GIMME, 0); - - class_addfloat(mux_tilde_class, mux_tilde_input); - class_addmethod(mux_tilde_class, (t_method)mux_tilde_dsp, gensym("dsp"), - A_CANT, 0); - class_addmethod(mux_tilde_class, nullfn, gensym("signal"), 0); - - class_addmethod(mux_tilde_class, (t_method)mux_tilde_helper, - gensym("help"), 0); zexy_register("multiplex~"); + mux_tilde_class=zclass_setup("multiplex~"); + zclass_setup("mux~"); +} +ZEXY_SETUP void multiplex_tilde_setup(void) +{ + dosetup(); } void mux_tilde_setup(void) { - multiplex_tilde_setup(); + dosetup(); } - diff --git a/externals/zexy/src/multireceive.c b/externals/zexy/src/multireceive.c index 77c4707908955b2db098e55417ea7a0ad68d8f9e..87e4011e5b9cd67382e2d50fa38d21e19992f997 100644 --- a/externals/zexy/src/multireceive.c +++ b/externals/zexy/src/multireceive.c @@ -21,6 +21,12 @@ #include "zexy.h" +#ifdef _WIN32 +# include <sys/timeb.h> +#else +# include <sys/time.h> +#endif + /* -------------------------- multireceive ------------------------------ */ static t_class *multireceive_class=NULL; @@ -43,6 +49,27 @@ typedef struct _multireceive { t_outlet *x_out; } t_multireceive; + +static unsigned long long unique(void) +{ + unsigned long long uid = 0; +#ifdef _WIN32 + struct _timeb tb; + _ftime(&tb); + uid=(((unsigned long long)tb.time)<<(4*sizeof(uid))) | + (unsigned long long)(tb.millitm); +#else + struct timeval tv; + + gettimeofday(&tv, 0); + + /* First get the seconds right */ + uid=((unsigned long)tv.tv_sec)<<(4*sizeof(uid)) | tv.tv_usec; +#endif + return uid; +} + + static void multireceive_any(t_multireceive_proxy *x, t_symbol*s, int argc, t_atom*argv) { @@ -94,7 +121,8 @@ static void multireceive_clear(t_multireceive *x) } -static void multireceive_set(t_multireceive *x, t_symbol*s, int argc, +static void multireceive_set(t_multireceive *x, t_symbol*UNUSED(s), + int argc, t_atom*argv) { multireceive_clear(x); @@ -119,7 +147,7 @@ static void multireceive_free(t_multireceive *x) x->x_out=NULL; } -static void *multireceive_new(t_symbol *s, int argc, t_atom *argv) +static void *multireceive_new(t_symbol *UNUSED(s), int argc, t_atom *argv) { t_multireceive *x = (t_multireceive *)pd_new(multireceive_class); x->x_proxy=(t_multireceive_proxy*)pd_new(multireceive_proxy_class); @@ -131,29 +159,20 @@ static void *multireceive_new(t_symbol *s, int argc, t_atom *argv) return (x); } -void multireceive_setup(void) +ZEXY_SETUP void multireceive_setup(void) { - multireceive_class = class_new(gensym("multireceive"), - (t_newmethod)multireceive_new, - (t_method)multireceive_free, - sizeof(t_multireceive), - 0, - A_GIMME, 0); - class_addmethod(multireceive_class, - (t_method)multireceive_set, - gensym("set"), - A_GIMME, 0); - - class_addmethod(multireceive_class, - (t_method)multireceive_add, - gensym("add"), - A_SYMBOL, 0); - - multireceive_proxy_class = class_new( - gensym("multireceive proxy "__DATE__""__TIME__""), - 0, 0, - sizeof(t_multireceive_proxy), - CLASS_PD | CLASS_NOINLET, 0); + char uniqsym[MAXPDSTRING]; + unsigned long long uid=unique(); + + multireceive_class = zexy_new("multireceive", + multireceive_new, multireceive_free, t_multireceive, 0, "*"); + zexy_addmethod(multireceive_class, (t_method)multireceive_set, "set", "*"); + + zexy_addmethod(multireceive_class, (t_method)multireceive_add, "add", "s"); + snprintf(uniqsym, MAXPDSTRING-2, "multireceive proxy %0llx", uid); + uniqsym[MAXPDSTRING-1]=0; + multireceive_proxy_class = zexy_new(uniqsym, + 0, 0, t_multireceive_proxy, CLASS_PD | CLASS_NOINLET, ""); class_addanything(multireceive_proxy_class, multireceive_any); diff --git a/externals/zexy/src/niagara.c b/externals/zexy/src/niagara.c index ccedb420b20408b668edf30d82cb1eddd21ad19c..0612f7ab6b31c0f3f4513dbb663c4fc306916cc4 100644 --- a/externals/zexy/src/niagara.c +++ b/externals/zexy/src/niagara.c @@ -23,12 +23,14 @@ /* divides a package into 2 sub-packages at a specified point - like the niagara-falls, some water goes down to the left side, the rest to the right side, devided by the rock + like the niagara-falls, some water goes down to the left side, + the rest to the right side, divided by the rock - nowadays you can do this with [list split] (though this cannot handle negative indices) + nowadays you can do this with [list split] + (though this cannot handle negative indices) */ -static t_class *niagara_class; +static t_class *niagara_class=NULL; typedef struct _niagara { t_object x_obj; @@ -61,7 +63,7 @@ static void niagara_any(t_niagara *x, t_symbol *s, int argc, t_atom *argv) { int n_l, n_r; t_atom *ap_l, *ap_r; - t_symbol *s_r, *s_l; + t_symbol *s_l; int dumrock = x->rock; int rock = ((dumrock < 0.f)?(argc+dumrock):dumrock-1); @@ -73,7 +75,7 @@ static void niagara_any(t_niagara *x, t_symbol *s, int argc, t_atom *argv) ap_r = &argv[n_l]; if (n_r) { - s_r = 0; + t_symbol *s_r = 0; if (ap_r->a_type == A_FLOAT) { s_r = gensym("list"); } else { @@ -103,10 +105,10 @@ static void *niagara_new(t_floatarg f) return (x); } -void niagara_setup(void) +ZEXY_SETUP void niagara_setup(void) { - niagara_class = class_new(gensym("niagara"), (t_newmethod)niagara_new, - 0, sizeof(t_niagara), 0, A_DEFFLOAT, 0); + niagara_class = zexy_new("niagara", + niagara_new, 0, t_niagara, 0, "F"); class_addlist (niagara_class, niagara_list); class_addanything(niagara_class, niagara_any); diff --git a/externals/zexy/src/noish~.c b/externals/zexy/src/noish~.c index f34455141f3f474701a28c853b5f6ab2976a18a7..d813dd65280e231355b1dc5d5eaf47aada195f7b 100644 --- a/externals/zexy/src/noish~.c +++ b/externals/zexy/src/noish~.c @@ -68,7 +68,7 @@ static void set_noisseed(t_nois *x, t_floatarg seed) /* ------------------------ noish~ ----------------------------- */ -static t_class *noish_class; +static t_class *noish_class=NULL; static t_int *noish_perform(t_int *w) { @@ -118,7 +118,7 @@ static t_int *noish_perform(t_int *w) } else { /* anything else */ while (n--) { - if (still_to_go-- <= 0) { /* update only if all time has elapsed */ + if (still_to_go-- <= 0) { /* update only if all time has elapsed */ still_to_go += all_to_go; i_value *= 435898247; @@ -170,18 +170,16 @@ static void *noish_new(t_floatarg f) return (x); } -void noish_tilde_setup(void) +ZEXY_SETUP void noish_tilde_setup(void) { - noish_class = class_new(gensym("noish~"), (t_newmethod)noish_new, 0, - sizeof(t_nois), 0, A_DEFFLOAT, 0); + noish_class = zexy_new("noish~", + noish_new, 0, t_nois, 0, "F"); class_addfloat(noish_class, set_freq); - class_addmethod(noish_class, (t_method)noish_dsp, gensym("dsp"), - A_CANT, 0); + zexy_addmethod(noish_class, (t_method)noish_dsp, "dsp", "!"); - class_addmethod(noish_class, (t_method)set_noisseed, gensym("seed"), - A_FLOAT, 0); + zexy_addmethod(noish_class, (t_method)set_noisseed, "seed", "f"); - class_addmethod(noish_class, (t_method)noish_helper, gensym("help"), 0); + zexy_addmethod(noish_class, (t_method)noish_helper, "help", ""); zexy_register("noish~"); } diff --git a/externals/zexy/src/noisi~.c b/externals/zexy/src/noisi~.c index f79e939f7cf26bbbda6c5f5ae9951fb4b0854641..9fcba3a6c6a689901293d7f0570c285f7d7f5274 100644 --- a/externals/zexy/src/noisi~.c +++ b/externals/zexy/src/noisi~.c @@ -69,7 +69,7 @@ static void set_noisseed(t_nois *x, t_floatarg seed) /* ------------------------ noisi~ ----------------------------- */ -static t_class *noisi_class; +static t_class *noisi_class=NULL; static inline t_sample int2sample(int i) { @@ -95,12 +95,12 @@ static t_int *noisi_perform(t_int *w) t_sample all_to_go = x->updater; t_sample still_to_go = x->to_go; - if (all_to_go == 1) { + if (all_to_go == 1) { /* this is "pure white" noise, so we have to calculate each sample */ while (n--) { *out++ = int2sample(i_value=update_intNoise(i_value)); } - } else if (n < still_to_go) { + } else if (n < still_to_go) { /* signal won't change for the next 64 samples */ still_to_go -= n; while (n--) { @@ -108,7 +108,7 @@ static t_int *noisi_perform(t_int *w) } } else if (all_to_go + still_to_go > n) { /* only one update calculation necessary for 64 samples !!! */ - while (still_to_go-- > 0) { + while (still_to_go-- > 0) { n--; *out++ = (f_value -= decrement); } @@ -117,14 +117,14 @@ static t_int *noisi_perform(t_int *w) still_to_go += all_to_go + 1; decrement = (f_value - int2sample(i_value)) / all_to_go; - while (n--) { + while (n--) { still_to_go--; *out++ = (f_value -= decrement); } } else { /* anything else */ - while (n--) { - if (still_to_go-- <= 0) { /* update only if all time has elapsed */ + while (n--) { + if (still_to_go-- <= 0) { /* update only if all time has elapsed */ still_to_go += all_to_go; f_value=int2sample(i_value); i_value=update_intNoise(i_value); @@ -150,7 +150,8 @@ static void noisi_dsp(t_nois *x, t_signal **sp) static void noisi_helper(void) { - post("\n"HEARTSYMBOL " noisi~\t:: a bandlimited interpolating pseudo-noise generator"); + post("\n"HEARTSYMBOL + " noisi~\t:: a bandlimited interpolating pseudo-noise generator"); post("<freq>\t : sampling-frequency (in Hz)\n" "'help'\t : view this"); post("creation : \"noisi~ [<freq>]\"\t: ('0'(default) will produce 'white' noise)\n"); @@ -174,18 +175,16 @@ static void *noisi_new(t_floatarg f) return (x); } -void noisi_tilde_setup(void) +ZEXY_SETUP void noisi_tilde_setup(void) { - noisi_class = class_new(gensym("noisi~"), (t_newmethod)noisi_new, 0, - sizeof(t_nois), 0, A_DEFFLOAT, 0); + noisi_class = zexy_new("noisi~", + noisi_new, 0, t_nois, 0, "F"); class_addfloat(noisi_class, set_noisfreq); - class_addmethod(noisi_class, (t_method)noisi_dsp, gensym("dsp"), - A_CANT, 0); + zexy_addmethod(noisi_class, (t_method)noisi_dsp, "dsp", "!"); - class_addmethod(noisi_class, (t_method)set_noisseed, gensym("seed"), - A_FLOAT, 0); + zexy_addmethod(noisi_class, (t_method)set_noisseed, "seed", "f"); - class_addmethod(noisi_class, (t_method)noisi_helper, gensym("help"), 0); + zexy_addmethod(noisi_class, (t_method)noisi_helper, "help", ""); zexy_register("noisi~"); } diff --git a/externals/zexy/src/operating_system.c b/externals/zexy/src/operating_system.c index cd25f90be7694bc60dff594bbce7637f9be13d33..5edc26bf041dd4bff0ad0e56ede1de55937eb9b3 100644 --- a/externals/zexy/src/operating_system.c +++ b/externals/zexy/src/operating_system.c @@ -25,7 +25,7 @@ MESSAGE OPERATING_SYSTEM: simple and easy */ -static t_class *operating_system_class; +static t_class *operating_system_class=NULL; typedef struct _operating_system { t_object x_obj; @@ -55,19 +55,19 @@ static void *operating_system_new(void) return (x); } -static void operating_system_help(t_operating_system*x) +static void operating_system_help(t_operating_system*UNUSED(x)) { - post("\n"HEARTSYMBOL " operating_system\t:: get the current operating system"); + post("\n"HEARTSYMBOL + " operating_system\t:: get the current operating system"); } -void operating_system_setup(void) +ZEXY_SETUP void operating_system_setup(void) { - operating_system_class = class_new(gensym("operating_system"), - (t_newmethod)operating_system_new, - 0, sizeof(t_operating_system), 0, A_NULL); + operating_system_class = zexy_new("operating_system", + operating_system_new, 0, t_operating_system, 0, ""); class_addbang (operating_system_class, operating_system_bang); - class_addmethod(operating_system_class, (t_method)operating_system_help, - gensym("help"), A_NULL); + zexy_addmethod(operating_system_class, (t_method)operating_system_help, + "help", ""); zexy_register("operating_system"); } diff --git a/externals/zexy/src/pack.c b/externals/zexy/src/pack.c index b07f6a82a8f83abf7468b032142d773e71c2323c..30c0427b8838dc046224cf63873414872c0c5aeb 100644 --- a/externals/zexy/src/pack.c +++ b/externals/zexy/src/pack.c @@ -30,8 +30,8 @@ /* ------------------------- zexy/pack ------------------------------- */ -static t_class *zpack_class; -static t_class *zpackproxy_class; +static t_class *zpack_class=NULL; +static t_class *zpackproxy_class=NULL; typedef struct _zpack { t_object x_obj; @@ -86,13 +86,15 @@ static void zpack_any(t_zpack*x, t_symbol *s, int argc, t_atom *argv) zpack_bang(x); } -static void zpack_list(t_zpack*x, t_symbol *s, int argc, t_atom *argv) +static void zpack_list(t_zpack*x, t_symbol *UNUSED(s), int argc, + t_atom *argv) { zpack_any(x, 0, argc, argv); } -static void zpack_proxy_list(t_zpackproxy *y, t_symbol *s, int argc, +static void zpack_proxy_list(t_zpackproxy *y, t_symbol *UNUSED(s), + int argc, t_atom *argv) { /* until we have lists of lists, this only uses the 1st element */ @@ -100,8 +102,8 @@ static void zpack_proxy_list(t_zpackproxy *y, t_symbol *s, int argc, setatom(y->p_master, argv, y->id); } } -static void zpack_proxy_any(t_zpackproxy *y, t_symbol *s, int argc, - t_atom *argv) +static void zpack_proxy_any(t_zpackproxy *y, t_symbol *s, + int UNUSED(argc), t_atom *UNUSED(argv)) { /* until we have lists of lists, this only uses the selector */ t_atom a; @@ -109,7 +111,7 @@ static void zpack_proxy_any(t_zpackproxy *y, t_symbol *s, int argc, setatom(y->p_master, &a, y->id); } -static void *zpack_new(t_symbol *s, int argc, t_atom *argv) +static void *zpack_new(t_symbol *UNUSED(s), int argc, t_atom *argv) { t_zpack *x = (t_zpack *)pd_new(zpack_class); int n =0; @@ -170,10 +172,10 @@ static void zpack_free(t_zpack*x) } } -void zpack_setup(void) +ZEXY_SETUP void zpack_setup(void) { - zpack_class = class_new(gensym("zexy/pack"), (t_newmethod)zpack_new, - (t_method)zpack_free, sizeof(t_zpack), 0, A_GIMME, 0); + zpack_class = zexy_new("zexy/pack", + zpack_new, zpack_free, t_zpack, 0, "*"); #if 0 /* oops Pd>=0.42 allows us to override built-ins * this is bad as long as the 2 objects are not compatible */ @@ -183,9 +185,8 @@ void zpack_setup(void) class_addlist(zpack_class, zpack_list); class_addanything(zpack_class, zpack_any); - zpackproxy_class = class_new(gensym("zpack proxy"), 0, 0, - sizeof(t_zpackproxy), - CLASS_PD | CLASS_NOINLET, 0); + zpackproxy_class = zexy_new("zpack proxy", + 0, 0, t_zpackproxy, CLASS_PD | CLASS_NOINLET, ""); class_addlist(zpackproxy_class, zpack_proxy_list); class_addanything(zpackproxy_class, zpack_proxy_any); @@ -196,4 +197,3 @@ void pack_setup(void) { zpack_setup(); } - diff --git a/externals/zexy/src/packel.c b/externals/zexy/src/packel.c index 5329908539571bb5caab623d9a36fa71af658645..6b1663ad69deec7f0d2926543159fd65d650998f 100644 --- a/externals/zexy/src/packel.c +++ b/externals/zexy/src/packel.c @@ -19,7 +19,7 @@ #include "zexy.h" -static t_class *packel_class; +static t_class *packel_class=NULL; typedef struct _packel { t_object x_obj; @@ -59,6 +59,7 @@ static void packel_outelement(t_packel*x, int id, t_symbol*s,int argc, switch (current->a_type) { case A_NULL: outlet_bang(out); + break; default: outlet_list(out, gensym("list"), 1, current); } @@ -122,7 +123,7 @@ static void packel_free(t_packel *x) } -static void *packel_new(t_symbol*s, int argc, t_atom*argv) +static void *packel_new(t_symbol*UNUSED(s), int argc, t_atom*argv) { t_packel *x = (t_packel *)pd_new(packel_class); @@ -150,12 +151,10 @@ static void *packel_new(t_symbol*s, int argc, t_atom*argv) return (x); } -void packel_setup(void) +ZEXY_SETUP void packel_setup(void) { - packel_class = class_new(gensym("packel"), - (t_newmethod)packel_new, (t_method)packel_free, - sizeof(t_packel), 0, - A_GIMME, 0); + packel_class = zexy_new("packel", + packel_new, packel_free, t_packel, 0, "*"); class_addlist (packel_class, packel_list); class_addanything(packel_class, packel_anything); diff --git a/externals/zexy/src/pack~.c b/externals/zexy/src/pack~.c index ef823ec87ac067a492f86379a477c13caa363294..b195bf3a804d9871bfa4b402308e056149305b7d 100644 --- a/externals/zexy/src/pack~.c +++ b/externals/zexy/src/pack~.c @@ -19,7 +19,7 @@ #include "zexy.h" -static t_class *sigpack_class; +static t_class *sigpack_class=NULL; typedef struct _sigpack { t_object x_obj; @@ -90,16 +90,14 @@ static void sigpack_help(void) post("pack~\t:: outputs the signal-vectors as float-packages"); } -void pack_tilde_setup(void) +ZEXY_SETUP void pack_tilde_setup(void) { - sigpack_class = class_new(gensym("pack~"), (t_newmethod)sigpack_new, - (t_method)sigpack_free, - sizeof(t_sigpack), 0, A_DEFFLOAT, 0); - class_addmethod(sigpack_class, nullfn, gensym("signal"), 0); - class_addmethod(sigpack_class, (t_method)sigpack_dsp, gensym("dsp"), - A_CANT, 0); - - class_addmethod(sigpack_class, (t_method)sigpack_help, gensym("help"), 0); + sigpack_class = zexy_new("pack~", + sigpack_new, sigpack_free, t_sigpack, 0, ""); + zexy_addmethod(sigpack_class, (t_method)nullfn, "signal", ""); + zexy_addmethod(sigpack_class, (t_method)sigpack_dsp, "dsp", "!"); + + zexy_addmethod(sigpack_class, (t_method)sigpack_help, "help", ""); zexy_register("pack~"); } diff --git a/externals/zexy/src/pdf~.c b/externals/zexy/src/pdf~.c index 12db1db6c43e9e5911a31e9d919780f7c9284821..6287ad8c069ce604de30feb0a4c2cf335df3280c 100644 --- a/externals/zexy/src/pdf~.c +++ b/externals/zexy/src/pdf~.c @@ -21,7 +21,7 @@ /* ------------------------ pdf~ ----------------------------- */ -static t_class *pdf_class; +static t_class *pdf_class=NULL; typedef struct _pdf { t_object x_obj; @@ -122,7 +122,8 @@ static void pdf_free(t_pdf *x) static void pdf_tilde_helper(void) { - post("\n"HEARTSYMBOL " pdf~\t:: get the probability density function of a signal (-1.0 to +1.0)"); + post("\n"HEARTSYMBOL + " pdf~\t:: get the probability density function of a signal (-1.0 to +1.0)"); post("'bang'\t : output a list of the probabilities of 'n' function values" "\n'clear'\t : clear the buffer (set all probabilities to zero)" "\n<1/0>\t : short for 'bang' and 'clear'" @@ -130,20 +131,18 @@ static void pdf_tilde_helper(void) post("creation :: 'pdf~ [<n>]':: get the pdf for <n> (default: 64) values"); } -void pdf_tilde_setup(void) +ZEXY_SETUP void pdf_tilde_setup(void) { - pdf_class = class_new(gensym("pdf~"), (t_newmethod)pdf_new, - (t_method)pdf_free, - sizeof(t_pdf), 0, A_DEFFLOAT, 0); + pdf_class = zexy_new("pdf~", + pdf_new, pdf_free, t_pdf, 0, "F"); - class_addmethod(pdf_class, nullfn, gensym("signal"), 0); - class_addmethod(pdf_class, (t_method)pdf_dsp, gensym("dsp"), - A_CANT, 0); + zexy_addmethod(pdf_class, (t_method)nullfn, "signal", ""); + zexy_addmethod(pdf_class, (t_method)pdf_dsp, "dsp", "!"); - class_addmethod(pdf_class, (t_method)pdf_bang, gensym("bang"), 0); - class_addmethod(pdf_class, (t_method)clear_pdfbuf, gensym("clear"), 0); + zexy_addmethod(pdf_class, (t_method)pdf_bang, "bang", ""); + zexy_addmethod(pdf_class, (t_method)clear_pdfbuf, "clear", ""); class_addfloat(pdf_class, pdf_float); - class_addmethod(pdf_class, (t_method)pdf_tilde_helper, gensym("help"), 0); + zexy_addmethod(pdf_class, (t_method)pdf_tilde_helper, "help", ""); zexy_register("pdf~"); } diff --git a/externals/zexy/src/prime.c b/externals/zexy/src/prime.c index 81a77f45841ca6bfeb3240a5bf02711a8257fb62..f54d1a0e448e8f4bcb548f09634b081142876b7c 100644 --- a/externals/zexy/src/prime.c +++ b/externals/zexy/src/prime.c @@ -20,7 +20,7 @@ #include "zexy.h" -static t_class *prime_class; +static t_class *prime_class=NULL; typedef struct _prime { t_object x_obj; @@ -64,20 +64,18 @@ static void *prime_new(void) return (x); } -static void prime_help(t_prime*x) +static void prime_help(t_prime*UNUSED(x)) { post("\n"HEARTSYMBOL " prime\t\t:: test whether a given number is prime"); } -void prime_setup(void) +ZEXY_SETUP void prime_setup(void) { - prime_class = class_new(gensym("prime"), - (t_newmethod)prime_new, - 0, sizeof(t_prime), - CLASS_DEFAULT, 0); + prime_class = zexy_new("prime", + prime_new, 0, t_prime, CLASS_DEFAULT, ""); class_addfloat(prime_class, prime_float); - class_addmethod(prime_class, (t_method)prime_help, gensym("help"), A_NULL); + zexy_addmethod(prime_class, (t_method)prime_help, "help", ""); zexy_register("prime"); } diff --git a/externals/zexy/src/quantize~.c b/externals/zexy/src/quantize~.c index 36d8f8964d2a65d85141edfe0bf47f77934e7e8c..a0283ddf60775e928b7e55807ef615de927f08a3 100644 --- a/externals/zexy/src/quantize~.c +++ b/externals/zexy/src/quantize~.c @@ -28,7 +28,7 @@ /* ------------------------ quantize~ ----------------------------- */ -static t_class *quantize_class; +static t_class *quantize_class=NULL; typedef struct _quantize { t_object x_obj; @@ -55,7 +55,7 @@ static void quantize_8bit(t_quantize *x) static t_int *quantize_perform(t_int *w) { - t_quantize *x = (t_quantize *)(w[1]); + t_quantize *x = (t_quantize *)(w[1]); t_sample *in = (t_sample *)(w[2]); t_sample *out = (t_sample *)(w[3]); int n = (int)(w[4]); @@ -65,8 +65,7 @@ static t_int *quantize_perform(t_int *w) if (quantiz) while (n--) { *out++ = dequantiz*(int)(quantiz**in++); - } - else while (n--) { + } else while (n--) { *out++ = *in++; } @@ -80,7 +79,8 @@ static void quantize_dsp(t_quantize *x, t_signal **sp) static void quantize_tilde_helper(t_quantize* UNUSED(x)) { - post(""HEARTSYMBOL " quantize~-object\t:: used for quantizing signals by various degrees"); + post(""HEARTSYMBOL + " quantize~-object\t:: used for quantizing signals by various degrees"); post("<quants> : quantize a signal into <quants> steps ('0' turns quantizing off)\n" "'8bit' : quantize to 8 bit\n" "'16bit' : quantize to 16 bit (default)\n" @@ -104,22 +104,18 @@ static void *quantize_new(t_floatarg f) return (x); } -void quantize_tilde_setup(void) +ZEXY_SETUP void quantize_tilde_setup(void) { - quantize_class = class_new(gensym("quantize~"), (t_newmethod)quantize_new, - 0, - sizeof(t_quantize), 0, A_DEFFLOAT, 0); - class_addmethod(quantize_class, nullfn, gensym("signal"), 0); - class_addmethod(quantize_class, (t_method)quantize_dsp, gensym("dsp"), - A_CANT, 0); + quantize_class = zexy_new("quantize~", + quantize_new, 0, t_quantize, 0, "F"); + zexy_addmethod(quantize_class, (t_method)nullfn, "signal", ""); + zexy_addmethod(quantize_class, (t_method)quantize_dsp, "dsp", "!"); class_addfloat(quantize_class, quantize_float); - class_addmethod(quantize_class, (t_method)quantize_8bit, gensym("8bit"), - 0); - class_addmethod(quantize_class, (t_method)quantize_16bit, gensym("16bit"), - 0); + zexy_addmethod(quantize_class, (t_method)quantize_8bit, "8bit", ""); + zexy_addmethod(quantize_class, (t_method)quantize_16bit, "16bit", ""); - class_addmethod(quantize_class, (t_method)quantize_tilde_helper, - gensym("help"), 0); + zexy_addmethod(quantize_class, (t_method)quantize_tilde_helper, "help", + ""); zexy_register("quantize~"); } diff --git a/externals/zexy/src/rawprint.c b/externals/zexy/src/rawprint.c index e36495b372b63a33d2fe40fcd436bfa6ae434c35..65bce7b003c0c1c9d52c97c21af3c666cfb6c2f8 100644 --- a/externals/zexy/src/rawprint.c +++ b/externals/zexy/src/rawprint.c @@ -30,7 +30,7 @@ # endif #endif -static t_class *rawprint_class; +static t_class *rawprint_class=NULL; typedef struct _rawprint { t_object x_obj; @@ -43,11 +43,12 @@ static void rawprint_any(t_rawprint *x, t_symbol*s, int argc, t_atom*argv) if(x->label) { startpost("%s: ", x->label->s_name); } - - if(s) + + if(s) { startpost("\"%s\"", s->s_name); - else // this shouldn't happen, but sometimes does... + } else { // this shouldn't happen, but sometimes does... startpost("NULL"); + } while(argc--) { switch(argv->a_type) { @@ -108,12 +109,10 @@ static void *rawprint_new(t_symbol*s) return (x); } -void rawprint_setup(void) +ZEXY_SETUP void rawprint_setup(void) { - rawprint_class = class_new(gensym("rawprint"), - (t_newmethod)rawprint_new, - 0, sizeof(t_rawprint), - CLASS_DEFAULT, A_DEFSYMBOL, 0); + rawprint_class = zexy_new("rawprint", + rawprint_new, 0, t_rawprint, CLASS_DEFAULT, "S"); class_addanything(rawprint_class, rawprint_any); zexy_register("rawprint"); diff --git a/externals/zexy/src/regex.c b/externals/zexy/src/regex.c index 8c32b37f993a50b9b2a7bc92377f7309de8249a2..40279fc968fc81711ddb71d1782dfc6f75599e5d 100644 --- a/externals/zexy/src/regex.c +++ b/externals/zexy/src/regex.c @@ -34,7 +34,7 @@ /* match a regular expression against a string */ -static t_class *regex_class; +static t_class *regex_class=NULL; typedef struct _regex { t_object x_obj; @@ -76,11 +76,11 @@ static char*regex_l2s(int *reslen, t_symbol*s, int argc, t_atom*argv) i=argc; ap=argv; while(i--) { - char buffer[MAXPDSTRING]; int len=0; if(A_SYMBOL==ap->a_type) { len=strlen(ap->a_w.w_symbol->s_name); } else { + char buffer[MAXPDSTRING]; atom_string(ap, buffer, MAXPDSTRING); len=strlen(buffer); } @@ -95,7 +95,7 @@ static char*regex_l2s(int *reslen, t_symbol*s, int argc, t_atom*argv) result = (char*)getbytes((length+1)*sizeof(char)); if (s) { - char *buf = s->s_name; + const char *buf = s->s_name; strcpy(result+pos, buf); pos+=strlen(buf); if(i) { @@ -173,7 +173,8 @@ static void regex_case(t_regex *x, t_float f) } -static void regex_regex(t_regex *x, t_symbol*s, int argc, t_atom*argv) +static void regex_regex(t_regex *x, t_symbol*UNUSED(s), int argc, + t_atom*argv) { #ifdef HAVE_REGEX_H char*result=0; @@ -200,7 +201,8 @@ static void regex_regex(t_regex *x, t_symbol*s, int argc, t_atom*argv) } /* compare the given list as string with the precompiled regex */ -static void regex_symbol(t_regex *x, t_symbol *s, int argc, t_atom*argv) +static void regex_symbol(t_regex *x, t_symbol *UNUSED(s), int argc, + t_atom*argv) { #ifdef HAVE_REGEX_H char*teststring=0; @@ -280,7 +282,7 @@ cleanup: #endif } -static void *regex_new(t_symbol *s, int argc, t_atom*argv) +static void *regex_new(t_symbol *UNUSED(s), int argc, t_atom*argv) { t_regex *x = (t_regex *)pd_new(regex_class); @@ -330,23 +332,22 @@ static void regex_free(t_regex *x) #endif } -static void regex_help(t_regex*x) +static void regex_help(t_regex*UNUSED(x)) { - post("\n"HEARTSYMBOL " regex\t\t:: test the input whether it matches a regular expression"); + post("\n"HEARTSYMBOL + " regex\t\t:: test the input whether it matches a regular expression"); } -void regex_setup(void) +ZEXY_SETUP void regex_setup(void) { - regex_class = class_new(gensym("regex"), (t_newmethod)regex_new, - (t_method)regex_free, sizeof(t_regex), 0, A_GIMME, 0); + regex_class = zexy_new("regex", + regex_new, regex_free, t_regex, 0, "*"); class_addlist (regex_class, regex_symbol); - class_addmethod(regex_class, (t_method)regex_regex, gensym("regex"), - A_GIMME, 0); + zexy_addmethod(regex_class, (t_method)regex_regex, "regex", "*"); - class_addmethod(regex_class, (t_method)regex_case, gensym("case"), A_FLOAT, - 0); + zexy_addmethod(regex_class, (t_method)regex_case, "case", "f"); - class_addmethod(regex_class, (t_method)regex_help, gensym("help"), A_NULL); + zexy_addmethod(regex_class, (t_method)regex_help, "help", ""); zexy_register("regex"); } diff --git a/externals/zexy/src/relay.c b/externals/zexy/src/relay.c index 246e1f26497b9b766b51ff7b3d92bc3ae90d7f8f..609d094f1a7b068706a21631bfd6b54e8aa419ca 100644 --- a/externals/zexy/src/relay.c +++ b/externals/zexy/src/relay.c @@ -38,7 +38,7 @@ /* -------------------------- relay ------------------------------ */ -static t_class *relay_class; +static t_class *relay_class=NULL; typedef struct _relayelement { t_word e_w; @@ -56,9 +56,9 @@ typedef struct _relay { static void relay_anything(t_relay *x, t_symbol *sel, int argc, t_atom *argv) { - t_relayelement *e; - int nelement; if (x->x_type == A_SYMBOL) { + int nelement; + t_relayelement *e; for (nelement = x->x_nelement, e = x->x_vec; nelement--; e++) { if (e->e_w.w_symbol == sel) { outlet_anything(e->e_outlet, sel, argc, argv); @@ -82,9 +82,9 @@ static void relay_list(t_relay *x, t_symbol *sel, int argc, t_atom *argv) f = atom_getfloat(argv); for (nelement = x->x_nelement, e = x->x_vec; nelement--; e++) { if (e->e_w.w_float == f) { - if (!sel) { - sel=(argc==1)?gensym("float"):gensym("list"); - } + if (!sel) { + sel=(argc==1)?gensym("float"):gensym("list"); + } outlet_anything(e->e_outlet, sel, argc, argv); return; } @@ -155,10 +155,10 @@ static void *relay_new(t_symbol* UNUSED(s), int argc, t_atom *argv) return (x); } -void relay_setup(void) +ZEXY_SETUP void relay_setup(void) { - relay_class = class_new(gensym("relay"), (t_newmethod)relay_new, - (t_method)relay_free, sizeof(t_relay), 0, A_GIMME, 0); + relay_class = zexy_new("relay", + relay_new, relay_free, t_relay, 0, "*"); class_addlist(relay_class, relay_list); class_addanything(relay_class, relay_anything); zexy_register("relay"); diff --git a/externals/zexy/src/repack.c b/externals/zexy/src/repack.c index 51ceb14ab8bf3250713579dddbade2037767cfcf..b899a064c9f5eb603d4e1f60cf89426838353948 100644 --- a/externals/zexy/src/repack.c +++ b/externals/zexy/src/repack.c @@ -29,7 +29,7 @@ the second inlet lets you change the default package size */ -static t_class *repack_class; +static t_class *repack_class=NULL; typedef struct _repack { t_object x_obj; @@ -165,10 +165,10 @@ static void *repack_new(t_floatarg f) return (x); } -void repack_setup(void) +ZEXY_SETUP void repack_setup(void) { - repack_class = class_new(gensym("repack"), (t_newmethod)repack_new, - 0, sizeof(t_repack), 0, A_DEFFLOAT, 0); + repack_class = zexy_new("repack", + repack_new, 0, t_repack, 0, "F"); class_addbang (repack_class, repack_bang); class_addfloat (repack_class, repack_float); @@ -176,8 +176,7 @@ void repack_setup(void) class_addpointer (repack_class, repack_pointer); class_addlist (repack_class, repack_list); class_addanything(repack_class, repack_anything); - class_addmethod (repack_class, (t_method)repack_set, gensym(""), - A_DEFFLOAT, 0); + zexy_addmethod(repack_class, (t_method)repack_set, "", "F"); zexy_register("repack"); } diff --git a/externals/zexy/src/repeat.c b/externals/zexy/src/repeat.c index dfd07b104af741f8df77721a227835687eff581f..a4aa1e963cff55efd346fd87568d24fa3eb6f8e5 100644 --- a/externals/zexy/src/repeat.c +++ b/externals/zexy/src/repeat.c @@ -21,7 +21,7 @@ /* ------------------------- repeat ------------------------------- */ -static t_class *repeat_class; +static t_class *repeat_class=NULL; typedef struct _repeat { t_object x_obj; @@ -58,10 +58,10 @@ static void *repeat_new(t_symbol* UNUSED(s), int argc, t_atom*argv) return (x); } -void repeat_setup(void) +ZEXY_SETUP void repeat_setup(void) { - repeat_class = class_new(gensym("repeat"), (t_newmethod)repeat_new, - 0, sizeof(t_repeat), 0, A_GIMME, 0); + repeat_class = zexy_new("repeat", + repeat_new, 0, t_repeat, 0, "*"); class_addanything(repeat_class, repeat_anything); zexy_register("repeat"); diff --git a/externals/zexy/src/route~.c b/externals/zexy/src/route~.c index 43add4e90d85811704456df8fa3604a2f0e29cf9..cc1b8a9e5f3b3886c9c1a18d0c08fb1ebda2b8ad 100644 --- a/externals/zexy/src/route~.c +++ b/externals/zexy/src/route~.c @@ -19,7 +19,7 @@ #include "zexy.h" -static t_class *route_tilde_class; +static t_class *route_tilde_class=NULL; typedef struct _route_tilde { t_object x_obj; @@ -65,16 +65,14 @@ static void *route_tilde_new(void) return (x); } -void route_tilde_setup(void) +ZEXY_SETUP void route_tilde_setup(void) { - route_tilde_class = class_new(gensym("route~"), - (t_newmethod)route_tilde_new, (t_method)route_tilde_free, - sizeof(t_route_tilde), 0, A_NULL); + route_tilde_class = zexy_new("route~", + route_tilde_new, route_tilde_free, t_route_tilde, 0, ""); class_addanything(route_tilde_class, (t_method)route_tilde_any); - class_addmethod(route_tilde_class, nullfn, gensym("signal"), 0); - class_addmethod(route_tilde_class, (t_method)route_tilde_dsp, - gensym("dsp"), A_CANT, 0); + zexy_addmethod(route_tilde_class, (t_method)nullfn, "signal", ""); + zexy_addmethod(route_tilde_class, (t_method)route_tilde_dsp, "dsp", "!"); zexy_register("route~"); } diff --git a/externals/zexy/src/sfplay.c b/externals/zexy/src/sfplay.c index 49c6229e925c5ac5baa66377cbaee18179a31c8a..f38e3f21bb4884b5c15400ad46883473dc132f12 100644 --- a/externals/zexy/src/sfplay.c +++ b/externals/zexy/src/sfplay.c @@ -36,11 +36,11 @@ Modified: to search for, then with the first skip the first part of a soundfile is also loaded by the OS. - I experimented with asynchronous buffering with paralell + I experimented with asynchronous buffering with parallel process,which has shown no much performance hit, since more processes has to be handled and the modern OS's do caching anyway also caching is done in modern hard disk, so an additional cache - woud be an overhead, if not special behaviour is needed (big jumps + would be an overhead, if not special behaviour is needed (big jumps etc). This sfplayers should be used with an appropriate audio buffer for @@ -58,7 +58,7 @@ Todo: then players and to enable glueless switching between soundfiles. please mail problems and ideas for improvements to -ritsch@iem.kug.ac.at */ +ritsch@iem.at */ /*#define DEBUG_ME // for debugging messages */ @@ -81,7 +81,7 @@ ritsch@iem.kug.ac.at */ # define BINREADMODE "r" #endif -static t_class *sfplay_class; +static t_class *sfplay_class=NULL; typedef struct _sfplay { t_object x_obj; @@ -153,7 +153,7 @@ static void sfplay_helper(t_sfplay* UNUSED(x)) /* METHOD: "open" file */ -/* this dont use memory map, because I dont know about this on NT ? +/* this don't use memory map, because I don't know about this on NT ? Use of the buffered functions fopen, fseek fread fclose instead the non buffered ones open read close */ @@ -184,10 +184,10 @@ static void sfplay_open(t_sfplay *x,t_symbol *filename,t_symbol *endian) #endif if (x->fp != NULL) { - z_fclose(x->fp); /* should not happen */ + sys_fclose(x->fp); /* should not happen */ } - if (!(x->fp = z_fopen(x->filename->s_name,BINREADMODE))) { + if (!(x->fp = sys_fopen(x->filename->s_name,BINREADMODE))) { error("sfplay: can't open %s", x->filename->s_name); } } @@ -203,7 +203,7 @@ static void sfplay_close(t_sfplay *x) /* now in state machine if(x->fp != NULL) { - z_fclose(x->fp); + sys_fclose(x->fp); x->fp = NULL; } */ @@ -214,7 +214,7 @@ static void sfplay_close(t_sfplay *x) return; } -/* for skipping header of soundfile Dont use this for memory map */ +/* for skipping header of soundfile. don't use this for memory map */ static int sfplay_skip(t_sfplay *x) { @@ -255,7 +255,7 @@ static void sfplay_start(t_sfplay *x) post("sfplay: start"); #endif - /* new offset postion ? (fom inlet offset) */ + /* new offset position ? (fom inlet offset) */ if( ((t_float) of) != x->x_offset) { x->skip=1; x->x_offset = of; @@ -426,7 +426,7 @@ static t_int *sfplay_perform(t_int *w) if(!x->play || x->please_stop) { - /* if closing dont need o go to stop */ + /* if closing don't need o go to stop */ if(x->please_close) { x->state = SFPLAY_CLOSE; x->count = SFPLAY_WAITTICKS; @@ -495,7 +495,7 @@ static t_int *sfplay_perform(t_int *w) *out[i]++ = s*(1./32768.); } } - return (w+c+4); /* dont zero out outs */ + return (w+c+4); /* don't zero out outs */ /* ok read error please close */ case SFPLAY_ERROR: @@ -523,7 +523,7 @@ static t_int *sfplay_perform(t_int *w) /* avoid openfiles */ if(x->fp) { - z_fclose(x->fp); + sys_fclose(x->fp); x->fp = NULL; }; @@ -596,7 +596,7 @@ static void sfplay_dsp(t_sfplay *x, t_signal **sp) /* create sfplay with args <channels> <skip> */ -static void *sfplay_new(t_floatarg chan,t_floatarg skip) +static void *sfplay_new(t_floatarg chan, t_floatarg skip) { t_sfplay *x = (t_sfplay *)pd_new(sfplay_class); t_int c = chan; @@ -662,33 +662,24 @@ static void sfplay_free(t_sfplay *x) freebytes(x->filep, DACBLKSIZE*sizeof(short)*x->x_channels); } -void sfplay_setup(void) +ZEXY_SETUP void sfplay_setup(void) { - sfplay_class = class_new(gensym("sfplay"), (t_newmethod)sfplay_new, - (t_method)sfplay_free, - sizeof(t_sfplay), 0, A_DEFFLOAT, A_DEFFLOAT,0); - class_addmethod(sfplay_class, nullfn, gensym("signal"), 0); - class_addmethod(sfplay_class, (t_method)sfplay_dsp, gensym("dsp"), - A_CANT, 0); - - class_addmethod(sfplay_class, (t_method)sfplay_helper, gensym("help"), - A_NULL); + sfplay_class = zexy_new("sfplay", + sfplay_new, sfplay_free, t_sfplay, 0, "FF"); + zexy_addmethod(sfplay_class, (t_method)nullfn, "signal", ""); + zexy_addmethod(sfplay_class, (t_method)sfplay_dsp, "dsp", "!"); + + zexy_addmethod(sfplay_class, (t_method)sfplay_helper, "help", ""); class_sethelpsymbol(sfplay_class, gensym("sf-play_record")); /* method open with filename */ - class_addmethod(sfplay_class, (t_method)sfplay_open, gensym("open"), - A_SYMBOL,A_SYMBOL,A_NULL); - class_addmethod(sfplay_class, (t_method)sfplay_close, gensym("close"), - A_NULL); - - class_addmethod(sfplay_class, (t_method)sfplay_start, gensym("start"), - A_NULL); - class_addmethod(sfplay_class, (t_method)sfplay_stop, gensym("stop"), - A_NULL); - class_addmethod(sfplay_class, (t_method)sfplay_rewind, gensym("rewind"), - A_NULL); - class_addmethod(sfplay_class, (t_method)sfplay_offset, gensym("goto"), - A_DEFFLOAT, A_NULL); + zexy_addmethod(sfplay_class, (t_method)sfplay_open, "open", "ss"); + zexy_addmethod(sfplay_class, (t_method)sfplay_close, "close", ""); + + zexy_addmethod(sfplay_class, (t_method)sfplay_start, "start", ""); + zexy_addmethod(sfplay_class, (t_method)sfplay_stop, "stop", ""); + zexy_addmethod(sfplay_class, (t_method)sfplay_rewind, "rewind", ""); + zexy_addmethod(sfplay_class, (t_method)sfplay_offset, "goto", "F"); /* start stop with 0 and 1 */ class_addfloat(sfplay_class, sfplay_float); diff --git a/externals/zexy/src/sfrecord.c b/externals/zexy/src/sfrecord.c index 0e491ce9d58d0e07417c6dad1e5a46666f2f9238..5c61572b67553f72b52b31a0a2e33cc5e95e8b70 100644 --- a/externals/zexy/src/sfrecord.c +++ b/externals/zexy/src/sfrecord.c @@ -23,8 +23,8 @@ Modified: sfrecord.c - hacked from sfplay ::: 2308:forum::für::umläute:1999 @ iem please mail problems and ideas for improvements to -ritsch@iem.kug.ac.at -zmoelnig@iem.kug.ac.at +ritsch@iem.at +zmoelnig@iem.at */ /* TODO: deprecate this in favour of [writesf~] */ @@ -36,14 +36,14 @@ zmoelnig@iem.kug.ac.at /* #include "m_imp.h" */ -#define DACBLKSIZE 64 /* in m_imp.h, but error if it is included it here*/ +#define DACBLKSIZE 64 /* in m_imp.h, but error if it is included it here*/ #include <stdio.h> #include <string.h> #include <fcntl.h> /* ------------------------ sfrecord ----------------------------- */ -#define MAX_CHANS 8 /* channels for soundfiles 1,2,4,8 */ +#define MAX_CHANS 8 /* channels for soundfiles 1,2,4,8 */ #ifdef __WIN32__ # define BINWRITEMODE "wb" @@ -53,7 +53,7 @@ zmoelnig@iem.kug.ac.at # define BINWRITEMODE "w" #endif -static t_class *sfrecord_class; +static t_class *sfrecord_class=NULL; typedef struct _sfrecord { t_object x_obj; @@ -62,36 +62,36 @@ typedef struct _sfrecord { t_symbol* filename; /* filename */ /* - because there is no command queue, - flags are used instead + because there is no command queue, + flags are used instead */ - t_int write; /* write: 1, stop: 0 */ - t_int please_stop; /* can be reset only by stop-state itself */ - t_int please_close; /* can be reset only by close-state */ - t_int x_channels; /* channels to write */ - t_float x_offset; /* offset to start writing */ - t_float offset; /* inlet value offset in secs */ - t_float x_skip; /* skip bytes because header */ - t_int skip; /* pending skip if 1 */ - t_float x_speed; /* write speed, not supported in this version */ - t_int size; /* size of file (if memory mapped) */ - t_int swap; /* swap bytes from l->b or b->m */ - FILE *fp; /* file oper non-NULL of open */ - t_int state; /* which state is writer in */ - t_int count; /* count for ticks before next step */ + t_int write; /* write: 1, stop: 0 */ + t_int please_stop; /* can be reset only by stop-state itself */ + t_int please_close; /* can be reset only by close-state */ + t_int x_channels; /* channels to write */ + t_float x_offset; /* offset to start writing */ + t_float offset; /* inlet value offset in secs */ + t_float x_skip; /* skip bytes because header */ + t_int skip; /* pending skip if 1 */ + t_float x_speed; /* write speed, not supported in this version */ + t_int size; /* size of file (if memory mapped) */ + t_int swap; /* swap bytes from l->b or b->m */ + FILE *fp; /* file oper non-NULL of open */ + t_int state; /* which state is writer in */ + t_int count; /* count for ticks before next step */ } t_sfrecord; /* states of statemachine */ -#define SFRECORD_WAIT 0 /* wait for open */ -#define SFRECORD_OPEN 1 -#define SFRECORD_CLOSE 2 -#define SFRECORD_SKIP 3 -#define SFRECORD_WRITE 4 -#define SFRECORD_STOP 5 -#define SFRECORD_ERROR -1 +#define SFRECORD_WAIT 0 /* wait for open */ +#define SFRECORD_OPEN 1 +#define SFRECORD_CLOSE 2 +#define SFRECORD_SKIP 3 +#define SFRECORD_WRITE 4 +#define SFRECORD_STOP 5 +#define SFRECORD_ERROR -1 -#define SFRECORD_WAITTICKS 10 /* 1 tick of 64 Samples is ca.1.5ms on 441000 */ +#define SFRECORD_WAITTICKS 10 /* 1 tick of 64 Samples is ca.1.5ms on 441000 */ /* split the os-calls in as many steps as possible to split them on different ticks in steps of SFRECORD_WAITTICKS @@ -117,7 +117,7 @@ static void state_out(t_sfrecord *x, int state) /* METHOD: "open" file */ -/* this dont use memory map, because I dont know about this on NT ? +/* this don't use memory map, because I don't know about this on NT ? Use of the buffered functions fopen, fseek fread fclose instead the non buffered ones open read close */ @@ -152,10 +152,10 @@ static void sfrecord_open(t_sfrecord *x,t_symbol *filename, #endif if (x->fp != NULL) { - z_fclose(x->fp); /* should not happen */ + sys_fclose(x->fp); /* should not happen */ } - if (!(x->fp = z_fopen(x->filename->s_name,BINWRITEMODE))) { + if (!(x->fp = sys_fopen(x->filename->s_name,BINWRITEMODE))) { error("sfrecord: can't open %s", x->filename->s_name); } } @@ -168,14 +168,6 @@ static void sfrecord_close(t_sfrecord *x) x->write = 0; x->please_close = 1; - /* now in state machine - if(x->fp != NULL) - { - z_fclose(x->fp); - x->fp = NULL; - } - */ - #ifdef DEBUG_ME post("sfrecord: closing "); #endif @@ -317,7 +309,7 @@ static t_int *sfrecord_perform(t_int *w) }; break; - case SFRECORD_STOP: /* in stop state mainly waits for write */ + case SFRECORD_STOP: /* in stop state mainly waits for write */ x->please_stop = 0; @@ -345,11 +337,11 @@ static t_int *sfrecord_perform(t_int *w) } break; - case SFRECORD_WRITE: /* yes write now */ + case SFRECORD_WRITE: /* yes write now */ if(!x->write || x->please_stop) { - /* if closing dont need to go to stop */ - if(x->please_close) { + /* if closing don't need to go to stop */ + if(x->please_close) { x->state = SFRECORD_CLOSE; x->count = SFRECORD_WAITTICKS; #ifdef DEBUG_ME @@ -357,7 +349,7 @@ static t_int *sfrecord_perform(t_int *w) #endif state_out(x, 0); - } else { + } else { x->state = SFRECORD_STOP; #ifdef DEBUG_ME post("write -> stop"); @@ -373,7 +365,8 @@ static t_int *sfrecord_perform(t_int *w) return (w+4+c); } - /* copy float to 16 Bit and swap if neccesairy */ /* LATER treat overflows */ + /* copy float to 16 Bit and swap if neccesairy */ + /* LATER treat overflows */ while (n--) { for (i=0; i<c; i++) { s = *in[i]++ * 32768.; @@ -400,7 +393,7 @@ static t_int *sfrecord_perform(t_int *w) if(feof(x->fp)) { while (n--) { - for (i=0; i<c; i++) { + for (i=0; i<c; i++) { if(--j > 0) { s = *buf++; if(swap) { @@ -433,7 +426,7 @@ static t_int *sfrecord_perform(t_int *w) /* ok :?: write error, please close */ case SFRECORD_ERROR: - if(!(x->count--)) { + if(!(x->count--)) { x->state = SFRECORD_CLOSE; sfrecord_close(x); #ifdef DEBUG_ME @@ -456,7 +449,7 @@ case SFRECORD_CLOSE: /* avoid openfiles */ if(x->fp) { - z_fclose(x->fp); + sys_fclose(x->fp); x->fp = NULL; }; @@ -606,25 +599,19 @@ static void sfrecord_free(t_sfrecord *x) freebytes(x->filep, DACBLKSIZE*sizeof(short)*x->x_channels); } -void sfrecord_setup(void) +ZEXY_SETUP void sfrecord_setup(void) { - sfrecord_class = class_new(gensym("sfrecord"), (t_newmethod)sfrecord_new, - (t_method)sfrecord_free, - sizeof(t_sfrecord), 0, A_DEFFLOAT, A_DEFFLOAT,0); - class_addmethod(sfrecord_class, nullfn, gensym("signal"), 0); - class_addmethod(sfrecord_class, (t_method)sfrecord_dsp, gensym("dsp"), - A_CANT, 0); + sfrecord_class = zexy_new("sfrecord", + sfrecord_new, sfrecord_free, t_sfrecord, 0, "F"); + zexy_addmethod(sfrecord_class, (t_method)nullfn, "signal", ""); + zexy_addmethod(sfrecord_class, (t_method)sfrecord_dsp, "dsp", "!"); /* method open with filename */ - class_addmethod(sfrecord_class, (t_method)sfrecord_open, gensym("open"), - A_SYMBOL,A_SYMBOL,A_NULL); - class_addmethod(sfrecord_class, (t_method)sfrecord_close, gensym("close"), - A_NULL); + zexy_addmethod(sfrecord_class, (t_method)sfrecord_open, "open", "ss"); + zexy_addmethod(sfrecord_class, (t_method)sfrecord_close, "close", ""); - class_addmethod(sfrecord_class, (t_method)sfrecord_start, gensym("start"), - A_NULL); - class_addmethod(sfrecord_class, (t_method)sfrecord_stop, gensym("stop"), - A_NULL); + zexy_addmethod(sfrecord_class, (t_method)sfrecord_start, "start", ""); + zexy_addmethod(sfrecord_class, (t_method)sfrecord_stop, "stop", ""); /* start/stop with 0/1 */ class_addfloat(sfrecord_class, sfrecord_float); @@ -633,8 +620,7 @@ void sfrecord_setup(void) class_addbang(sfrecord_class,sfrecord_bang); /* some help */ - class_addmethod(sfrecord_class, (t_method)sfrecord_helper, gensym("help"), - A_NULL); + zexy_addmethod(sfrecord_class, (t_method)sfrecord_helper, "help", ""); class_sethelpsymbol(sfrecord_class, gensym("sf-play_record")); zexy_register("sfrecord"); } diff --git a/externals/zexy/src/sgn~.c b/externals/zexy/src/sgn~.c index 6e6e03d8aa5a5ed3f3c179a524dc3088e4149697..7b67c7ac3aefb7ea81f151bb9d45f7f69b6c4712 100644 --- a/externals/zexy/src/sgn~.c +++ b/externals/zexy/src/sgn~.c @@ -26,7 +26,7 @@ typedef struct _sgnTilde { /* ------------------------ sgn~ ----------------------------- */ -static t_class *sgnTilde_class; +static t_class *sgnTilde_class=NULL; static t_int *sgnTilde_perform(t_int *w) { @@ -38,7 +38,7 @@ static t_int *sgnTilde_perform(t_int *w) x=*in++; if (x>0.) { *out++=1.; - } else if (x<0.) { + } else if (x<0.) { *out++=-1.; } else { *out++=0.; @@ -139,13 +139,13 @@ static t_int *sgnTilde_performSSE(t_int *w) while (n--) { val=in[0]; - xmm0 = _mm_cmpneq_ps(val , zero);/* mask for non-zeros */ + xmm0 = _mm_cmpneq_ps(val, zero); /* mask for non-zeros */ xmm1 = _mm_and_ps (val, sgnmask);/* sign (without value) */ xmm0 = _mm_and_ps (xmm0, one); /* (abs) value: (val==0.f)?0.f:1.f */ out[0]= _mm_or_ps (xmm1, xmm0);/* merge sign and value */ val=in[1]; - xmm0 = _mm_cmpneq_ps(val , zero); + xmm0 = _mm_cmpneq_ps(val, zero); xmm1 = _mm_and_ps (val, sgnmask); xmm0 = _mm_and_ps (xmm0, one); out[1]= _mm_or_ps (xmm1, xmm0); @@ -158,7 +158,7 @@ static t_int *sgnTilde_performSSE(t_int *w) } #endif /* __SSE__ */ -static void sgnTilde_dsp(t_sgnTilde *x, t_signal **sp) +static void sgnTilde_dsp(t_sgnTilde *UNUSED(x), t_signal **sp) { #ifdef __SSE__ if( @@ -175,7 +175,7 @@ static void sgnTilde_dsp(t_sgnTilde *x, t_signal **sp) } else #endif if (sp[0]->s_n & 7) { - dsp_add(sgnTilde_perform , 3, sp[0]->s_vec, sp[1]->s_vec, (t_int)sp[0]->s_n); + dsp_add(sgnTilde_perform, 3, sp[0]->s_vec, sp[1]->s_vec, (t_int)sp[0]->s_n); } else { dsp_add(sgnTilde_perform8, 3, sp[0]->s_vec, sp[1]->s_vec, (t_int)sp[0]->s_n); } @@ -195,16 +195,14 @@ static void *sgnTilde_new(void) return (x); } -void sgn_tilde_setup(void) +ZEXY_SETUP void sgn_tilde_setup(void) { - sgnTilde_class = class_new(gensym("sgn~"), (t_newmethod)sgnTilde_new, 0, - sizeof(t_sgnTilde), 0, A_DEFFLOAT, 0); - class_addmethod(sgnTilde_class, nullfn, gensym("signal"), 0); - class_addmethod(sgnTilde_class, (t_method)sgnTilde_dsp, gensym("dsp"), - A_CANT, 0); - - class_addmethod(sgnTilde_class, (t_method)sgnTilde_helper, gensym("help"), - 0); + sgnTilde_class = zexy_new("sgn~", + sgnTilde_new, 0, t_sgnTilde, 0, ""); + zexy_addmethod(sgnTilde_class, (t_method)nullfn, "signal", ""); + zexy_addmethod(sgnTilde_class, (t_method)sgnTilde_dsp, "dsp", "!"); + + zexy_addmethod(sgnTilde_class, (t_method)sgnTilde_helper, "help", ""); class_sethelpsymbol(sgnTilde_class, gensym("zigbinops")); zexy_register("sgn~"); } diff --git a/externals/zexy/src/sigzero~.c b/externals/zexy/src/sigzero~.c index 8a12b538c5c0b7e367fd788dc024276e02447200..93bf89347149f174afe58f594dd8665eee449b9c 100644 --- a/externals/zexy/src/sigzero~.c +++ b/externals/zexy/src/sigzero~.c @@ -26,7 +26,7 @@ #include "zexy.h" -static t_class *sigzero_class; +static t_class *sigzero_class=NULL; typedef struct _sigzero { t_object x_obj; @@ -55,9 +55,9 @@ static t_int *sigzero_perform(t_int *w) t_sigzero *x = (t_sigzero *)w[2]; int n = (int)w[3]; - int non_zero = 0; if (x->activate) { + int non_zero = 0; while (n--) { if (*in++ != 0.) { non_zero = 1; @@ -79,7 +79,8 @@ static void sigzero_dsp(t_sigzero *x, t_signal **sp) static void sigzero_tilde_helper(void) { - post("\n"HEARTSYMBOL " sigzero~-object :: for detecting whether a signal is currently zero or not"); + post("\n"HEARTSYMBOL + " sigzero~-object :: for detecting whether a signal is currently zero or not"); post("'bang'\t: turn the detector on\n" "'off'\t: turn it off\n" "<1/0>\t: turn it on/off\n" @@ -95,19 +96,17 @@ static void *sigzero_new(void) return (x); } -void sigzero_tilde_setup(void) +ZEXY_SETUP void sigzero_tilde_setup(void) { - sigzero_class = class_new(gensym("sigzero~"), (t_newmethod)sigzero_new, 0, - sizeof(t_sigzero), 0, 0); + sigzero_class = zexy_new("sigzero~", + sigzero_new, 0, t_sigzero, 0, ""); class_addfloat(sigzero_class, sigzero_activate); class_addbang(sigzero_class, sigzero_banged); - class_addmethod(sigzero_class, (t_method)sigzero_off, gensym("off"), 0); + zexy_addmethod(sigzero_class, (t_method)sigzero_off, "off", ""); - class_addmethod(sigzero_class, nullfn, gensym("signal"), 0); - class_addmethod(sigzero_class, (t_method)sigzero_dsp, gensym("dsp"), - A_CANT, 0); + zexy_addmethod(sigzero_class, (t_method)nullfn, "signal", ""); + zexy_addmethod(sigzero_class, (t_method)sigzero_dsp, "dsp", "!"); - class_addmethod(sigzero_class, (t_method)sigzero_tilde_helper, - gensym("help"), 0); + zexy_addmethod(sigzero_class, (t_method)sigzero_tilde_helper, "help", ""); zexy_register("sigzero~"); } diff --git a/externals/zexy/src/sleepgrain.c b/externals/zexy/src/sleepgrain.c index 8fe75ce9bf28bacc9b2042b4caae9e19153b996e..c341d20bff58ee0ee98c9477b66711b692428a81 100644 --- a/externals/zexy/src/sleepgrain.c +++ b/externals/zexy/src/sleepgrain.c @@ -24,7 +24,7 @@ EXTERN int* get_sys_sleepgrain(void ) ; /* ------------------------- sleepgrain ------------------------------- */ -static t_class *sleepgrain_class; +static t_class *sleepgrain_class=NULL; typedef struct _sleepgrain { t_object x_obj; @@ -61,11 +61,10 @@ static void *sleepgrain_new(void) return (x); } -void sleepgrain_setup(void) +ZEXY_SETUP void sleepgrain_setup(void) { - sleepgrain_class = class_new(gensym("sleepgrain"), - (t_newmethod)sleepgrain_new, - 0, sizeof(t_sleepgrain), 0, A_NULL); + sleepgrain_class = zexy_new("sleepgrain", + sleepgrain_new, 0, t_sleepgrain, 0, ""); class_addbang (sleepgrain_class, sleepgrain_bang); class_addfloat (sleepgrain_class, sleepgrain_float); diff --git a/externals/zexy/src/sort.c b/externals/zexy/src/sort.c index e0574a788147a3fe194d47da8d497a99040411c9..1b0add970f2162d9f0e724e6e7be352fe410702c 100644 --- a/externals/zexy/src/sort.c +++ b/externals/zexy/src/sort.c @@ -25,7 +25,7 @@ SHELL SORT: simple and easy */ -static t_class *sort_class; +static t_class *sort_class=NULL; typedef struct _sort { t_object x_obj; @@ -71,7 +71,8 @@ static void sort_buffer(t_sort *x, int argc, t_atom *argv) } } -static void sort_list(t_sort *x, t_symbol *s, int argc, t_atom *argv) +static void sort_list(t_sort *x, t_symbol *UNUSED(s), int argc, + t_atom *argv) { int step = argc, n; t_atom *atombuf = (t_atom *)getbytes(sizeof(t_atom) * argc); @@ -107,19 +108,17 @@ static void sort_list(t_sort *x, t_symbol *s, int argc, t_atom *argv) if (x->ascending) for (n = 0; n < argc; n++) { SETFLOAT(&atombuf[n], idx[n]); - } - else + } else for (n = 0, i=argc-1; n < argc; n++, i--) { SETFLOAT(&atombuf[n], idx[i]); } - outlet_list(x->indexOut , gensym("list"), n, atombuf); + outlet_list(x->indexOut, gensym("list"), n, atombuf); if (x->ascending) for (n = 0; n < argc; n++) { SETFLOAT(&atombuf[n], buf[n]); - } - else + } else for (n = 0, i=argc-1; n < argc; n++, i--) { SETFLOAT(&atombuf[n], buf[i]); } @@ -146,19 +145,29 @@ static void *sort_new(t_floatarg f) return (x); } -static void sort_help(t_sort*x) +static void sort_help(t_sort*UNUSED(x)) { post("\n"HEARTSYMBOL " sort\t\t:: sort a list of numbers"); } -void sort_setup(void) + +ZEXY_SETUP void zexy_sort_setup(void) { - sort_class = class_new(gensym("sort"), (t_newmethod)sort_new, - 0, sizeof(t_sort), 0, A_DEFFLOAT, 0); + sort_class = zexy_new("sort", + sort_new, 0, t_sort, 0, "F"); class_addlist (sort_class, sort_list); - class_addmethod (sort_class, (t_method)sort_dir, gensym("direction"), - A_DEFFLOAT, 0); - class_addmethod(sort_class, (t_method)sort_help, gensym("help"), A_NULL); + zexy_addmethod(sort_class, (t_method)sort_dir, "direction", "F"); + zexy_addmethod(sort_class, (t_method)sort_help, "help", ""); zexy_register("sort"); } + +#ifndef ZEXY_LIBRARY +/* only use sort_setup() when building as standalone objects + * see https://git.iem.at/pd/zexy/issues/5 + */ +void sort_setup(void) +{ + zexy_sort_setup(); +} +#endif diff --git a/externals/zexy/src/step~.c b/externals/zexy/src/step~.c index a35ed35be5ba65f922b12735ea4933c3e08338e3..48cfdaceeb12b38fcc7e833ab42549a87d066273 100644 --- a/externals/zexy/src/step~.c +++ b/externals/zexy/src/step~.c @@ -18,22 +18,23 @@ */ /* - step~ : will make a unity step at a desired point in the signal-vector; the second input specifies a - length: after the so-specified time has elapsed, the step will toggle back to the previous - value; - the length can be passed as an argument when creating the object - with length==1 you might do the dirac~ thing a little bit more complicated - with length==0 the output just toggles between 0 and 1 every time you bang the object - - NOTE : the inlets do NOT specify any times but sample-NUMBERS; there are 64 samples in a signal-vector, - each "lasting" for 1/44100 secs. + step~ : will make a unity step at a desired point in the signal-vector; + the second input specifies a + length: after the so-specified time has elapsed, + the step will toggle back to the previous value; + the length can be passed as an argument when creating the object + with length==1 you might do the dirac~ thing a little bit more complicated + with length==0 the output just toggles between 0 and 1 every time you bang the object + + NOTE : the inlets do NOT specify any times but sample-NUMBERS; + there are 64 samples in a signal-vector, each "lasting" for 1/44100 secs. */ #include "zexy.h" /* ------------------------ step~ ----------------------------- */ -static t_class *step_class; +static t_class *step_class=NULL; typedef struct _step { t_object x_obj; @@ -129,19 +130,17 @@ static void *step_new(t_floatarg farg) return (x); } -void step_tilde_setup(void) +ZEXY_SETUP void step_tilde_setup(void) { - step_class = class_new(gensym("step~"), (t_newmethod)step_new, 0, - sizeof(t_step), 0, A_DEFFLOAT, 0); + step_class = zexy_new("step~", + step_new, 0, t_step, 0, "F"); class_addfloat(step_class, step_float); class_addbang(step_class, step_bang); - class_addmethod(step_class, (t_method)step_setlength, gensym("ft1"), - A_FLOAT, 0); - class_addmethod(step_class, (t_method)step_dsp, gensym("dsp"), - A_CANT, 0); + zexy_addmethod(step_class, (t_method)step_setlength, "ft1", "f"); + zexy_addmethod(step_class, (t_method)step_dsp, "dsp", "!"); - class_addmethod(step_class, (t_method)step_helper, gensym("help"), 0); + zexy_addmethod(step_class, (t_method)step_helper, "help", ""); zexy_register("step~"); } diff --git a/externals/zexy/src/strcmp.c b/externals/zexy/src/strcmp.c index 7219177782cb584c107e22d3f64c1b8d342dec5d..054d825a0d770322add2f866cafab21dcf20cbad 100644 --- a/externals/zexy/src/strcmp.c +++ b/externals/zexy/src/strcmp.c @@ -18,6 +18,7 @@ */ #include "zexy.h" +#include "zexy_strndup.h" #include <stdlib.h> #include <string.h> @@ -25,8 +26,8 @@ /* compare 2 lists ( == for lists) */ -static t_class *strcmp_class; -static t_class *strcmp_proxy_class; +static t_class *strcmp_class=NULL; +static t_class *strcmp_proxy_class=NULL; typedef struct _strcmp { @@ -94,8 +95,8 @@ static void strcmp_symbol(t_strcmp *x, t_symbol *s) if(x->str1&&x->n1) { freebytes(x->str1, x->n1); } - x->n1=0; - x->str1=s->s_name; + x->str1=zexy_strndup(s->s_name, MAXPDSTRING); + x->n1=strnlen(x->str1, MAXPDSTRING); strcmp_bang(x); } @@ -109,8 +110,8 @@ static void strcmp_secondsymbol(t_strcmp *x, t_symbol *s) if(x->str2&&x->n2) { freebytes(x->str2, x->n2); } - x->n2=0; - x->str2=s->s_name; + x->str2=zexy_strndup(s->s_name, MAXPDSTRING); + x->n2=strnlen(x->str2, MAXPDSTRING); } static void strcmp_proxy_list(t_strcmp_proxy *y, t_symbol *s, int argc, @@ -167,27 +168,25 @@ static void strcmp_free(t_strcmp *x) } -static void strcmp_help(t_strcmp*x) +static void strcmp_help(t_strcmp*UNUSED(x)) { post("\n"HEARTSYMBOL " strcmp\t\t:: compare to lists as strings"); } -void strcmp_setup(void) +ZEXY_SETUP void strcmp_setup(void) { - strcmp_class = class_new(gensym("strcmp"), (t_newmethod)strcmp_new, - (t_method)strcmp_free, sizeof(t_strcmp), 0, A_GIMME, 0); + strcmp_class = zexy_new("strcmp", + strcmp_new, strcmp_free, t_strcmp, 0, "*"); class_addbang (strcmp_class, strcmp_bang); class_addsymbol (strcmp_class, strcmp_symbol); class_addlist (strcmp_class, strcmp_list); - strcmp_proxy_class = class_new(gensym("strcmp proxy"), 0, 0, - sizeof(t_strcmp_proxy), - CLASS_PD | CLASS_NOINLET, 0); + strcmp_proxy_class = zexy_new("strcmp proxy", + 0, 0, t_strcmp_proxy, CLASS_PD | CLASS_NOINLET, ""); class_addsymbol(strcmp_proxy_class, strcmp_proxy_symbol); class_addlist(strcmp_proxy_class, strcmp_proxy_list); - class_addmethod(strcmp_class, (t_method)strcmp_help, gensym("help"), - A_NULL); + zexy_addmethod(strcmp_class, (t_method)strcmp_help, "help", ""); zexy_register("strcmp"); } diff --git a/externals/zexy/src/sum.c b/externals/zexy/src/sum.c index 419b9d06cf1ed7dbe311200dca050e30b416a07a..fa84093f37fa42a093ee118324f4c7eb752987a1 100644 --- a/externals/zexy/src/sum.c +++ b/externals/zexy/src/sum.c @@ -19,7 +19,7 @@ #include "zexy.h" -static t_class *sum_class; +static t_class *sum_class=NULL; typedef struct _sum { t_object x_obj; @@ -50,13 +50,13 @@ static void sum_help(void) post("sum\t:: calculate the sum of a list of floats"); } -void sum_setup(void) +ZEXY_SETUP void sum_setup(void) { - sum_class = class_new(gensym("sum"), (t_newmethod)sum_new, 0, - sizeof(t_sum), 0, A_DEFFLOAT, 0); + sum_class = zexy_new("sum", + sum_new, 0, t_sum, 0, ""); class_addlist(sum_class, (t_method)sum_list); - class_addmethod(sum_class, (t_method)sum_help, gensym("help"), 0); + zexy_addmethod(sum_class, (t_method)sum_help, "help", ""); zexy_register("sum"); } diff --git a/externals/zexy/src/swap~.c b/externals/zexy/src/swap~.c index 9d6486eead09a893d23d7a34bbcee7493f87b3dd..4e2294a3114dcfd1241210712960eb9008c60490 100644 --- a/externals/zexy/src/swap~.c +++ b/externals/zexy/src/swap~.c @@ -30,7 +30,7 @@ #define FLOAT2SHORT 32768. #define SHORT2FLOAT 1./32768. -static t_class *swap_class; +static t_class *swap_class=NULL; typedef struct _swap { t_object x_obj; @@ -49,19 +49,17 @@ static void swap_bang(t_swap *x) static t_int *swap_perform(t_int *w) { - t_swap *x = (t_swap *)(w[1]); + t_swap *x = (t_swap *)(w[1]); t_sample *in = (t_sample *)(w[2]); t_sample *out = (t_sample *)(w[3]); int n = (int)(w[4]); - if (x->swapper) while (n--) { short dummy = FLOAT2SHORT **in++; *out++ = SHORT2FLOAT * (short)( ((dummy & 0xFF) << 8) | (( dummy & 0xFF00) >> 8) ); - } - else while (n--) { + } else while (n--) { *out++ = *in++; } @@ -91,17 +89,16 @@ static void *swap_new(void) return (x); } -void swap_tilde_setup(void) +ZEXY_SETUP void swap_tilde_setup(void) { - swap_class = class_new(gensym("swap~"), (t_newmethod)swap_new, 0, - sizeof(t_swap), 0, A_NULL); - class_addmethod(swap_class, nullfn, gensym("signal"), 0); - class_addmethod(swap_class, (t_method)swap_dsp, gensym("dsp"), - A_CANT, 0); + swap_class = zexy_new("swap~", + swap_new, 0, t_swap, 0, ""); + zexy_addmethod(swap_class, (t_method)nullfn, "signal", ""); + zexy_addmethod(swap_class, (t_method)swap_dsp, "dsp", "!"); class_addfloat(swap_class, swap_float); class_addbang(swap_class, swap_bang); - class_addmethod(swap_class, (t_method)swap_helper, gensym("help"), 0); + zexy_addmethod(swap_class, (t_method)swap_helper, "help", ""); zexy_register("swap~"); } diff --git a/externals/zexy/src/symbol2list.c b/externals/zexy/src/symbol2list.c index 935b2be2e8344d179adb41deae75a61e0c5cdd37..d8ec7f0a5ebed7814bc56aac275b2f4c625589fd 100644 --- a/externals/zexy/src/symbol2list.c +++ b/externals/zexy/src/symbol2list.c @@ -23,7 +23,7 @@ /* ------------------------- symbol2list ------------------------------- */ -static t_class *symbol2list_class; +static t_class *symbol2list_class = NULL; typedef struct _symbol2list { t_object x_obj; @@ -38,12 +38,12 @@ static void symbol2list_delimiter(t_symbol2list *x, t_symbol *s) x->delimiter = s; } -STATIC_INLINE void string2atom(t_atom *ap, char* cp, int clen) +STATIC_INLINE void string2atom(t_atom *ap, const char* cp, int clen) { char *buffer=getbytes(sizeof(char)*(clen+1)); char *endptr[1]; t_float ftest; - strncpy(buffer, cp, clen); + strncpy(buffer, cp, clen+1); buffer[clen]=0; ftest=strtod(buffer, endptr); /* what should we do with the special cases of hexadecimal values, "INF" and "NAN" ??? @@ -62,10 +62,10 @@ STATIC_INLINE void string2atom(t_atom *ap, char* cp, int clen) } static void symbol2list_process(t_symbol2list *x) { - char *cc; - char *deli; + const char *cc, *cp; + const char *deli; int dell; - char *cp, *d; + char *d; int i=1; if (x->s==NULL) { @@ -159,31 +159,35 @@ static void *symbol2list_new(t_symbol* UNUSED(s), int argc, t_atom *argv) return (x); } -static void symbol2list_free(t_symbol2list *x) +static void symbol2list_free(t_symbol2list *UNUSED(x)) {} -static void symbol2list_help(t_symbol2list*x) +static void symbol2list_help(t_symbol2list*UNUSED(x)) { - post("\n"HEARTSYMBOL " symbol2list\t:: split a symbol into a list of atoms"); + post("\n"HEARTSYMBOL + " symbol2list\t:: split a symbol into a list of atoms"); } - -void symbol2list_setup(void) +static t_class* zclass_setup(const char*name) +{ + t_class*c = zexy_new(name, + symbol2list_new, symbol2list_free, t_symbol2list, 0, "*"); + class_addsymbol (c, symbol2list_symbol); + class_addbang (c, symbol2list_bang); + zexy_addmethod(c, (t_method)symbol2list_delimiter, "", "s"); + zexy_addmethod(c, (t_method)symbol2list_help, "help", ""); + return c; +} +static void dosetup() { - symbol2list_class = class_new(gensym("symbol2list"), - (t_newmethod)symbol2list_new, - (t_method)symbol2list_free, sizeof(t_symbol2list), 0, A_GIMME, 0); - - class_addcreator((t_newmethod)symbol2list_new, gensym("s2l"), A_GIMME, 0); - class_addsymbol (symbol2list_class, symbol2list_symbol); - class_addbang (symbol2list_class, symbol2list_bang); - class_addmethod (symbol2list_class, (t_method)symbol2list_delimiter, - gensym(""), A_SYMBOL, 0); - class_addmethod(symbol2list_class, (t_method)symbol2list_help, - gensym("help"), A_NULL); - zexy_register("symbol2list"); + symbol2list_class=zclass_setup("symbol2list"); + zclass_setup("s2l"); +} +ZEXY_SETUP void symbol2list_setup(void) +{ + dosetup(); } void s2l_setup(void) { - symbol2list_setup(); + dosetup(); } diff --git a/externals/zexy/src/tabdump.c b/externals/zexy/src/tabdump.c index 03ef0614b7c9cb67906ab263758f7b645a05b5c8..dd13cf98d9df633900dc58e7c0bfef9f8b389178 100644 --- a/externals/zexy/src/tabdump.c +++ b/externals/zexy/src/tabdump.c @@ -21,7 +21,7 @@ /* =================== tabdump ====================== */ -static t_class *tabdump_class; +static t_class *tabdump_class=NULL; typedef struct _tabdump { t_object x_obj; @@ -33,11 +33,11 @@ static void tabdump_bang(t_tabdump *x) { t_garray *A; int npoints; - zarray_t *vec; + t_word *vec; if (!(A = (t_garray *)pd_findbyclass(x->x_arrayname, garray_class))) { error("%s: no such array", x->x_arrayname->s_name); - } else if (!zarray_getarray(A, &npoints, &vec)) { + } else if (!garray_getfloatwords(A, &npoints, &vec)) { error("%s: bad template for tabdump", x->x_arrayname->s_name); } else { int n; @@ -55,7 +55,7 @@ static void tabdump_bang(t_tabdump *x) atombuf = (t_atom *)getbytes(sizeof(t_atom)*npoints); for (n = 0; n < npoints; n++) { - SETFLOAT(&atombuf[n], zarray_getfloat(vec, start+n)); + SETFLOAT(&atombuf[n], vec[start+n].w_float); } outlet_list(x->x_obj.ob_outlet, gensym("list"), npoints, atombuf); freebytes(atombuf,sizeof(t_atom)*npoints); @@ -97,7 +97,8 @@ static void *tabdump_new(t_symbol *s) static void tabdump_helper(void) { - post("\n"HEARTSYMBOL " tabdump - object : dumps a table as a package of floats"); + post("\n"HEARTSYMBOL + " tabdump - object : dumps a table as a package of floats"); post("'set <table>'\t: read out another table\n" "'bang'\t\t: dump the table\n" "outlet\t\t: table-data as package of floats"); @@ -105,17 +106,15 @@ static void tabdump_helper(void) } -void tabdump_setup(void) +ZEXY_SETUP void tabdump_setup(void) { - tabdump_class = class_new(gensym("tabdump"), (t_newmethod)tabdump_new, - 0, sizeof(t_tabdump), 0, A_DEFSYM, 0); + tabdump_class = zexy_new("tabdump", + tabdump_new, 0, t_tabdump, 0, "S"); class_addbang(tabdump_class, (t_method)tabdump_bang); class_addlist(tabdump_class, (t_method)tabdump_list); - class_addmethod(tabdump_class, (t_method)tabdump_set, gensym("set"), - A_SYMBOL, 0); + zexy_addmethod(tabdump_class, (t_method)tabdump_set, "set", "s"); - class_addmethod(tabdump_class, (t_method)tabdump_helper, gensym("help"), - 0); + zexy_addmethod(tabdump_class, (t_method)tabdump_helper, "help", ""); zexy_register("tabdump"); } diff --git a/externals/zexy/src/tabminmax.c b/externals/zexy/src/tabminmax.c index 89d8026cbe0b88eaaa348d8416dd50087dc68578..98e0ab836ffed97e1df76296229580425d901ec6 100644 --- a/externals/zexy/src/tabminmax.c +++ b/externals/zexy/src/tabminmax.c @@ -22,7 +22,7 @@ /* =================== tabminmax ====================== */ -static t_class *tabminmax_class; +static t_class *tabminmax_class=NULL; typedef struct _tabminmax { t_object x_obj; @@ -35,11 +35,11 @@ static void tabminmax_bang(t_tabminmax *x) { t_garray *A; int npoints; - zarray_t *vec; + t_word *vec; if (!(A = (t_garray *)pd_findbyclass(x->x_arrayname, garray_class))) { error("%s: no such array", x->x_arrayname->s_name); - } else if (!zarray_getarray(A, &npoints, &vec)) { + } else if (!garray_getfloatwords(A, &npoints, &vec)) { error("%s: bad template for tabminmax", x->x_arrayname->s_name); } else { int n; @@ -57,14 +57,14 @@ static void tabminmax_bang(t_tabminmax *x) } npoints=stop-start; - min=zarray_getfloat(vec, start); + min=vec[start].w_float; max=min; mindex=start; maxdex=start; for (n = 1; n < npoints; n++) { - t_float val=zarray_getfloat(vec, start+n); + t_float val=vec[start+n].w_float; if(val<min) { mindex=start+n; min=val; @@ -121,7 +121,8 @@ static void *tabminmax_new(t_symbol *s) static void tabminmax_helper(void) { - post("\n"HEARTSYMBOL " tabminmax - object : dumps a table as a package of floats"); + post("\n"HEARTSYMBOL + " tabminmax - object : dumps a table as a package of floats"); post("'set <table>'\t: read out another table\n" "'bang'\t\t: get min and max of the table\n" "outlet\t\t: table-data as package of floats"); @@ -129,18 +130,15 @@ static void tabminmax_helper(void) } -void tabminmax_setup(void) +ZEXY_SETUP void tabminmax_setup(void) { - tabminmax_class = class_new(gensym("tabminmax"), - (t_newmethod)tabminmax_new, - 0, sizeof(t_tabminmax), 0, A_DEFSYM, 0); + tabminmax_class = zexy_new("tabminmax", + tabminmax_new, 0, t_tabminmax, 0, "S"); class_addbang(tabminmax_class, (t_method)tabminmax_bang); class_addlist(tabminmax_class, (t_method)tabminmax_list); - class_addmethod(tabminmax_class, (t_method)tabminmax_set, gensym("set"), - A_SYMBOL, 0); + zexy_addmethod(tabminmax_class, (t_method)tabminmax_set, "set", "s"); - class_addmethod(tabminmax_class, (t_method)tabminmax_helper, - gensym("help"), 0); + zexy_addmethod(tabminmax_class, (t_method)tabminmax_helper, "help", ""); zexy_register("tabminmax"); } diff --git a/externals/zexy/src/tabread4~~.c b/externals/zexy/src/tabread4~~.c index 37cb27b4fa533d11cf1ee69c86d170d10f1906a0..8d92526b03de7498cf94d0118431c24445205538 100644 --- a/externals/zexy/src/tabread4~~.c +++ b/externals/zexy/src/tabread4~~.c @@ -23,12 +23,12 @@ /******************** tabread4~~ ***********************/ -static t_class *tabread4_tilde_class; +static t_class *tabread4_tilde_class=NULL; typedef struct _tabread4_tilde { t_object x_obj; int x_npoints; - zarray_t *x_vec; + t_word *x_vec; t_symbol *x_arrayname; t_float x_f; } t_tabread4_tilde; @@ -54,7 +54,7 @@ static t_int *tabread4_tilde_perform(t_int *w) t_sample *out = (t_sample *)(w[4]); int n = (int)(w[5]); int maxindex; - zarray_t *buf = x->x_vec, *wp; + t_word *buf = x->x_vec, *wp; int i; maxindex = x->x_npoints - 3; @@ -81,10 +81,10 @@ static t_int *tabread4_tilde_perform(t_int *w) wp = buf + index; - a = zarray_getfloat(wp,-1); - b = zarray_getfloat(wp, 0); - c = zarray_getfloat(wp, 1); - d = zarray_getfloat(wp, 2); + a = wp[-1].w_float; + b = wp[ 0].w_float; + c = wp[ 1].w_float; + d = wp[ 2].w_float; cminusb = c-b; *out++ = b + frac * ( @@ -106,7 +106,7 @@ static void tabread4_tilde_set(t_tabread4_tilde *x, t_symbol *s) pd_error(x, "tabread4~~: %s: no such array", x->x_arrayname->s_name); } x->x_vec = 0; - } else if (!zarray_getarray(a, &x->x_npoints, &x->x_vec)) { + } else if (!garray_getfloatwords(a, &x->x_npoints, &x->x_vec)) { pd_error(x, "%s: bad template for tabread4~~", x->x_arrayname->s_name); x->x_vec = 0; } else { @@ -123,20 +123,19 @@ static void tabread4_tilde_dsp(t_tabread4_tilde *x, t_signal **sp) } -static void tabread4_tilde_free(t_tabread4_tilde *x) +static void tabread4_tilde_free(t_tabread4_tilde *UNUSED(x)) { } -void tabread4_tilde_tilde_setup(void) +ZEXY_SETUP void tabread4_tilde_tilde_setup(void) { - tabread4_tilde_class = class_new(gensym("tabread4~~"), - (t_newmethod)tabread4_tilde_new, (t_method)tabread4_tilde_free, - sizeof(t_tabread4_tilde), 0, A_DEFSYM, 0); + tabread4_tilde_class = zexy_new("tabread4~~", + tabread4_tilde_new, tabread4_tilde_free, t_tabread4_tilde, 0, "S"); CLASS_MAINSIGNALIN(tabread4_tilde_class, t_tabread4_tilde, x_f); - class_addmethod(tabread4_tilde_class, (t_method)tabread4_tilde_dsp, - gensym("dsp"), A_CANT, 0); - class_addmethod(tabread4_tilde_class, (t_method)tabread4_tilde_set, - gensym("set"), A_SYMBOL, 0); + zexy_addmethod(tabread4_tilde_class, (t_method)tabread4_tilde_dsp, "dsp", + "!"); + zexy_addmethod(tabread4_tilde_class, (t_method)tabread4_tilde_set, "set", + "s"); zexy_register("tabread4~~"); } diff --git a/externals/zexy/src/tabset.c b/externals/zexy/src/tabset.c index 70b87a04fdf07d90c466f290203bfa5cd4f43fd5..466cb25431c9494f5bdc5b1c1b3b10cee5db56e0 100644 --- a/externals/zexy/src/tabset.c +++ b/externals/zexy/src/tabset.c @@ -24,7 +24,7 @@ /* =================== tabset ====================== */ -static t_class *tabset_class; +static t_class *tabset_class=NULL; typedef struct _tabset { t_object x_obj; @@ -35,15 +35,15 @@ static void tabset_float(t_tabset *x, t_floatarg f) { t_garray *A; int npoints; - zarray_t *vec; + t_word *vec; if (!(A = (t_garray *)pd_findbyclass(x->x_arrayname, garray_class))) { error("%s: no such array", x->x_arrayname->s_name); - } else if (!zarray_getarray(A, &npoints, &vec)) { + } else if (!garray_getfloatwords(A, &npoints, &vec)) { error("%s: bad template for tabset", x->x_arrayname->s_name); } else { while(npoints--) { - zarray_setfloat(vec, 0, f); + vec->w_float = f; vec++; } garray_redraw(A); @@ -55,28 +55,27 @@ static void tabset_list(t_tabset *x, t_symbol* UNUSED(s), int argc, { t_garray *A; int npoints; - zarray_t *vec; + t_word *vec; if (!(A = (t_garray *)pd_findbyclass(x->x_arrayname, garray_class))) { error("%s: no such array", x->x_arrayname->s_name); - } else if (!zarray_getarray(A, &npoints, &vec)) { + } else if (!garray_getfloatwords(A, &npoints, &vec)) { error("%s: bad template for tabset", x->x_arrayname->s_name); } else { if (argc>=npoints) while(npoints--) { t_float f= atom_getfloat(argv++); - zarray_setfloat(vec, 0, f); + vec->w_float = f; vec++; - } - else { + } else { npoints-=argc; while (argc--) { t_float f= atom_getfloat(argv++); - zarray_setfloat(vec, 0, f); + vec->w_float = f; vec++; } while (npoints--) { - zarray_setfloat(vec, 0, 0); + vec->w_float = 0.; vec++; } } @@ -98,22 +97,22 @@ static void *tabset_new(t_symbol *s) static void tabset_helper(void) { - post("\n"HEARTSYMBOL " tabset - object : set a table with a package of floats"); + post("\n"HEARTSYMBOL + " tabset - object : set a table with a package of floats"); post("'set <table>'\t: set another table\n" "<list>\t\t: set the table" "<float>\t\t: set the table to constant float\n"); post("creation\t: \"tabset <table>\""); } -void tabset_setup(void) +ZEXY_SETUP void tabset_setup(void) { - tabset_class = class_new(gensym("tabset"), (t_newmethod)tabset_new, - 0, sizeof(t_tabset), 0, A_DEFSYM, 0); + tabset_class = zexy_new("tabset", + tabset_new, 0, t_tabset, 0, "S"); class_addfloat(tabset_class, (t_method)tabset_float); class_addlist (tabset_class, (t_method)tabset_list); - class_addmethod(tabset_class, (t_method)tabset_set, gensym("set"), - A_SYMBOL, 0); + zexy_addmethod(tabset_class, (t_method)tabset_set, "set", "s"); - class_addmethod(tabset_class, (t_method)tabset_helper, gensym("help"), 0); + zexy_addmethod(tabset_class, (t_method)tabset_helper, "help", ""); zexy_register("tabset"); } diff --git a/externals/zexy/src/tavg~.c b/externals/zexy/src/tavg~.c index b51dcd68e8df80f3986c9c0a5d971b5ac057467e..c5c9b9a6d9ae28fc104b28899e4c1b310702efdc 100644 --- a/externals/zexy/src/tavg~.c +++ b/externals/zexy/src/tavg~.c @@ -19,7 +19,7 @@ #include "zexy.h" -static t_class *tavg_class; +static t_class *tavg_class=NULL; typedef struct _tavg { t_object x_obj; @@ -73,16 +73,15 @@ static void tavg_help(void) post("<bang>\t\t: triggers the output"); } -void tavg_tilde_setup(void) +ZEXY_SETUP void tavg_tilde_setup(void) { - tavg_class = class_new(gensym("tavg~"), (t_newmethod)tavg_new, 0, - sizeof(t_tavgtilde), 0, A_DEFFLOAT, 0); - class_addmethod(tavg_class, nullfn, gensym("signal"), 0); - class_addmethod(tavg_class, (t_method)tavg_dsp, gensym("dsp"), - A_CANT, 0); + tavg_class = zexy_new("tavg~", + tavg_new, 0, t_tavgtilde, 0, ""); + zexy_addmethod(tavg_class, (t_method)nullfn, "signal", ""); + zexy_addmethod(tavg_class, (t_method)tavg_dsp, "dsp", "!"); class_addbang(tavg_class, tavg_bang); - class_addmethod(tavg_class, (t_method)tavg_help, gensym("help"), 0); + zexy_addmethod(tavg_class, (t_method)tavg_help, "help", ""); zexy_register("tavg~"); } diff --git a/externals/zexy/src/time.c b/externals/zexy/src/time.c index 71317ab97a82d2a6bb4373e4380bf7c163cabf8b..5e4bb0b6bc19f8c5a9a669e863fff46537fbade4 100644 --- a/externals/zexy/src/time.c +++ b/externals/zexy/src/time.c @@ -22,8 +22,12 @@ */ #include "zexy.h" -#ifdef __WIN32__ -#define USE_TIMEB +#if (defined __WIN32__) +# if (defined __i386__) && (defined __MINGW32__) +/* unless compiling under mingw/32bit, we want USE_TIMEB in redmond-land */ +# else +# define USE_TIMEB +# endif #endif #ifdef __APPLE__ @@ -43,7 +47,7 @@ /* ----------------------- time --------------------- */ -static t_class *time_class; +static t_class *time_class=NULL; typedef struct _time { t_object x_obj; @@ -59,10 +63,10 @@ typedef struct _time { static void *time_new(t_symbol* UNUSED(s), int argc, t_atom *argv) { t_time *x = (t_time *)pd_new(time_class); - char buf[5]; x->GMT=0; if (argc) { + char buf[5]; atom_string(argv, buf, 5); if (buf[0]=='G' && buf[1]=='M' && buf[2]=='T') { x->GMT = 1; @@ -80,7 +84,7 @@ static void *time_new(t_symbol* UNUSED(s), int argc, t_atom *argv) static void time_bang(t_time *x) { struct tm *resolvetime; - float ms = 0.f; + t_float ms = 0.f; #ifdef USE_TIMEB struct timeb mytime; ftime(&mytime); @@ -105,14 +109,13 @@ static void help_time(t_time* UNUSED(x)) post("\ncreation\t:: 'time [GMT]': show local time or GMT"); } -void time_setup(void) +ZEXY_SETUP void time_setup(void) { - time_class = class_new(gensym("time"), - (t_newmethod)time_new, 0, - sizeof(t_time), 0, A_GIMME, 0); + time_class = zexy_new("time", + time_new, 0, t_time, 0, "*"); class_addbang(time_class, time_bang); - class_addmethod(time_class, (t_method)help_time, gensym("help"), 0); + zexy_addmethod(time_class, (t_method)help_time, "help", ""); zexy_register("time"); } diff --git a/externals/zexy/src/unpack.c b/externals/zexy/src/unpack.c index 79986166c5f6904f5f6ad64fb17eb26531299330..c79b5b227c01adb699d119b5b23d1a7f737379bd 100644 --- a/externals/zexy/src/unpack.c +++ b/externals/zexy/src/unpack.c @@ -32,7 +32,7 @@ /* like pack, but does no type-checking */ -static t_class *zunpack_class; +static t_class *zunpack_class=NULL; typedef struct _zunpack { t_object x_obj; @@ -54,7 +54,8 @@ static void zunpack_any(t_zunpack *x, t_symbol *s, int argc, t_atom *argv) } } -static void zunpack_list(t_zunpack *x, t_symbol *s, int argc, t_atom *argv) +static void zunpack_list(t_zunpack *x, t_symbol *UNUSED(s), int argc, + t_atom *argv) { zunpack_any(x, 0, argc, argv); } @@ -76,7 +77,7 @@ static void zunpack_free(t_zunpack *x) x->x_out=0; } -static void *zunpack_new(t_symbol*s, int argc, t_atom*argv) +static void *zunpack_new(t_symbol*UNUSED(s), int argc, t_atom*UNUSED(argv)) { t_zunpack *x = (t_zunpack *)pd_new(zunpack_class); int count=(argc>0)?argc:2; @@ -92,12 +93,11 @@ static void *zunpack_new(t_symbol*s, int argc, t_atom*argv) return (x); } -void zunpack_setup(void) +ZEXY_SETUP void zunpack_setup(void) { - zunpack_class = class_new(gensym("zexy/unpack"), - (t_newmethod)zunpack_new, (t_method)zunpack_free, sizeof(t_zunpack), - 0, A_GIMME, 0); + zunpack_class = zexy_new("zexy/unpack", + zunpack_new, zunpack_free, t_zunpack, 0, "*"); #if 0 /* oops Pd-0.42 allows us to override built-ins * this is bad as long as the 2 objects are not compatible */ diff --git a/externals/zexy/src/unpack~.c b/externals/zexy/src/unpack~.c index 2706261912d96a99e5ee5fd65221d27175e75e84..cb812b0892c42cde87c71eeb10cfb2090556ebf5 100644 --- a/externals/zexy/src/unpack~.c +++ b/externals/zexy/src/unpack~.c @@ -19,7 +19,7 @@ #include "zexy.h" -static t_class *sigunpack_class; +static t_class *sigunpack_class=NULL; typedef struct _sigunpack { t_object x_obj; @@ -39,7 +39,7 @@ static void sigunpack_float(t_sigunpack *x, t_float f) } } -static void sigunpack_list(t_sigunpack *x, t_symbol *s, int argc, +static void sigunpack_list(t_sigunpack *x, t_symbol *UNUSED(s), int argc, t_atom *argv) { t_atom *ap = argv; @@ -124,18 +124,14 @@ static void sigunpack_help(void) post("unpack~\t:: outputs a sequence of floats as a signal"); } -void unpack_tilde_setup(void) +ZEXY_SETUP void unpack_tilde_setup(void) { - sigunpack_class = class_new(gensym("unpack~"), (t_newmethod)sigunpack_new, - 0, - sizeof(t_sigunpack), 0, A_DEFFLOAT, 0); - class_addmethod(sigunpack_class, (t_method)sigunpack_dsp, gensym("dsp"), - A_CANT, 0); + sigunpack_class = zexy_new("unpack~", + sigunpack_new, 0, t_sigunpack, 0, "F"); + zexy_addmethod(sigunpack_class, (t_method)sigunpack_dsp, "dsp", "!"); class_addfloat(sigunpack_class, (t_method)sigunpack_float); class_addlist (sigunpack_class, (t_method)sigunpack_list); - - class_addmethod(sigunpack_class, (t_method)sigunpack_help, gensym("help"), - 0); + zexy_addmethod(sigunpack_class, (t_method)sigunpack_help, "help", ""); zexy_register("unpack~"); } diff --git a/externals/zexy/src/urn.c b/externals/zexy/src/urn.c index a7dc2f04f4702a8be1c903bbf418e7db6078a1bc..cde543d1a121a4b7efc41b7bd5feb8bd0badfb8a 100644 --- a/externals/zexy/src/urn.c +++ b/externals/zexy/src/urn.c @@ -21,7 +21,7 @@ /* ------------------------- urn ------------------------------- */ -static t_class *urn_class; +static t_class *urn_class=NULL; typedef struct _urn { t_object x_obj; @@ -147,23 +147,23 @@ static void *urn_new(t_symbol* UNUSED(s), int argc, t_atom *argv) return (x); } -static void urn_help(t_urn*x) +static void urn_help(t_urn*UNUSED(x)) { - post("\n"HEARTSYMBOL " urn\t\t:: generate randum numbers without repetition"); + post("\n"HEARTSYMBOL + " urn\t\t:: generate randum numbers without repetition"); } -void urn_setup(void) +ZEXY_SETUP void urn_setup(void) { - urn_class = class_new(gensym("urn"), (t_newmethod)urn_new, - 0, sizeof(t_urn), 0, A_GIMME, 0); + urn_class = zexy_new("urn", + urn_new, 0, t_urn, 0, "*"); class_addbang (urn_class, urn_bang); - class_addmethod(urn_class, (t_method)urn_clear, gensym("clear"), 0); - class_addmethod(urn_class, (t_method)urn_flt2, gensym(""), A_DEFFLOAT, 0); - class_addmethod(urn_class, (t_method)urn_seed, gensym("seed"), A_DEFFLOAT, - 0); + zexy_addmethod(urn_class, (t_method)urn_clear, "clear", ""); + zexy_addmethod(urn_class, (t_method)urn_flt2, "", "F"); + zexy_addmethod(urn_class, (t_method)urn_seed, "seed", "F"); - class_addmethod(urn_class, (t_method)urn_help, gensym("help"), A_NULL); + zexy_addmethod(urn_class, (t_method)urn_help, "help", ""); zexy_register("urn"); } diff --git a/externals/zexy/src/winNT_portio.c b/externals/zexy/src/winNT_portio.c index b514912c58108cbc5b9649c5d2239747ce4bae20..87dae1c97159a9142065426fc5cd84bf91d6b3d4 100644 --- a/externals/zexy/src/winNT_portio.c +++ b/externals/zexy/src/winNT_portio.c @@ -6,18 +6,18 @@ * to plug this on the usb bus. * if the interface changes, only this file has to be adopted for the target system */ -#if defined __WIN32__ && defined Z_WANT_LPT +#if defined __WIN32__ #include <stdio.h> #include <windows.h> -int read_parport(int port); -void write_parport(int port, int value); -int open_port(int port); +int read_parport(unsigned short int port); +void write_parport(unsigned short int port, int value); +int open_port(unsigned short int port); static BOOL bPrivException = FALSE; -int read_parport(int port) +int read_parport(unsigned short int port) { unsigned char value; #ifdef _MSC_VER @@ -32,7 +32,7 @@ int read_parport(int port) return (int)value; } -void write_parport(int port, int invalue) +void write_parport(unsigned short int port, int invalue) { /* _outp((unsigned short)port, value); */ BYTE value = (BYTE)invalue; @@ -114,15 +114,15 @@ static int IsWinNT(void) } /* open parport */ -int open_port(int port) +int open_port(unsigned short int port) { - if(IsWinNT()) { /* we are under NT and need kernel driver */ + if(IsWinNT()) { /* we are under NT and need kernel driver */ if(StartUpIoPorts(port, 1, 0)) { return(0); } return(-1); - } else { /* no need to use kernel driver */ + } else { /* no need to use kernel driver */ return(0); } } -#endif /* __WIN32__ & Z_WANT_LPT */ +#endif /* __WIN32__ */ diff --git a/externals/zexy/src/wrap.c b/externals/zexy/src/wrap.c index f410fe3bc5e485cb04b458c6d013d021c0e847c7..a90db2e6867c3e15eeb9face56ab68325bf94420 100644 --- a/externals/zexy/src/wrap.c +++ b/externals/zexy/src/wrap.c @@ -18,7 +18,7 @@ */ #include "zexy.h" -static t_class *wrap_class; +static t_class *wrap_class=NULL; typedef struct _wrap { t_object x_obj; @@ -71,20 +71,18 @@ static void *wrap_new(t_symbol *s, int argc, t_atom*argv) return (x); } -static void wrap_help(t_wrap*x) +static void wrap_help(t_wrap*UNUSED(x)) { post("\n"HEARTSYMBOL " wrap\t\t:: wrap a float between to boundaries"); } -void wrap_setup(void) +ZEXY_SETUP void wrap_setup(void) { - wrap_class = class_new(gensym("wrap"), - (t_newmethod)wrap_new, - 0, sizeof(t_wrap), - CLASS_DEFAULT, A_GIMME, A_NULL); + wrap_class = zexy_new("wrap", + wrap_new, 0, t_wrap, CLASS_DEFAULT, "*"); class_addfloat (wrap_class, wrap_float); - class_addmethod(wrap_class, (t_method)wrap_set, gensym("set"), A_GIMME, 0); - class_addmethod(wrap_class, (t_method)wrap_help, gensym("help"), A_NULL); + zexy_addmethod(wrap_class, (t_method)wrap_set, "set", "*"); + zexy_addmethod(wrap_class, (t_method)wrap_help, "help", ""); zexy_register("wrap"); } diff --git a/externals/zexy/src/z_zexy.c b/externals/zexy/src/z_zexy.c index 8a15960cdd083f7e0db0492d6ac8fbd50ac03384..260bf9fb224fd5aec1e64879cca57e78c1cb8481 100644 --- a/externals/zexy/src/z_zexy.c +++ b/externals/zexy/src/z_zexy.c @@ -3,95 +3,180 @@ * !! DO NOT MANUALLY EDIT !! */ -#include "z_zexy.h" +/* forward declarations */ +void setup_0x260x26_tilde(void); /* 0x260x26_tilde.c */ +void setup_0x2e(void); /* 0x2e.c */ +void setup_0x3c_tilde(void); /* 0x3c_tilde.c */ +void setup_0x3d0x3d_tilde(void); /* 0x3d0x3d_tilde.c */ +void setup_0x3e_tilde(void); /* 0x3e_tilde.c */ +void setup_0x7c0x7c_tilde(void); /* 0x7c0x7c_tilde.c */ +void a2l_setup(void); /* a2l.c */ +void absgn_tilde_setup(void); /* absgn~.c */ +void abs_tilde_setup(void); /* abs~.c */ +void atof_setup(void); /* atof.c */ +void atoi_setup(void); /* atoi.c */ +void avg_tilde_setup(void); /* avg~.c */ +void blockmirror_tilde_setup(void); /* blockmirror~.c */ +void blockshuffle_tilde_setup(void); /* blockshuffle~.c */ +void blockswap_tilde_setup(void); /* blockswap~.c */ +void date_setup(void); /* date.c */ +void demultiplex_setup(void); /* demultiplex.c */ +void demultiplex_tilde_setup(void); /* demultiplex~.c */ +void dfreq_tilde_setup(void); /* dfreq~.c */ +void dirac_tilde_setup(void); /* dirac~.c */ +void doublepole_tilde_setup(void); /* doublepole~.c */ +void drip_setup(void); /* drip.c */ +void envrms_tilde_setup(void); /* envrms~.c */ +void fifop_setup(void); /* fifop.c */ +void freadln_setup(void); /* freadln.c */ +void fwriteln_setup(void); /* fwriteln.c */ +void glue_setup(void); /* glue.c */ +void index_setup(void); /* index.c */ +void length_setup(void); /* length.c */ +void lifop_setup(void); /* lifop.c */ +void limiter_tilde_setup(void); /* limiter~.c */ +void list2int_setup(void); /* list2int.c */ +void list2lists_setup(void); /* list2lists.c */ +void list2symbol_setup(void); /* list2symbol.c */ +void lister_setup(void); /* lister.c */ +void listfind_setup(void); /* listfind.c */ +void liststorage_setup(void); /* liststorage.c */ +void longload_setup(void); /* longload.c */ +void lpt_setup(void); /* lpt.c */ +void makesymbol_setup(void); /* makesymbol.c */ +void matchbox_setup(void); /* matchbox.c */ +void mavg_setup(void); /* mavg.c */ +void minmax_setup(void); /* minmax.c */ +void msgfile_setup(void); /* msgfile.c */ +void multiline_tilde_setup(void); /* multiline~.c */ +void multiplex_setup(void); /* multiplex.c */ +void multiplex_tilde_setup(void); /* multiplex~.c */ +void multireceive_setup(void); /* multireceive.c */ +void niagara_setup(void); /* niagara.c */ +void noish_tilde_setup(void); /* noish~.c */ +void noisi_tilde_setup(void); /* noisi~.c */ +void operating_system_setup(void); /* operating_system.c */ +void zpack_setup(void); /* pack.c */ +void packel_setup(void); /* packel.c */ +void pack_tilde_setup(void); /* pack~.c */ +void pdf_tilde_setup(void); /* pdf~.c */ +void prime_setup(void); /* prime.c */ +void quantize_tilde_setup(void); /* quantize~.c */ +void rawprint_setup(void); /* rawprint.c */ +void regex_setup(void); /* regex.c */ +void relay_setup(void); /* relay.c */ +void repack_setup(void); /* repack.c */ +void repeat_setup(void); /* repeat.c */ +void route_tilde_setup(void); /* route~.c */ +void sfplay_setup(void); /* sfplay.c */ +void sfrecord_setup(void); /* sfrecord.c */ +void sgn_tilde_setup(void); /* sgn~.c */ +void sigzero_tilde_setup(void); /* sigzero~.c */ +void sleepgrain_setup(void); /* sleepgrain.c */ +void zexy_sort_setup(void); /* sort.c */ +void step_tilde_setup(void); /* step~.c */ +void strcmp_setup(void); /* strcmp.c */ +void sum_setup(void); /* sum.c */ +void swap_tilde_setup(void); /* swap~.c */ +void symbol2list_setup(void); /* symbol2list.c */ +void tabdump_setup(void); /* tabdump.c */ +void tabminmax_setup(void); /* tabminmax.c */ +void tabread4_tilde_tilde_setup(void); /* tabread4~~.c */ +void tabset_setup(void); /* tabset.c */ +void tavg_tilde_setup(void); /* tavg~.c */ +void time_setup(void); /* time.c */ +void zunpack_setup(void); /* unpack.c */ +void unpack_tilde_setup(void); /* unpack~.c */ +void urn_setup(void); /* urn.c */ +void wrap_setup(void); /* wrap.c */ +void z_tilde_setup(void); /* z~.c */ void z_zexy_setup(void) { - setup_0x260x260x7e(); /* 0x260x260x7e */ - setup_0x2e(); /* 0x2e */ - setup_0x3c0x7e(); /* 0x3c0x7e */ - setup_0x3d0x3d0x7e(); /* 0x3d0x3d0x7e */ - setup_0x3e0x7e(); /* 0x3e0x7e */ - setup_0x7c0x7c0x7e(); /* 0x7c0x7c0x7e */ - a2l_setup(); /* a2l */ - abs_tilde_setup(); /* abs~ */ - absgn_tilde_setup(); /* absgn~ */ - atof_setup(); /* atof */ - atoi_setup(); /* atoi */ - avg_tilde_setup(); /* avg~ */ - blockmirror_tilde_setup(); /* blockmirror~ */ - blockshuffle_tilde_setup(); /* blockshuffle~ */ - blockswap_tilde_setup(); /* blockswap~ */ - date_setup(); /* date */ - demultiplex_tilde_setup(); /* demultiplex~ */ - demultiplex_setup(); /* demultiplex */ - dfreq_tilde_setup(); /* dfreq~ */ - dirac_tilde_setup(); /* dirac~ */ - doublepole_tilde_setup(); /* doublepole~ */ - drip_setup(); /* drip */ - envrms_tilde_setup(); /* envrms~ */ - fifop_setup(); /* fifop */ - freadln_setup(); /* freadln */ - fwriteln_setup(); /* fwriteln */ - glue_setup(); /* glue */ - index_setup(); /* index */ - length_setup(); /* length */ - lifop_setup(); /* lifop */ - limiter_tilde_setup(); /* limiter~ */ - list2int_setup(); /* list2int */ - list2lists_setup(); /* list2lists */ - list2symbol_setup(); /* list2symbol */ - lister_setup(); /* lister */ - listfind_setup(); /* listfind */ - liststorage_setup(); /* liststorage */ - longload_setup(); /* longload */ - lpt_setup(); /* lpt */ - makesymbol_setup(); /* makesymbol */ - matchbox_setup(); /* matchbox */ - mavg_setup(); /* mavg */ - minmax_setup(); /* minmax */ - msgfile_setup(); /* msgfile */ - multiline_tilde_setup(); /* multiline~ */ - multiplex_tilde_setup(); /* multiplex~ */ - multiplex_setup(); /* multiplex */ - multireceive_setup(); /* multireceive */ - niagara_setup(); /* niagara */ - noish_tilde_setup(); /* noish~ */ - noisi_tilde_setup(); /* noisi~ */ - operating_system_setup(); /* operating_system */ - pack_tilde_setup(); /* pack~ */ - pack_setup(); /* pack */ - packel_setup(); /* packel */ - pdf_tilde_setup(); /* pdf~ */ - prime_setup(); /* prime */ - quantize_tilde_setup(); /* quantize~ */ - rawprint_setup(); /* rawprint */ - regex_setup(); /* regex */ - relay_setup(); /* relay */ - repack_setup(); /* repack */ - repeat_setup(); /* repeat */ - route_tilde_setup(); /* route~ */ - sfplay_setup(); /* sfplay */ - sfrecord_setup(); /* sfrecord */ - sgn_tilde_setup(); /* sgn~ */ - sigzero_tilde_setup(); /* sigzero~ */ - sleepgrain_setup(); /* sleepgrain */ - sort_setup(); /* sort */ - step_tilde_setup(); /* step~ */ - strcmp_setup(); /* strcmp */ - sum_setup(); /* sum */ - swap_tilde_setup(); /* swap~ */ - symbol2list_setup(); /* symbol2list */ - tabdump_setup(); /* tabdump */ - tabminmax_setup(); /* tabminmax */ - tabread4_tilde_tilde_setup(); /* tabread4~~ */ - tabset_setup(); /* tabset */ - tavg_tilde_setup(); /* tavg~ */ - time_setup(); /* time */ - unpack_tilde_setup(); /* unpack~ */ - unpack_setup(); /* unpack */ - urn_setup(); /* urn */ - wrap_setup(); /* wrap */ - z_tilde_setup(); /* z~ */ + setup_0x260x26_tilde(); + setup_0x2e(); + setup_0x3c_tilde(); + setup_0x3d0x3d_tilde(); + setup_0x3e_tilde(); + setup_0x7c0x7c_tilde(); + a2l_setup(); + absgn_tilde_setup(); + abs_tilde_setup(); + atof_setup(); + atoi_setup(); + avg_tilde_setup(); + blockmirror_tilde_setup(); + blockshuffle_tilde_setup(); + blockswap_tilde_setup(); + date_setup(); + demultiplex_setup(); + demultiplex_tilde_setup(); + dfreq_tilde_setup(); + dirac_tilde_setup(); + doublepole_tilde_setup(); + drip_setup(); + envrms_tilde_setup(); + fifop_setup(); + freadln_setup(); + fwriteln_setup(); + glue_setup(); + index_setup(); + length_setup(); + lifop_setup(); + limiter_tilde_setup(); + list2int_setup(); + list2lists_setup(); + list2symbol_setup(); + lister_setup(); + listfind_setup(); + liststorage_setup(); + longload_setup(); + lpt_setup(); + makesymbol_setup(); + matchbox_setup(); + mavg_setup(); + minmax_setup(); + msgfile_setup(); + multiline_tilde_setup(); + multiplex_setup(); + multiplex_tilde_setup(); + multireceive_setup(); + niagara_setup(); + noish_tilde_setup(); + noisi_tilde_setup(); + operating_system_setup(); + zpack_setup(); + packel_setup(); + pack_tilde_setup(); + pdf_tilde_setup(); + prime_setup(); + quantize_tilde_setup(); + rawprint_setup(); + regex_setup(); + relay_setup(); + repack_setup(); + repeat_setup(); + route_tilde_setup(); + sfplay_setup(); + sfrecord_setup(); + sgn_tilde_setup(); + sigzero_tilde_setup(); + sleepgrain_setup(); + zexy_sort_setup(); + step_tilde_setup(); + strcmp_setup(); + sum_setup(); + swap_tilde_setup(); + symbol2list_setup(); + tabdump_setup(); + tabminmax_setup(); + tabread4_tilde_tilde_setup(); + tabset_setup(); + tavg_tilde_setup(); + time_setup(); + zunpack_setup(); + unpack_tilde_setup(); + urn_setup(); + wrap_setup(); + z_tilde_setup(); } - diff --git a/externals/zexy/src/z_zexy.h b/externals/zexy/src/z_zexy.h deleted file mode 100644 index f8f6c55396993fd15dc73e022959e9769cb2e1a4..0000000000000000000000000000000000000000 --- a/externals/zexy/src/z_zexy.h +++ /dev/null @@ -1,97 +0,0 @@ -/* zexy-setup autogenerated header-file - * generated by "./makesource.sh" - * !! DO NOT MANUALLY EDIT !! - */ - -#ifndef Z_ZEXY_H__ -#define Z_ZEXY_H__ -void setup_0x260x260x7e(void); /* 0x260x260x7e */ -void setup_0x2e(void); /* 0x2e */ -void setup_0x3c0x7e(void); /* 0x3c0x7e */ -void setup_0x3d0x3d0x7e(void); /* 0x3d0x3d0x7e */ -void setup_0x3e0x7e(void); /* 0x3e0x7e */ -void setup_0x7c0x7c0x7e(void); /* 0x7c0x7c0x7e */ -void a2l_setup(void); /* a2l */ -void abs_tilde_setup(void); /* abs~ */ -void absgn_tilde_setup(void); /* absgn~ */ -void atof_setup(void); /* atof */ -void atoi_setup(void); /* atoi */ -void avg_tilde_setup(void); /* avg~ */ -void blockmirror_tilde_setup(void); /* blockmirror~ */ -void blockshuffle_tilde_setup(void); /* blockshuffle~ */ -void blockswap_tilde_setup(void); /* blockswap~ */ -void date_setup(void); /* date */ -void demultiplex_tilde_setup(void); /* demultiplex~ */ -void demultiplex_setup(void); /* demultiplex */ -void dfreq_tilde_setup(void); /* dfreq~ */ -void dirac_tilde_setup(void); /* dirac~ */ -void doublepole_tilde_setup(void); /* doublepole~ */ -void drip_setup(void); /* drip */ -void envrms_tilde_setup(void); /* envrms~ */ -void fifop_setup(void); /* fifop */ -void freadln_setup(void); /* freadln */ -void fwriteln_setup(void); /* fwriteln */ -void glue_setup(void); /* glue */ -void index_setup(void); /* index */ -void length_setup(void); /* length */ -void lifop_setup(void); /* lifop */ -void limiter_tilde_setup(void); /* limiter~ */ -void list2int_setup(void); /* list2int */ -void list2lists_setup(void); /* list2lists */ -void list2symbol_setup(void); /* list2symbol */ -void lister_setup(void); /* lister */ -void listfind_setup(void); /* listfind */ -void liststorage_setup(void); /* liststorage */ -void longload_setup(void); /* longload */ -void lpt_setup(void); /* lpt */ -void makesymbol_setup(void); /* makesymbol */ -void matchbox_setup(void); /* matchbox */ -void mavg_setup(void); /* mavg */ -void minmax_setup(void); /* minmax */ -void msgfile_setup(void); /* msgfile */ -void multiline_tilde_setup(void); /* multiline~ */ -void multiplex_tilde_setup(void); /* multiplex~ */ -void multiplex_setup(void); /* multiplex */ -void multireceive_setup(void); /* multireceive */ -void niagara_setup(void); /* niagara */ -void noish_tilde_setup(void); /* noish~ */ -void noisi_tilde_setup(void); /* noisi~ */ -void operating_system_setup(void); /* operating_system */ -void pack_tilde_setup(void); /* pack~ */ -void pack_setup(void); /* pack */ -void packel_setup(void); /* packel */ -void pdf_tilde_setup(void); /* pdf~ */ -void prime_setup(void); /* prime */ -void quantize_tilde_setup(void); /* quantize~ */ -void rawprint_setup(void); /* rawprint */ -void regex_setup(void); /* regex */ -void relay_setup(void); /* relay */ -void repack_setup(void); /* repack */ -void repeat_setup(void); /* repeat */ -void route_tilde_setup(void); /* route~ */ -void sfplay_setup(void); /* sfplay */ -void sfrecord_setup(void); /* sfrecord */ -void sgn_tilde_setup(void); /* sgn~ */ -void sigzero_tilde_setup(void); /* sigzero~ */ -void sleepgrain_setup(void); /* sleepgrain */ -void sort_setup(void); /* sort */ -void step_tilde_setup(void); /* step~ */ -void strcmp_setup(void); /* strcmp */ -void sum_setup(void); /* sum */ -void swap_tilde_setup(void); /* swap~ */ -void symbol2list_setup(void); /* symbol2list */ -void tabdump_setup(void); /* tabdump */ -void tabminmax_setup(void); /* tabminmax */ -void tabread4_tilde_tilde_setup(void); /* tabread4~~ */ -void tabset_setup(void); /* tabset */ -void tavg_tilde_setup(void); /* tavg~ */ -void time_setup(void); /* time */ -void unpack_tilde_setup(void); /* unpack~ */ -void unpack_setup(void); /* unpack */ -void urn_setup(void); /* urn */ -void wrap_setup(void); /* wrap */ -void z_tilde_setup(void); /* z~ */ - -void z_zexy_setup(void); -#endif /* Z_ZEXY_H__ */ - diff --git a/externals/zexy/src/zexy.c b/externals/zexy/src/zexy.c index e55f04dca29a4ad91baad3510abd839f4163439e..ae10a2882d74f3b694ca479c7b895cf0db640b6c 100644 --- a/externals/zexy/src/zexy.c +++ b/externals/zexy/src/zexy.c @@ -22,7 +22,6 @@ */ #include "zexy.h" -#include "z_zexy.h" #include <stdio.h> #include <stdarg.h> @@ -32,13 +31,16 @@ # define vsnprintf _vsnprintf #endif +/* foward declarations */ +void z_zexy_setup(void); + /* do a little help thing */ typedef struct zexy { t_object t_ob; } t_zexy; -t_class *zexy_class; +t_class *zexy_class=NULL; static void zexy_help(void) { @@ -88,7 +90,7 @@ static void zexy_help(void) post("sigzero~\t:: indicates whether a signal is zero throughout the block"); post("avg~\t\t:: outputs average of a signal as float"); post("tavg~\t\t:: outputs average of a signal between two bangs"); - post("envrms~\t\t:: an env~-object that ouputs rms instead of db"); + post("envrms~\t\t:: an env~-object that outputs rms instead of db"); post("pdf~\t\t:: power density function"); endpost(); @@ -137,7 +139,7 @@ static void zexy_help(void) endpost(); } -static void *zexy_new(void) +static void *zexy_ctor(void) { t_zexy *x = (t_zexy *)pd_new(zexy_class); return (x); @@ -165,8 +167,9 @@ void zexy_setup(void) endpost(); endpost(); - zexy_class = class_new(gensym("zexy"), zexy_new, 0, sizeof(t_zexy), 0, 0); - class_addmethod(zexy_class, zexy_help, gensym("help"), 0); + zexy_class = zexy_new("zexy", + zexy_ctor, 0, t_zexy, 0, ""); + zexy_addmethod(zexy_class, (t_method)zexy_help, "help", ""); zexy_register("zexy"); diff --git a/externals/zexy/src/zexy.h b/externals/zexy/src/zexy.h index ea6e2376307edccacde2e86ee961b1b4c26b10fc..a434c4a9a6e063aa8b22480443519bbd468a1f61 100644 --- a/externals/zexy/src/zexy.h +++ b/externals/zexy/src/zexy.h @@ -31,27 +31,6 @@ #ifndef INCLUDE_ZEXY_H__ #define INCLUDE_ZEXY_H__ -#ifdef __WIN32__ -# ifndef NT -# define NT -# endif -# ifndef MSW -# define MSW -# endif -#endif - -/* - * to use the zexyconf.h compile-time configurations, you have to set HAVE_CONFIG_H - * usually this is done in Make.config by configure - */ -#ifdef HAVE_CONFIG_H -# include "config.h" -#else -# include "zexyconf.h" -#endif /* HAVE_CONFIG_H */ - - - /* these pragmas are only used for MSVC, not MinGW or Cygwin */ #ifdef _MSC_VER # pragma warning( disable : 4018 ) @@ -63,8 +42,6 @@ #include "m_pd.h" - - #ifndef VERSION # define VERSION "(unknown version)" #endif @@ -93,20 +70,17 @@ # define STATIC_INLINE static #endif -#ifdef __APPLE__ -# include <AvailabilityMacros.h> -# if defined (MAC_OS_X_VERSION_10_3) && MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_3 -# define sqrtf sqrt -# endif /* OSX-10.3 */ -#endif /* APPLE */ - - #ifdef __GNUC__ -# define UNUSED(x) ZUNUSED_ ## x __attribute__((__unused__)) -# define UNUSED_FUNCTION(x) __attribute__((__unused__)) ZUNUSEDFUN_ ## x +# define UNUSED(x) ZUNUSED_ ## x __attribute__((__unused__)) +# define UNUSED_FUNCTION(x) __attribute__((__unused__)) ZUNUSEDFUN_ ## x +# define MAYBE_USED_FUNCTION(x) __attribute__((__unused__)) x +# if __GNUC__ >= 9 +# pragma GCC diagnostic ignored "-Wcast-function-type" +# endif #else -# define UNUSED(x) ZUNUSED_ ## x -# define UNUSED_FUNCTION(x) ZUNUSEDFUN_ ## x +# define UNUSED(x) ZUNUSED_ ## x +# define UNUSED_FUNCTION(x) ZUNUSEDFUN_ ## x +# define MAYBE_USED_FUNCTION(x) x #endif #define ZEXY_TYPE_EQUAL(type1, type2) (sizeof(type1) == sizeof(type2)) @@ -122,67 +96,93 @@ typedef struct _mypdlist { # define BUILD_DATE __DATE__ #endif +#if PD_FLOATSIZE == 32 +# define Z_FABS(f) fabsf(f) +#else +# define Z_FABS(f) fabs(f) +#endif + +/* marker for setup-functions to be called by zexy_setup() */ +#define ZEXY_SETUP + +/* convenience functions */ +static int zexy_argparse(const char*argstring, int argc, t_atomtype*argv) +{ + const char*args = argstring; + int i; + for(i=0; i<argc; i++) { + argv[i]=A_NULL; + } + for(i=0; i<argc && *args; i++, args++) { + switch(*args) { + case 'f': + argv[i] = A_FLOAT; + break; + case 'F': + argv[i] = A_DEFFLOAT; + break; + case 's': + argv[i] = A_SYMBOL; + break; + case 'S': + argv[i] = A_DEFSYM; + break; + case 'p': + argv[i] = A_POINTER; + break; + case '!': + argv[i] = A_CANT; + break; + case '*': + argv[i] = A_GIMME; + break; + default: + error("ZEXYERROR: unknown argument specifier '%s'", argstring); + return -1; + } + } + return i; +} + +static t_class MAYBE_USED_FUNCTION(*zexy_classnew) (const char*name, + t_newmethod newmethod, t_method freemethod, size_t size, int flags, + const char*args) +{ + t_atomtype at[5]; + if(zexy_argparse(args, 5, at) < 0) { + return 0; + } + return class_new(gensym(name), newmethod, freemethod, size, flags, at[0], + at[1], at[2], at[3], at[4], A_NULL); +} +#define zexy_new(name, ctor, dtor, memberstruct, flags, args) \ + zexy_classnew(name, (t_newmethod)ctor, (t_method)dtor, sizeof(memberstruct), flags, args) + + +static void MAYBE_USED_FUNCTION(zexy_addmethod) (t_class*c, t_method fn, + const char*s, const char*args) +{ + /* wrapper around 'class_addmethod' that is a bit more terse... */ + t_atomtype at[5]; + if(zexy_argparse(args, 5, at) < 0) { + return; + } + class_addmethod(c, fn, gensym(s), at[0], at[1], at[2], at[3], at[4], + A_NULL); +} #ifndef ZEXY_LIBRARY static void zexy_register(char*object) { if(object!=0) { post("[%s] part of zexy-%s (compiled "BUILD_DATE")", object, VERSION); - post("\tCopyright (c) 1999-2012 IOhannes m zmölnig, forum::für::umläute & IEM"); + post("\tCopyright (c) 1999-2018 IOhannes m zmölnig, forum::für::umläute & IEM"); } } #else -static void zexy_register(char*object) +static void zexy_register(char*UNUSED(object)) { - object=0; } #endif /* ZEXY_LIBRARY */ -#if (defined PD_MAJOR_VERSION && defined PD_MINOR_VERSION) && (PD_MAJOR_VERSION > 0 || PD_MINOR_VERSION > 38) -/* - * pd>=0.39 has a verbose() function; older versions don't - * btw, this finally makes zexy binary incompatible with older version - */ -# define z_verbose verbose - -/* when compiling zexy as library, we also provide now provide a dummy verbose() function, - * which will chime in, when pd is lacking one - * this should make zexy binary compatible with older pd versions again - */ -# ifndef __WIN32__ -void verbose(int level, const char *fmt, ...); -# endif -#else -/* - * on older version we just shut up! - */ -# define z_verbose -#endif - -#if (defined PD_MAJOR_VERSION && defined PD_MINOR_VERSION) && (PD_MAJOR_VERSION > 0 || PD_MINOR_VERSION > 43) -# define z_open sys_open -# define z_close sys_close -# define z_fopen sys_fopen -# define z_fclose sys_fclose -#else -# define z_open open -# define z_close close -# define z_fopen fopen -# define z_fclose fclose -#endif - - -#if (defined __x86_64__) && (defined PD_MAJOR_VERSION && defined PD_MINOR_VERSION) && (PD_MAJOR_VERSION > 0 || PD_MINOR_VERSION >= 41) -# define zarray_t t_word -# define zarray_getarray garray_getfloatwords -# define zarray_getfloat(pointer, index) (pointer[index].w_float) -# define zarray_setfloat(pointer, index, value) ((pointer[index].w_float)=value) -#else -# define zarray_t t_float -# define zarray_getarray garray_getfloatarray -# define zarray_getfloat(pointer, index) (pointer[index]) -# define zarray_setfloat(pointer, index, value) ((pointer[index])=value) -#endif - - #endif /* INCLUDE_ZEXY_H__ */ diff --git a/externals/zexy/src/zexySIMD.h b/externals/zexy/src/zexySIMD.h index a9048c04e1d235f42316f94bee46b4e422606025..9b9906637cd00d75f2425eccc42d4edaace18adc 100644 --- a/externals/zexy/src/zexySIMD.h +++ b/externals/zexy/src/zexySIMD.h @@ -6,7 +6,7 @@ #define Z_SIMD_BLOCK 16 /* must be a power of 2 */ #define Z_SIMD_BYTEALIGN (128/8) /* assume 128 bits */ #define Z_SIMD_CHKBLOCKSIZE(n) (!(n&(Z_SIMD_BLOCK-1))) -#define Z_SIMD_CHKALIGN(ptr) ( ((unsigned long)(ptr) & (Z_SIMD_BYTEALIGN-1)) == 0 ) +#define Z_SIMD_CHKALIGN(ptr) ( ((t_int)(ptr) & (Z_SIMD_BYTEALIGN-1)) == 0 ) typedef union { __m128 vec; @@ -17,17 +17,21 @@ typedef union { * runs a check whether the SSE-optimized perform routine returns the same result as the generic routine * if the results differ, the SSE-code is probably broken, so we should fallback to the generic code */ +#ifdef __GNUC__ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wunused-function" +#endif static int zexy_testSSE(t_perfroutine genericperf, t_perfroutine sseperf, unsigned int numinchannels, unsigned int numoutchannels) { /* this currently only works with single input, single output */ - /* LATER make it work truely multichannel */ + /* LATER make it work truly multichannel */ if(1==numinchannels && 1==numoutchannels) { t_int w1[4], w2[4]; t_sample4 in, in1[4], in2[4], out1[4], out2[4]; int i, j; - z_verbose(2, "checking for SSE compatibility"); + verbose(2, "checking for SSE compatibility"); in.f[0]=0.; in.f[1]=-0.5; @@ -62,14 +66,14 @@ static int zexy_testSSE(t_perfroutine genericperf, t_perfroutine sseperf, for(i=0; i<4; i++) { for(j=0; j<4; j++) { - if(fabsf(out1[i].f[j]-out2[i].f[j])>1e-17) { - z_verbose(2, - "generic and optimized routines return different results: skipping optimization"); - z_verbose(2, "[%d,%d]: ((%f->%f)!=(%f->%f))", - i, j, - in1[i].f[j], out1[i].f[j], - in2[i].f[j], out2[i].f[j] - ); + if(Z_FABS(out1[i].f[j]-out2[i].f[j])>1e-17) { + verbose(2, + "generic and optimized routines return different results: skipping optimization"); + verbose(2, "[%d,%d]: ((%f->%f)!=(%f->%f))", + i, j, + in1[i].f[j], out1[i].f[j], + in2[i].f[j], out2[i].f[j] + ); return 0; } } @@ -77,9 +81,12 @@ static int zexy_testSSE(t_perfroutine genericperf, t_perfroutine sseperf, } else { /* no tests yet */ } - z_verbose(2, "using SSE optimization"); + verbose(2, "using SSE optimization"); return 1; } +#ifdef __GNUC__ +# pragma GCC diagnostic pop +#endif #endif /* __SSE__ */ diff --git a/externals/zexy/src/zexy_strndup.h b/externals/zexy/src/zexy_strndup.h new file mode 100644 index 0000000000000000000000000000000000000000..c74ce2211247c327c1f8b35b64baa98b817a7dbf --- /dev/null +++ b/externals/zexy/src/zexy_strndup.h @@ -0,0 +1,52 @@ +/* ********************************************** */ +/* the ZEXY external */ +/* ********************************************** */ +/* forum::für::umläute */ +/* ********************************************** */ + +/* the ZEXY external is a runtime-library for miller s. puckette's realtime-computermusic-software "pure data" + * therefore you NEED "pure data" to make any use of the ZEXY external + * (except if you want to use the code for other things) + * download "pure data" at + + http://pd.iem.at + ftp://iem.at/pd + + * + * if you are looking for the latest release of the ZEXY-external you should have another look at + + http://puredata.info/community/projects/software/zexy/ + ftp://iem.at/pd/Externals/ZEXY + + * + * ZEXY is published under the GNU GeneralPublicLicense, that must be shipped with ZEXY. + * if you are using Debian GNU/linux, the GNU-GPL can be found under /usr/share/common-licenses/GPL + * if you still haven't found a copy of the GNU-GPL, have a look at http://www.gnu.org + * + * "pure data" has it's own license, that comes shipped with "pure data". + * + * there are ABSOLUTELY NO WARRANTIES for anything + */ + +#ifndef INCLUDE_ZEXY_STRNDUP_H__ +#define INCLUDE_ZEXY_STRNDUP_H__ + +#include <stdlib.h> +#include <string.h> +static char *zexy_strndup(const char *s, size_t n) +{ + char *result=0; + size_t len = strlen(s) + 1; + if(len>n) { + len=n+1; + } + + result = malloc(len); + if(!result) { + return result; + } + memcpy(result, s, len); + result[len-1] = 0; + return result; +} +#endif /* INCLUDE_ZEXY_STRNDUP_H__ */ diff --git a/externals/zexy/src/zexyconf.h b/externals/zexy/src/zexyconf.h deleted file mode 100644 index a592ae71a9e5b7bcf4b589d53af763da4e2d0331..0000000000000000000000000000000000000000 --- a/externals/zexy/src/zexyconf.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef _ZEXYCONF_H_ -#define _ZEXYCONF_H_ -/* zexyconf.h: configuration for zexy: - * this is only included if no config.h is created - * adapt this to your own needs - */ - -/* Define if you have the <regex.h> header file. */ -/* -#undef HAVE_REGEX_H -*/ - -/* Define if you have the <alloca.h> header file. */ -/* -#undef HAVE_ALLOCA_H -*/ - -/* define if you want parallelport-support (direct access to the port address) */ -/* -#undef Z_WANT_LPT -*/ - -/* define if you have the <linux/ppdev.h> header file. - * (for parport _device_ support) - * you need Z_WANT_LPT for this to have an effect ! - */ -/* -#undef HAVE_LINUX_PPDEV_H -*/ - -#endif /* _ZEXYCONF_H_ */ - diff --git a/externals/zexy/src/z~.c b/externals/zexy/src/z~.c index bafca048360221129806d7bc569a2d2601f92594..f9119743e3a4cff1ee42517a1c5859207a3c2b84 100644 --- a/externals/zexy/src/z~.c +++ b/externals/zexy/src/z~.c @@ -29,7 +29,7 @@ /* ----------------------------------------------------- */ -static t_class *zNdelay_class; +static t_class *zNdelay_class=NULL; typedef struct _zNdelay { t_object x_obj; @@ -92,7 +92,7 @@ static void zNdelay_dsp(t_zNdelay *x, t_signal **sp) dsp_add(zN_perform, 4, sp[0]->s_vec, sp[1]->s_vec, x, (t_int)sp[0]->s_n); } -static void *zNdelay_new(t_symbol*s, int argc, t_atom*argv) +static void *zNdelay_new(t_symbol*UNUSED(s), int argc, t_atom*argv) { t_zNdelay *x = 0; int i = 0; @@ -107,6 +107,7 @@ static void *zNdelay_new(t_symbol*s, int argc, t_atom*argv) i=atom_getint(argv); break; } + /* fallthrough */ default: error("Bad arguments for [z~]: must be nought or initial delay [in samples]"); return 0; @@ -145,18 +146,15 @@ static void zdel_helper(void) } -void z_tilde_setup(void) +ZEXY_SETUP void z_tilde_setup(void) { - zNdelay_class = class_new(gensym("z~"), (t_newmethod)zNdelay_new, - (t_method)zNdelay_free, - sizeof(t_zNdelay), 0, A_GIMME, 0); - class_addmethod(zNdelay_class, nullfn, gensym("signal"), 0); - class_addmethod(zNdelay_class, (t_method)zNdelay_dsp, gensym("dsp"), - A_CANT, 0); + zNdelay_class = zexy_new("z~", + zNdelay_new, zNdelay_free, t_zNdelay, 0, "*"); + zexy_addmethod(zNdelay_class, (t_method)nullfn, "signal", ""); + zexy_addmethod(zNdelay_class, (t_method)zNdelay_dsp, "dsp", "!"); class_addfloat(zNdelay_class, zdel_float); - class_addmethod(zNdelay_class, (t_method)zdel_float, gensym("ft1"), - A_FLOAT, 0); - class_addmethod(zNdelay_class, (t_method)zdel_helper, gensym("help"), 0); + zexy_addmethod(zNdelay_class, (t_method)zdel_float, "ft1", "f"); + zexy_addmethod(zNdelay_class, (t_method)zdel_helper, "help", ""); zexy_register("z~"); } diff --git a/externals/zexy/tests/Makefile.am b/externals/zexy/tests/Makefile.am deleted file mode 100644 index 4010f0aacaf0359be6adb8f5c8ac844c7a9f90ed..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/Makefile.am +++ /dev/null @@ -1,126 +0,0 @@ -AUTOMAKE_OPTIONS = foreign - -TESTS_ENVIRONMENT = RUNTESTS_NOLOG=yes TESTDIR=$(srcdir) - -TESTS=runtests.sh - -clean-local: - -rm -f runtests.txt - -EXTRA_DIST = \ - README.txt \ - runtests.sh \ - runtests.bat \ - runtests_nogui.pd \ - runtests.pd \ - testunit.pd - -EXTRA_DIST += \ - msgfile/CR.txt \ - msgfile/msgfile.txt \ - testtests/README.txt \ - absgn~/abs.pd \ - absgn~/sgn.pd \ - abs~/simple.pd \ - and~/dualnoise.pd \ - and~/singlenoise.pd \ - eq~/dualnoise.pd \ - eq~/singlenoise.pd \ - gt~/dualnoise.pd \ - gt~/singlenoise.pd \ - help-msg/0x260x260x7e.pd \ - help-msg/0x2e.pd \ - help-msg/0x3c0x7e.pd \ - help-msg/0x3d0x3d0x7e.pd \ - help-msg/0x3e0x7e.pd \ - help-msg/0x7c0x7c0x7e.pd \ - help-msg/a2l.pd \ - help-msg/absgn~.pd \ - help-msg/abs~.pd \ - help-msg/atoi.pd \ - help-msg/avg~.pd \ - help-msg/blockmirror~.pd \ - help-msg/blockswap~.pd \ - help-msg/date.pd \ - help-msg/demultiplex~.pd \ - help-msg/demultiplex.pd \ - help-msg/dfreq~.pd \ - help-msg/dirac~.pd \ - help-msg/drip.pd \ - help-msg/envrms~.pd \ - help-msg/fifop.pd \ - help-msg/glue.pd \ - help-msg/index.pd \ - help-msg/length.pd \ - help-msg/lifop.pd \ - help-msg/limiter~.pd \ - help-msg/list2int.pd \ - help-msg/list2symbol.pd \ - help-msg/lister.pd \ - help-msg/lpt.pd \ - help-msg/makesymbol.pd \ - help-msg/mavg.pd \ - help-msg/minmax.pd \ - help-msg/msgfile.pd \ - help-msg/multiline~.pd \ - help-msg/multiplex~.pd \ - help-msg/multiplex.pd \ - help-msg/niagara.pd \ - help-msg/noish~.pd \ - help-msg/noisi~.pd \ - help-msg/operating_system.pd \ - help-msg/packel.pd \ - help-msg/pack~.pd \ - help-msg/pdf~.pd \ - help-msg/prime.pd \ - help-msg/quantize~.pd \ - help-msg/regex.pd \ - help-msg/relay.pd \ - help-msg/repack.pd \ - help-msg/repeat.pd \ - help-msg/sfplay.pd \ - help-msg/sfrecord.pd \ - help-msg/sgn~.pd \ - help-msg/sigzero~.pd \ - help-msg/sort.pd \ - help-msg/step~.pd \ - help-msg/strcmp.pd \ - help-msg/sum.pd \ - help-msg/swap~.pd \ - help-msg/symbol2list.pd \ - help-msg/tabdump.pd \ - help-msg/tabminmax.pd \ - help-msg/tabset.pd \ - help-msg/tavg~.pd \ - help-msg/time.pd \ - help-msg/unpack~.pd \ - help-msg/urn.pd \ - help-msg/wrap.pd \ - help-msg/zexy_.pd \ - help-msg/z~.pd \ - l2s/argument.pd \ - l2s/delimiter.pd \ - list2lists/negativelength.pd \ - lister/inline2.pd \ - lister/inline.pd \ - lt~/dualnoise.pd \ - lt~/singlenoise.pd \ - msgfile/add2.pd \ - msgfile/empty_at_end.pd \ - msgfile/emptyreplace.pd \ - msgfile/loadingCR.pd \ - msgfile/loading.pd \ - msgfile/prev_from_end.pd \ - msgfile/reentrant.pd \ - or~/dualnoise.pd \ - or~/singlenoise.pd \ - repeat/noargs.pd \ - s2l/numsymbols.pd \ - sgn~/simple.pd \ - testtests/fail_noresult.pd \ - testtests/fail.pd \ - testtests/fail_wait0.pd \ - testtests/fail_wait10.pd \ - testtests/pass.pd \ - testtests/pass_wait0.pd \ - testtests/pass_wait10.pd diff --git a/externals/zexy/tests/help-msg/0x260x260x7e.pd b/externals/zexy/tests/help-msg/0x260x260x7e.pd deleted file mode 100644 index 4b6ce12e27fd2632dedb78d9f7c996593b3cbe8b..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/0x260x260x7e.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 341 512 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [0x260x260x7e] crashes when a "help"-message -is sent; -#X obj 113 214 &&~; -#X connect 0 0 2 0; -#X connect 2 0 3 0; -#X connect 2 1 4 0; -#X connect 3 0 1 0; -#X connect 4 0 6 0; diff --git a/externals/zexy/tests/help-msg/0x2e.pd b/externals/zexy/tests/help-msg/0x2e.pd deleted file mode 100644 index f18564c04c6e9c779cf189e62d7244938e8637cd..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/0x2e.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [0x2e] crashes when a "help"-message is -sent; -#X obj 113 214 .; -#X connect 0 0 2 0; -#X connect 2 0 3 0; -#X connect 2 1 4 0; -#X connect 3 0 1 0; -#X connect 4 0 6 0; diff --git a/externals/zexy/tests/help-msg/0x3c0x7e.pd b/externals/zexy/tests/help-msg/0x3c0x7e.pd deleted file mode 100644 index 8801e63b46a2f7f2bdb0928c3d3b03088e05416c..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/0x3c0x7e.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [0x3c0x7e] crashes when a "help"-message -is sent; -#X obj 113 214 >~; -#X connect 0 0 2 0; -#X connect 2 0 3 0; -#X connect 2 1 4 0; -#X connect 3 0 1 0; -#X connect 4 0 6 0; diff --git a/externals/zexy/tests/help-msg/0x3d0x3d0x7e.pd b/externals/zexy/tests/help-msg/0x3d0x3d0x7e.pd deleted file mode 100644 index fa583763569cd408adbee3a082c4c587e3ead796..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/0x3d0x3d0x7e.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [0x3d0x3d0x7e] crashes when a "help"-message -is sent; -#X obj 113 214 ==~; -#X connect 0 0 2 0; -#X connect 2 0 3 0; -#X connect 2 1 4 0; -#X connect 3 0 1 0; -#X connect 4 0 6 0; diff --git a/externals/zexy/tests/help-msg/0x3e0x7e.pd b/externals/zexy/tests/help-msg/0x3e0x7e.pd deleted file mode 100644 index 22896e9e1fd211f959a236a2b250ea64ebb6c9d4..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/0x3e0x7e.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [0x3e0x7e] crashes when a "help"-message -is sent; -#X obj 113 214 <~; -#X connect 0 0 2 0; -#X connect 2 0 3 0; -#X connect 2 1 4 0; -#X connect 3 0 1 0; -#X connect 4 0 6 0; diff --git a/externals/zexy/tests/help-msg/0x7c0x7c0x7e.pd b/externals/zexy/tests/help-msg/0x7c0x7c0x7e.pd deleted file mode 100644 index 01a642e4ac21ea75fade190e2bed0cdf8f840d21..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/0x7c0x7c0x7e.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [0x7c0x7c0x7e] crashes when a "help"-message -is sent; -#X obj 113 214 ||~; -#X connect 0 0 2 0; -#X connect 2 0 3 0; -#X connect 2 1 4 0; -#X connect 3 0 1 0; -#X connect 4 0 6 0; diff --git a/externals/zexy/tests/help-msg/a2l.pd b/externals/zexy/tests/help-msg/a2l.pd deleted file mode 100644 index 0cdfd91882a983293b62d5b7b7e9420f38ccf12c..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/a2l.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 a2l; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [a2l] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/absgn~.pd b/externals/zexy/tests/help-msg/absgn~.pd deleted file mode 100644 index a446e5c9d2e0ed47f278e110ca9a47dc0f9051fe..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/absgn~.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 absgn~; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [absgn~] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/abs~.pd b/externals/zexy/tests/help-msg/abs~.pd deleted file mode 100644 index db304bffe848530b2770cace1d4843bc83264791..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/abs~.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 abs~; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [abs~] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/atoi.pd b/externals/zexy/tests/help-msg/atoi.pd deleted file mode 100644 index 609de09e1c109efa740a1105845f83cfbe73fe7d..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/atoi.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 atoi; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [atoi] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/avg~.pd b/externals/zexy/tests/help-msg/avg~.pd deleted file mode 100644 index 8c0b41dfab140b5cede56fc2d2d1c54b16f50a78..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/avg~.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 avg~; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [avg~] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/blockmirror~.pd b/externals/zexy/tests/help-msg/blockmirror~.pd deleted file mode 100644 index c90a35ecbd621c7876f728f0cd5e232177aaa3ac..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/blockmirror~.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 blockmirror~; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [blockmirror~] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/blockswap~.pd b/externals/zexy/tests/help-msg/blockswap~.pd deleted file mode 100644 index 7ecbe3bea0d672bfe0f134f2567ff2c43d102a84..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/blockswap~.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 blockswap~; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [blockswap~] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/date.pd b/externals/zexy/tests/help-msg/date.pd deleted file mode 100644 index da8b5e9a9b974f106af8c0bbdc97c07ec5039c9d..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/date.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 date; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [date] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/demultiplex.pd b/externals/zexy/tests/help-msg/demultiplex.pd deleted file mode 100644 index 2c8b4b8df7d834a8d2da020b8077dd8446d27248..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/demultiplex.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 demultiplex; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [demultiplex] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/demultiplex~.pd b/externals/zexy/tests/help-msg/demultiplex~.pd deleted file mode 100644 index 709bee445ea5cc1664de6a54d7a3c61f35ea9c54..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/demultiplex~.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 demultiplex~; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [demultiplex~] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/dfreq~.pd b/externals/zexy/tests/help-msg/dfreq~.pd deleted file mode 100644 index 7e1aa1cd47ba08fe84297347b785a06ddc6e081f..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/dfreq~.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 dfreq~; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [dfreq~] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/dirac~.pd b/externals/zexy/tests/help-msg/dirac~.pd deleted file mode 100644 index 29ddf8541674155b35c8d5e90c428023f218cdd7..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/dirac~.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 dirac~; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [dirac~] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/drip.pd b/externals/zexy/tests/help-msg/drip.pd deleted file mode 100644 index 2c719c4a1d464cefad6ff8b8f5de1d0635560a96..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/drip.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 drip; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [drip] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/envrms~.pd b/externals/zexy/tests/help-msg/envrms~.pd deleted file mode 100644 index bf7c075b5ec9f7bab796caad6f5b979b5c762c33..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/envrms~.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 envrms~; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [envrms~] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/fifop.pd b/externals/zexy/tests/help-msg/fifop.pd deleted file mode 100644 index badb7a43a6a1356d1be87315ab04bdf69e05b76e..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/fifop.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 fifop; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [fifop] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/glue.pd b/externals/zexy/tests/help-msg/glue.pd deleted file mode 100644 index 45dd262583fc82178ea5f9ab6d982b3e27ecb622..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/glue.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 glue; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [glue] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/index.pd b/externals/zexy/tests/help-msg/index.pd deleted file mode 100644 index 982bc4c2d7f5c420773750cc847179b23d5699a6..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/index.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 index; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [index] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/length.pd b/externals/zexy/tests/help-msg/length.pd deleted file mode 100644 index 97c0383e5d5537fc43525e053298a1e15d8bb276..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/length.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 length; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [length] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/lifop.pd b/externals/zexy/tests/help-msg/lifop.pd deleted file mode 100644 index 4347c6e5900600bd5a981b6722d8876b6bfc14bd..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/lifop.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 lifop; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [lifop] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/limiter~.pd b/externals/zexy/tests/help-msg/limiter~.pd deleted file mode 100644 index fc9b79a5a8ce1b72dcc2bf433d75930f783788e3..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/limiter~.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 limiter~; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [limiter~] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/list2int.pd b/externals/zexy/tests/help-msg/list2int.pd deleted file mode 100644 index d7b6fdac7b4d439abdb58606f1f9344cf00ed14a..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/list2int.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 list2int; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [list2int] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/list2symbol.pd b/externals/zexy/tests/help-msg/list2symbol.pd deleted file mode 100644 index f36c1e2480a952614ab5d7d582209ebd8edf706a..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/list2symbol.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 list2symbol; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [list2symbol] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/lister.pd b/externals/zexy/tests/help-msg/lister.pd deleted file mode 100644 index d1dd8efaaf39d81d04268fb916faf9a1589acc2c..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/lister.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 lister; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [lister] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/lpt.pd b/externals/zexy/tests/help-msg/lpt.pd deleted file mode 100644 index c5eac377c53a13a8fb44fe992a5ea6ae07a8f00d..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/lpt.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 lpt; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [lpt] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/makesymbol.pd b/externals/zexy/tests/help-msg/makesymbol.pd deleted file mode 100644 index 84dbbab0a670a672e25ae1520d87ee5f07fa1761..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/makesymbol.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 makesymbol; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [makesymbol] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/mavg.pd b/externals/zexy/tests/help-msg/mavg.pd deleted file mode 100644 index 8a5047c5428d2b88ef43d81c082337fc9e97dd38..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/mavg.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 mavg; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [mavg] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/minmax.pd b/externals/zexy/tests/help-msg/minmax.pd deleted file mode 100644 index ce71ac47deae340ceed0e62d97b3d504ac0b7289..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/minmax.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 minmax; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [minmax] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/msgfile.pd b/externals/zexy/tests/help-msg/msgfile.pd deleted file mode 100644 index 0e5d8c806261dea5784c15cb1d2b374c0fedde80..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/msgfile.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 msgfile; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [msgfile] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/multiline~.pd b/externals/zexy/tests/help-msg/multiline~.pd deleted file mode 100644 index 42ffba04b03b59593632dd49e0e3f7a077f11908..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/multiline~.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 multiline~; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [multiline~] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/multiplex.pd b/externals/zexy/tests/help-msg/multiplex.pd deleted file mode 100644 index ff83297ee34a2be5d4dc9e8709723561000b9671..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/multiplex.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 multiplex; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [multiplex] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/multiplex~.pd b/externals/zexy/tests/help-msg/multiplex~.pd deleted file mode 100644 index 61f1ab2d7d191379ddc339e42139ab449bfdd9f8..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/multiplex~.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 multiplex~; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [multiplex~] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/niagara.pd b/externals/zexy/tests/help-msg/niagara.pd deleted file mode 100644 index 5ea405e4fa0f684e1ce2ba370fd9b9cfae5a87a8..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/niagara.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 niagara; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [niagara] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/noish~.pd b/externals/zexy/tests/help-msg/noish~.pd deleted file mode 100644 index 483fa6ba4b28145648bf772921f19a99f8668e39..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/noish~.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 noish~; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [noish~] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/noisi~.pd b/externals/zexy/tests/help-msg/noisi~.pd deleted file mode 100644 index b7b0d6b42ff67328f657d18dadfd33a6ccdf3984..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/noisi~.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 noisi~; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [noisi~] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/operating_system.pd b/externals/zexy/tests/help-msg/operating_system.pd deleted file mode 100644 index 804bd22ec316a3819a73a081ac21e951f7b05f62..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/operating_system.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 operating_system; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [operating_system] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/packel.pd b/externals/zexy/tests/help-msg/packel.pd deleted file mode 100644 index b92f68163f97f0ff9018c4c04139da756020676f..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/packel.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 packel; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [packel] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/pack~.pd b/externals/zexy/tests/help-msg/pack~.pd deleted file mode 100644 index 225c31dd6a30a4342098769d3392f4e893fd49f3..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/pack~.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 pack~; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [pack~] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/pdf~.pd b/externals/zexy/tests/help-msg/pdf~.pd deleted file mode 100644 index 9e09e1bdeb3b54cd02d1acb37d56aa3d784e639e..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/pdf~.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 pdf~; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [pdf~] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/prime.pd b/externals/zexy/tests/help-msg/prime.pd deleted file mode 100644 index fdf6d5f5c8b855e8fe46d6a3503bdfd3b551a786..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/prime.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 prime; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [prime] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/quantize~.pd b/externals/zexy/tests/help-msg/quantize~.pd deleted file mode 100644 index 17955e675155fe912a18a06ea972d2cf1e1ac1c6..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/quantize~.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 quantize~; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [quantize~] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/regex.pd b/externals/zexy/tests/help-msg/regex.pd deleted file mode 100644 index 1ae4896a9adf8de5f368a858e7cc3a5a5a313259..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/regex.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 regex; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [regex] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/relay.pd b/externals/zexy/tests/help-msg/relay.pd deleted file mode 100644 index 1ad88d04db3fde1d58d5c98042c531668f515ab9..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/relay.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 relay; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [relay] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/repack.pd b/externals/zexy/tests/help-msg/repack.pd deleted file mode 100644 index e451f45d580311d60058f7a41d998688bdc59e7c..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/repack.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 repack; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [repack] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/repeat.pd b/externals/zexy/tests/help-msg/repeat.pd deleted file mode 100644 index 0ffb53482ce38f578e4caa358229eca1969b8cb0..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/repeat.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 repeat; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [repeat] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/sfplay.pd b/externals/zexy/tests/help-msg/sfplay.pd deleted file mode 100644 index fe7df5ebe68e1239edcbe3904caf8141b34f2f19..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/sfplay.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 sfplay; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [sfplay] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/sfrecord.pd b/externals/zexy/tests/help-msg/sfrecord.pd deleted file mode 100644 index fc6291d044447afc55759468aa863c3e6ae1207a..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/sfrecord.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 sfrecord; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [sfrecord] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/sgn~.pd b/externals/zexy/tests/help-msg/sgn~.pd deleted file mode 100644 index 056682aa49c2c1ca519900ff41cb9aae7ab4a3ea..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/sgn~.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 sgn~; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [sgn~] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/sigzero~.pd b/externals/zexy/tests/help-msg/sigzero~.pd deleted file mode 100644 index 7637621bb935c3b6878346ca1e2e785c0398cb1c..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/sigzero~.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 sigzero~; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [sigzero~] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/sort.pd b/externals/zexy/tests/help-msg/sort.pd deleted file mode 100644 index bf41ad17405aebcc3781b6f75bcff99cbb6f6d8e..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/sort.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 sort; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [sort] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/step~.pd b/externals/zexy/tests/help-msg/step~.pd deleted file mode 100644 index 2facfe19243f8f503e90220557871dd4a2dbf662..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/step~.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 step~; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [step~] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/strcmp.pd b/externals/zexy/tests/help-msg/strcmp.pd deleted file mode 100644 index 174c1b5df50726eb21c26e646519b7421c498628..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/strcmp.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 strcmp; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [strcmp] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/sum.pd b/externals/zexy/tests/help-msg/sum.pd deleted file mode 100644 index bd058803f83b5a0f3de604b9ba7dca64e3344721..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/sum.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 sum; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [sum] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/swap~.pd b/externals/zexy/tests/help-msg/swap~.pd deleted file mode 100644 index b6de21e41c2bb70c867c01b6443608f5b8a2287f..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/swap~.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 swap~; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [swap~] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/symbol2list.pd b/externals/zexy/tests/help-msg/symbol2list.pd deleted file mode 100644 index db821beb09ec0b3aa68ff0a6e111b2bacf638d06..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/symbol2list.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 symbol2list; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [symbol2list] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/tabdump.pd b/externals/zexy/tests/help-msg/tabdump.pd deleted file mode 100644 index 3f96767add041281eaf73182ec9e21594113f38b..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/tabdump.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 tabdump; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [tabdump] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/tabminmax.pd b/externals/zexy/tests/help-msg/tabminmax.pd deleted file mode 100644 index 8d5ff9453b8f6097f72ae1400e07aa07d04ac2c6..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/tabminmax.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 tabminmax; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [tabminmax] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/tabset.pd b/externals/zexy/tests/help-msg/tabset.pd deleted file mode 100644 index b97046f945fd47af5320772d72f11d90b965ec3f..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/tabset.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 tabset; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [tabset] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/tavg~.pd b/externals/zexy/tests/help-msg/tavg~.pd deleted file mode 100644 index e831c558c646b2eb74af727a68f0ad2e2867cc9d..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/tavg~.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 tavg~; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [tavg~] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/time.pd b/externals/zexy/tests/help-msg/time.pd deleted file mode 100644 index ee2b27375bf3de1e31f9dd71c4569afb596a1be9..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/time.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 time; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [time] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/unpack~.pd b/externals/zexy/tests/help-msg/unpack~.pd deleted file mode 100644 index a7f987bfcd28884b8f362d8eef8b8e757cf6665a..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/unpack~.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 unpack~; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [unpack~] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/urn.pd b/externals/zexy/tests/help-msg/urn.pd deleted file mode 100644 index 2c8403be97bf29fd240cd6e6dd4a296eabd934cf..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/urn.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 urn; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [urn] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/wrap.pd b/externals/zexy/tests/help-msg/wrap.pd deleted file mode 100644 index cba992362e349f3d6b01681ee04780a958f31540..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/wrap.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 wrap; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [wrap] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/zexy_.pd b/externals/zexy/tests/help-msg/zexy_.pd deleted file mode 100644 index 44d3d5816e584e32e0eb4f2483575b52144b5001..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/zexy_.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 zexy; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [zexy] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/help-msg/z~.pd b/externals/zexy/tests/help-msg/z~.pd deleted file mode 100644 index cbee1c5c36efbd91e95835caf4fe25b12317fe60..0000000000000000000000000000000000000000 --- a/externals/zexy/tests/help-msg/z~.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 179 117 582 310 10; -#X obj 91 117 inlet bang; -#X obj 91 270 outlet result; -#X obj 91 138 t b b b; -#X obj 113 214 z~; -#X obj 91 240 i 1; -#X msg 113 183 help; -#X text 37 51 tests whether [z~] crashes when a "help"-message is -sent; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 1 5 0; -#X connect 4 0 1 0; -#X connect 5 0 3 0; diff --git a/externals/zexy/tests/relay/floatfloat.pd b/externals/zexy/tests/relay/floatfloat.pd new file mode 100644 index 0000000000000000000000000000000000000000..3abc4a7e46e83cd013892957599314d781112312 --- /dev/null +++ b/externals/zexy/tests/relay/floatfloat.pd @@ -0,0 +1,23 @@ +#N canvas 181 112 569 329 10; +#X obj 91 107 inlet bang; +#X obj 91 290 outlet result; +#X obj 91 128 t b b b; +#X obj 91 260 i; +#X msg 107 233 1; +#X msg 139 233 0; +#X msg 107 159 1; +#X obj 107 184 relay 1; +#X obj 107 206 select 1; +#X text 38 51 Pd's implicit float->list coercion on the inlet results +in NULL-selectors \, wich eventually crashes Pd when passed to the +outlet...; +#X connect 0 0 2 0; +#X connect 2 0 3 0; +#X connect 2 1 6 0; +#X connect 2 2 5 0; +#X connect 3 0 1 0; +#X connect 4 0 3 1; +#X connect 5 0 3 1; +#X connect 6 0 7 0; +#X connect 7 0 8 0; +#X connect 8 0 4 0; diff --git a/externals/zexy/tests/run1.pd b/externals/zexy/tests/run1.pd new file mode 100644 index 0000000000000000000000000000000000000000..773035b7913f84c4a4b41cfa0ecb5d1122fcbc89 --- /dev/null +++ b/externals/zexy/tests/run1.pd @@ -0,0 +1,12 @@ +#N canvas 359 534 538 390 10; +#X obj 182 84 r test; +#X obj 182 106 symbol; +#X msg 259 171 \; pd dsp 1; +#X obj 182 197 testunit; +#X obj 182 128 t s b; +#X msg 182 227 \; pd quit; +#X connect 0 0 1 0; +#X connect 1 0 4 0; +#X connect 3 0 5 0; +#X connect 4 0 3 0; +#X connect 4 1 2 0; diff --git a/externals/zexy/tests/runtests.sh b/externals/zexy/tests/runtests.sh index cac11847f80d7d93d88f31fbfd501a3e9153fda7..d4dcd96a351c0e4e06cb749aca5c53b72f481c10 100755 --- a/externals/zexy/tests/runtests.sh +++ b/externals/zexy/tests/runtests.sh @@ -33,10 +33,10 @@ else RUNTESTS_LOG=tmp$$.log fi -LIBFLAGS="-path ../src/.libs/:../src/:../ -lib zexy -path ../abs/:${TESTDIR}:." +LIBFLAGS="-path ../ -lib zexy -path ../abs/:${TESTDIR}:." list_tests() { -# find . -mindepth 2 -name "*.pd" | sed 's|\.pd$|;|' +# find . -mindepth 2 -name "*.pd" | sed 's|\.pd$|;|' ls -1 ${TESTDIR}/*/*.pd | sed 's|\.pd$|;|' } @@ -81,7 +81,7 @@ evaluate_tests() { run_nogui() { debug "running test without gui" - ${PD} ${LIBFLAGS} -nogui runtests_nogui.pd > ${RUNTESTS_LOG} 2>&1 + ${PD} ${LIBFLAGS} -nrt -noprefs -nostdpath -batch runtests_nogui.pd > ${RUNTESTS_LOG} 2>&1 SUCCESS=$? debug "testing done" evaluate_tests ${RUNTESTS_TXT} ${RUNTESTS_LOG} @@ -128,7 +128,9 @@ if [ "x${RUNTESTS_NOLOG}" != "x" ]; then RUNTESTS_FINAL_LOG= fi if [ "x${RUNTESTS_FINAL_LOG}" = "x" ]; then - : + if [ ${SUCCESS} -ne 0 ]; then + cat "${RUNTESTS_LOG}" + fi else cat ${RUNTESTS_LOG} >> ${RUNTESTS_FINAL_LOG} fi diff --git a/externals/zexy/tests/testrunner.sh b/externals/zexy/tests/testrunner.sh new file mode 100755 index 0000000000000000000000000000000000000000..27ba82254aab7874be318a8b0766e6cec00e298c --- /dev/null +++ b/externals/zexy/tests/testrunner.sh @@ -0,0 +1,305 @@ +#!/bin/sh + + +if [ "x$(which realpath)" = "x" ]; then +realpath() { + if [ -d "$1" ]; then + (cd "$1"; pwd -P) + else + (cd $(dirname "$1"); pwd -P) + fi +} +fi + +PD=${PD:=$(which pd)} +LIBDIR=${LIBDIR:=..} +ABSDIR=${ABSDIR:=${LIBDIR}/abs} +SCRIPTDIR=${0%/*} +TESTDIR=${TESTDIR:=${SCRIPTDIR}} +SCRIPTDIR=$(realpath ${SCRIPTDIR}) + +count_all=0 +count_pass=0 +count_fail=0 +count_skip=0 +count_xfail=0 +count_xpass=0 +count_error=0 + + +usage() { +cat 1>&2 <<EOF +usage: $0 [options] <testpatch> [ <testpatch>... ] + <testpatch>: Pd-patch to be tested + options + -v raise verbosity + -q lower verbosity + -l show log on failure + -x expect test to fail + -X test-files starting with fail are expected to fail + -s soft fail (don't fail on skip) +EOF +exit +} +sys_exit() { + test $softfail -gt 0 && test $1 -eq 77 && exit 0 + exit $1 +} +catverbose() { + if [ $1 -le $verbosity ]; then + cat + else + cat >/dev/null + fi +} +if test "X$TERM" != Xdumb && test -t 1 2>/dev/null; then + red='^[[0;31m' + # grn='^[[0;32m' + lgn='^[[1;32m' + blu='^[[1;34m' + mgn='^[[0;35m' + brg='^[[1m' + #std='^[[m' + + red='\e[0;31m' + lrd='\e[0;91m' + grn="\e[32m" + lgn='\e[1;32m' + blu='\e[1;34m' + mgn='\e[0;35m' + brg='\e[1m' + + std="\e[0m" +else + red= + grn= + lgn= + blu= + mgn= + brg= + std= +fi + +report_success() { +if [ 1 -le $verbosity ]; then + case "$1" in + 0) + if [ "x${wantfail}" = "x1" ]; then + echo "${lgn}XFAIL${std}: $2" + else + echo "${grn}PASS${std}: $2" + fi + ;; + 1) + if [ "x${wantfail}" = "x1" ]; then + echo "${lrd}XPASS${std}: $2" + else + echo "${red}FAIL${std}: $2" + fi + ;; + 77) + echo "${blu}SKIP${std}: $2" + ;; + 99) + echo "${mgn}ERROR${std}: $2" + ;; + *) + echo "${red}FAIL$1${std}: $2" + ;; + esac +fi + count_all=$((count_all+1)) + case "$1" in + 0) + if [ "x${wantfail}" = "x1" ]; then + count_xfail=$((count_xfail+1)) + else + count_pass=$((count_pass+1)) + fi + ;; + 77) + count_skip=$((count_skip+1)) + ;; + 99) + count_error=$((count_error+1)) + ;; + *) + if [ "x${wantfail}" = "x1" ]; then + count_xpass=$((count_xpass+1)) + else + count_fail=$((count_fail+1)) + fi + ;; + esac +} +highlight_nonnull() { + if [ $1 -gt 0 ]; then + echo "$2$1$std" + else + echo "$1" + fi +} +summary_success() { + if [ 0 -le $verbosity ]; then + echo "" + echo "${grn}============================================================================${std}" + echo "${grn}Testsuite summary" + echo "${grn}============================================================================${std}" + echo "${brg}TOTAL${std} $(highlight_nonnull ${count_all} ${brg})" + echo "${grn}PASS${std} $(highlight_nonnull ${count_pass} ${grn})" + echo "${red}FAIL${std} $(highlight_nonnull ${count_fail} ${red})" + echo "${blu}SKIP${std} $(highlight_nonnull ${count_skip} ${blu})" + echo "${lgn}XFAIL${std} $(highlight_nonnull ${count_xfail} ${lgn})" + echo "${lrd}XPASS${std} $(highlight_nonnull ${count_xpass} ${lrd})" + echo "${mgn}ERROR${std} $(highlight_nonnull ${count_error} ${mgn})" + echo "${grn}============================================================================${std}" + fi + + if [ ${count_skip} -gt 0 ]; then SUCCESS=77; fi + if [ $((count_pass+count_xfail)) -gt 0 ]; then SUCCESS=0; fi + if [ $((count_fail+count_xpass)) -gt 0 ]; then SUCCESS=1; fi + if [ ${count_error} -gt 0 ]; then SUCCESS=99; fi +} + +should_fail() { + if [ "x$1" = "xauto" ]; then + if [ "x${2#fail}" != "x${2}" ]; then + echo 1 + else + echo 0 + fi + else + echo $1 + fi +} + +check_success() { + if [ ${wantfail} -ge 1 ]; then + case "$1" in + 0) + echo 1 + ;; + 77|99) + echo $1 + ;; + *) + echo 0 + ;; + esac + else + echo $1 + fi +} + +verbosity=1 +showlog=0 +shouldfail=0 +softfail=0 + +while getopts "vqlxXsh?" opt; do + case $opt in + v) + verbosity=$((verbosity+1)) + ;; + q) + verbosity=$((verbosity-1)) + ;; + l) + showlog=1 + ;; + x) + shouldfail=1 + ;; + X) + shouldfail=auto + ;; + s) + softfail=1 + ;; + :|h|\?) + usage + ;; + esac +done +shift $(($OPTIND - 1)) +if [ $# -lt 1 ]; then + usage +fi + + +wantfail=${shouldfail} +if [ "x${PD}" = "x" ]; then + echo "couldn't find Pd (Hint: use the PD environment variable)" 1>&2 + sys_exit 77 +fi +LIBFLAGS="-path ${LIBDIR} -path ${ABSDIR} -path . -lib ${LIBDIR}/zexy" + +do_runtest() { + +TEST=$1 +if [ ! -e "${TEST}" ]; then + usage +fi + +# assume that the first component of the test-path is the object to be tested +# at least this object must not fail to create +TESTOBJ=$(realpath "${TEST}") +TESTOBJ=${TESTOBJ#${SCRIPTDIR}} +TESTOBJ=${TESTOBJ#/} +TESTOBJ=${TESTOBJ%%/*} + +TMPFILE=$(mktemp) + +SUCCESS=0 +${VALGRIND} "${PD}" \ + -noprefs -nostdpath \ + -oss -nosound -nrt \ + -nogui -batch -verbose \ + ${LIBFLAGS} \ + -open "${TESTDIR}/run1.pd" \ + -send "test ${TEST%.pd}" \ + >"${TMPFILE}" 2>&1 +SUCCESS=$? +cat "${TMPFILE}" | catverbose 3 + +if [ $SUCCESS -eq 0 ]; then +if egrep "^regression-test" "${TMPFILE}" >/dev/null; then + egrep "^regression-test: ${TEST%.pd}: OK" "${TMPFILE}" >/dev/null + SUCCESS=$? +else + SUCCESS=77 +fi +fi + + +if egrep -B1 "^error: \.\.\. couldn't create" "${TMPFILE}" \ + | egrep -v "^error: \.\.\. couldn't create" \ + | awk '{print $1}' \ + | egrep "^${TESTOBJ}$" \ + >/dev/null +then + echo "COULDN'T CREATE $TESTOBJ" | catverbose 2 1>&2 + SUCCESS=1 +fi + +wantfail=$(should_fail $shouldfail ${TEST##*/}) +SUCCESS=$(check_success $SUCCESS) + +if test ${SUCCESS} -ge 1 && test ${showlog} -ge 1 && test $verbosity -le 3; then + cat "${TMPFILE}" +fi +rm "${TMPFILE}" +report_success $SUCCESS "$TEST" + +} + + +for t in "$@"; do + do_runtest "$t" +done + +if [ ${count_all} -gt 1 ]; then + summary_success +fi + +sys_exit ${SUCCESS} diff --git a/externals/zexy/tests/testunit.pd b/externals/zexy/tests/testunit.pd index bc723a7c834642ca436bda5351e56cbc5ae068e3..c58a501629137744f4eb41df4f6acd0d9aebc67b 100644 --- a/externals/zexy/tests/testunit.pd +++ b/externals/zexy/tests/testunit.pd @@ -1,10 +1,10 @@ -#N canvas 578 118 585 499 10; -#N canvas 456 161 474 559 run-test 0; -#X obj 71 136 symbol; -#X obj 71 104 inlet test-to-run; -#X obj 71 514 outlet result; -#X obj 71 440 pack 0 s; -#X msg 113 136 bang; +#N canvas 580 113 585 499 10; +#N canvas 460 151 515 549 run-test 0; +#X obj 131 186 symbol; +#X obj 64 104 inlet test-to-run; +#X obj 131 514 outlet result; +#X obj 131 440 pack 0 s; +#X msg 173 186 bang; #N canvas 396 344 450 300 print 0; #X obj 101 247 print regression-test; #X obj 101 204 pack s s; @@ -27,10 +27,10 @@ #X connect 8 0 9 0; #X connect 9 0 2 0; #X connect 9 1 1 1; -#X restore 96 491 pd print result; -#X obj 71 252 t f b; -#X text 99 217 start regression test; -#X text 105 251 regression test finished; +#X restore 156 491 pd print result; +#X obj 131 302 t f b; +#X text 159 267 start regression test; +#X text 165 301 regression test finished; #N canvas 318 184 905 641 get 0; #X obj 105 488 outlet; #X obj 105 26 inlet reset; @@ -80,14 +80,14 @@ triggers it's own destruction (stack corruption); #X connect 20 1 22 1; #X connect 21 0 22 0; #X connect 22 0 0 0; -#X restore 71 232 pd get result; +#X restore 131 282 pd get result; #X text 64 17 the test MUST return a result!; #X text 77 64 cons: the regression test suite will block until the test returns a result (potentially infinitely long)!; #X text 77 33 pros: the test need not be finished in zero-time (good for testing signal-objects or timed objects); -#X obj 71 470 t l l; -#N canvas 4 49 625 330 create/destroy 0; +#X obj 131 470 t l l; +#N canvas 8 48 625 330 create/destroy 0; #X obj 148 53 inlet; #X obj 449 48 inlet clear; #X obj 148 129 pack s \$0; @@ -107,8 +107,8 @@ for testing signal-objects or timed objects); #X connect 5 1 3 0; #X connect 6 0 7 0; #X connect 8 0 2 0; -#X restore 146 324 pd create/destroy testpatch; -#N canvas 0 0 450 300 restartaudio 0; +#X restore 206 374 pd create/destroy testpatch; +#N canvas 0 50 450 300 restartaudio 0; #X obj 113 77 inlet; #X obj 113 99 t b; #X msg 113 121 dsp 0 \, dsp 1; @@ -116,13 +116,15 @@ for testing signal-objects or timed objects); #X connect 0 0 1 0; #X connect 1 0 2 0; #X connect 2 0 3 0; -#X restore 141 186 pd restartaudio; -#X obj 71 214 t b; -#X obj 71 186 t b b; -#X obj 71 164 t b s s s; -#X obj 142 165 print starting; +#X restore 201 236 pd restartaudio; +#X obj 131 264 t b; +#X obj 131 236 t b b; +#X obj 131 214 t b s s s; +#X obj 202 215 print starting; +#X obj 64 126 route bang; +#X obj 64 148 t b; #X connect 0 0 18 0; -#X connect 1 0 0 0; +#X connect 1 0 20 0; #X connect 3 0 13 0; #X connect 4 0 0 0; #X connect 6 0 3 0; @@ -137,6 +139,9 @@ for testing signal-objects or timed objects); #X connect 18 1 14 0; #X connect 18 2 3 1; #X connect 18 3 19 0; +#X connect 20 0 21 0; +#X connect 20 1 0 0; +#X connect 21 0 14 1; #X restore 94 218 pd run-test; #X obj 94 243 outlet; #X obj 94 191 inlet; @@ -150,6 +155,6 @@ for testing signal-objects or timed objects); #X text 64 92 if no result is returned immediately \, the test is considered to be FAILED!; #X text 63 131 note: we could have this be using "0" as the WAIT result -\, an no-result as KO \; for legacy reasons we don't; +\, and no-result as KO \; for legacy reasons we don't; #X connect 0 0 1 0; #X connect 2 0 0 0; diff --git a/externals/zexy/z_install.bat b/externals/zexy/z_install.bat deleted file mode 100644 index 3f39e469303a8d1b288cf712a66dcce8f974c54b..0000000000000000000000000000000000000000 --- a/externals/zexy/z_install.bat +++ /dev/null @@ -1,73 +0,0 @@ -@echo off -REM ============================================== -REM adapt the following to your needs -REM ============================================== - -REM where does PD reside ?? -REM if you want spaces in the path, please use quotes ("") -set PDPATH="%PROGRAMFILES%\pd" - -REM which pd-version do we have ? -set PDVERSION=0.38 - - - - - - - - - -REM ============================================== -REM do not edit below this line !!! -REM ============================================== - -echo : -echo : installing zexy on your system -echo : -echo : assuming that PD-version is at least %PDVERSION% -echo : assuming that PD is installed at %PDPATH% -echo : -echo : if this is correct, hit [return] to proceed -echo : if this is incorrect, stop this programm ([Ctrl]-C), edit 'z_install.bat' to your needs and rerun -echo : -pause - - -IF NOT EXIST %PDPATH%\bin\pd.exe goto location_error - -set BINPATH=extra -set REFPATH=extra\zexy - -if %PDVERSION% LSS 0.37 set REFPATH=doc\5.reference\zexy - -echo Copying binary... -copy zexy.dll %PDPATH%\%BINPATH% > tempInstall.trash - -echo copying help files -mkdir %PDPATH%\%REFPATH% -copy reference\* %PDPATH%\%REFPATH% > tempInstall.trash - -echo copying abstractions -copy abs\*.pd %PDPATH%\%BINPATH% > tempInstall.trash - -echo : done -echo : dont forget to load zexy on startup... -echo : have fun - - - -goto end - -:location_error -echo : -echo : i believe i am in the wrong directory -echo : i thought that the pd-executable would be %PDPATH%\bin\pd.exe -echo : obviously it is not !!! -echo : please edit this file and set the PDPATH-variable apropriatly -echo : -echo : stopping installation -echo : - -:end -pause diff --git a/externals/zexy/zexy-meta.pd.in b/externals/zexy/zexy-meta.pd similarity index 99% rename from externals/zexy/zexy-meta.pd.in rename to externals/zexy/zexy-meta.pd index ff8774ae67b5a70ba0031c606f8ea9963f083b5f..076c3690c8e21a782de07a6c13ad5285e1096416 100644 --- a/externals/zexy/zexy-meta.pd.in +++ b/externals/zexy/zexy-meta.pd @@ -297,11 +297,11 @@ the type; #X text 430 82 bug-reports: zmoelnig-AT-iem.at; #N canvas 498 232 309 146 META 0; #X text 10 10 NAME zexy; -#X text 10 30 VERSION @PACKAGE_VERSION@; +#X text 10 30 VERSION 2.3.1; #X text 10 50 AUTHOR IOhannes m zmölnig; #X text 10 70 LICENSE GPL-2; #X text 10 90 DESCRIPTION the swiss army knife for Pd; #X restore 23 27 pd META; #X text 228 7 the zexy external; -#X text 429 66 (c) forum::für::umläute 1999-2012; +#X text 429 66 (c) forum::für::umläute 1999-2020; #X connect 1 0 0 0; diff --git a/l2ork_addons/tar_em_up.sh b/l2ork_addons/tar_em_up.sh index 46b69fce1f61f161a27af39bbad20b3c3be6cb18..3ac2a883ad222493e351a99348e0661b033f06e8 100755 --- a/l2ork_addons/tar_em_up.sh +++ b/l2ork_addons/tar_em_up.sh @@ -106,6 +106,7 @@ do case $Option in done inst_dir=${inst_dir:-/usr/local} +dpkg=${dpkg:-/usr/bin/dpkg-deb} # configure a light build if requested if [ $light -gt 0 ]; then @@ -120,7 +121,9 @@ export TAR_EM_UP_PREFIX=$inst_dir # to fetch the nwjs binaries below os=`uname | tr '[:upper:]' '[:lower:]'` -if [[ $os == *"mingw32"* ]]; then +if [[ $os == *"mingw64"* ]]; then + os=win64 +elif [[ $os == *"mingw"* ]]; then os=win elif [[ $os == "darwin" ]]; then os=osx @@ -130,7 +133,7 @@ fi if [ $any -gt 0 ]; then if [[ $os == "osx" ]]; then dmg=1 - elif [[ $os == "win" ]]; then + elif [[ $os == "win" || $os == "win64" ]]; then inno=$any else deb=$any @@ -145,7 +148,7 @@ if [ $full -gt 0 ]; then if [[ $os == "osx" ]]; then dmg=1 echo "Warning: tarball installer not supported on Mac, building a dmg installer instead." - elif [[ $os == "win" ]]; then + elif [[ $os == "win" || $os == "win64" ]]; then inno=$full echo "Warning: tarball installer not supported on Windows, building a Windows installer instead." fi @@ -154,9 +157,9 @@ fi # Automagically disable Debian packaging when the Debian packaging tools are # not available. -if test $deb -gt 0 && test $pkg -gt 0 && ! test -x /usr/bin/dpkg-deb; then +if test $deb -gt 0 && test $pkg -gt 0 && ! test -x "$dpkg"; then pkg=0; - echo "Debian toolchain unavailable, Debian packaging disabled" + echo "Debian toolchain unavailable, skipping Debian packaging" fi # Fetch the nw.js binary if we haven't already. We want to fetch it even @@ -179,27 +182,37 @@ if [ ! -d "../pd/nw/nw" ]; then arch="armv7l" fi - if [[ $os == "win" || $os == "osx" ]]; then + # MSYS: Pick the right architecture depending on whether we're + # running in the 32 or 64 bit version of the MSYS shell. + if [[ $os == "win" ]]; then + arch="ia32" + elif [[ $os == "win64" ]]; then + arch="x64" + fi + if [[ $os == "win" || $os == "win64" || $os == "osx" ]]; then ext="zip" else ext="tar.gz" fi - if [[ $os == "win" || $osx_version == "10.8" ]]; then - # We need the lts version to be able to run on XP. For - # simplicity we use that same version for 64 bit Windows, too + if [[ $osx_version == "10.8" ]]; then + # We need the lts version to be able to run on legacy systems. nwjs_version="v0.14.7" else # temporary kluge for rpi-- only 0.15.1 is available atm if [ $arch == "armv7l" ]; then nwjs_version="v0.17.6" else - nwjs_version="v0.24.4" + nwjs_version="v0.28.1" fi fi nwjs="nwjs-sdk" - nwjs_dirname=${nwjs}-${nwjs_version}-${os}-${arch} + if [[ $os == "win64" ]]; then + nwjs_dirname=${nwjs}-${nwjs_version}-win-${arch} + else + nwjs_dirname=${nwjs}-${nwjs_version}-${os}-${arch} + fi nwjs_filename=${nwjs_dirname}.${ext} nwjs_url=https://git.purrdata.net/jwilkes/nwjs-binaries/raw/master nwjs_url=${nwjs_url}/$nwjs_filename @@ -211,7 +224,7 @@ if [ ! -d "../pd/nw/nw" ]; then echo "$nwjs_url" wget -nv $nwjs_url fi - if [[ $os == "win" || $os == "osx" ]]; then + if [[ $os == "win" || $os == "win64" || $os == "osx" ]]; then unzip $nwjs_filename else tar -xf $nwjs_filename @@ -230,7 +243,7 @@ if [ ! -d "../pd/nw/nw" ]; then fi # For Windows, fetch the ASIO SDK if we don't have it already -if [[ $os == "win" ]]; then +if [[ $os == "win" || $os == "win64" ]]; then if [ ! -d "../pd/lib" ]; then mkdir ../pd/lib wget http://www.steinberg.net/sdk_downloads/asiosdk2.3.zip @@ -295,6 +308,8 @@ then cd ../pd/src && aclocal && autoconf if [[ $os == "win" ]]; then cd ../../packages/win32_inno + elif [[ $os == "win64" ]]; then + cd ../../packages/win64_inno elif [[ $os == "osx" ]]; then cd ../../packages/darwin_app else @@ -328,7 +343,7 @@ then cp -f ../../l2ork_addons/flext/config-lnx-pd-gcc.txt.rpi ../../externals/grill/trunk/flext/buildsys/config-lnx-pd-gcc.txt cat ../../externals/OSCx/src/Makefile | sed -e s/-lpd//g > ../../externals/OSCx/src/Makefile fi - if [[ $os == "win" ]]; then + if [[ $os == "win" || $os == "win64" ]]; then echo "Making Windows package..." echo `pwd` make install INCREMENTAL=$INCREMENTAL LIGHT=$LIGHT && make package @@ -344,7 +359,7 @@ then echo "copying pd-l2ork-specific externals..." # patch_name # spectdelay - if [[ $os == "win" ]]; then + if [[ $os == "win" || $os == "win64" ]]; then cd ../../l2ork_addons elif [[ $os == "osx" ]]; then cd ../../l2ork_addons @@ -405,7 +420,11 @@ then elif [ $dmg -gt 0 ]; then mv packages/darwin_app/Pd*.dmg . elif [ $inno -gt 0 ]; then - mv packages/win32_inno/Output/Purr*.exe . + if [[ $os == "win64" ]]; then + mv packages/win64_inno/Output/Purr*.exe . + else + mv packages/win32_inno/Output/Purr*.exe . + fi fi fi diff --git a/packages/darwin_app/Makefile b/packages/darwin_app/Makefile index 2a6e07ae034fe26b884711d2d9432157ee044999..2b04949fa3836ae1b8fe2f26b0be6bb8a8a9b094 100644 --- a/packages/darwin_app/Makefile +++ b/packages/darwin_app/Makefile @@ -105,6 +105,7 @@ extended_app_install: # build a standalone nw.js app darwin_app_wrapper: Info.plist # nwjs.app + rm -rf "$(BUILD_BASE)" install -d "$(BUILD_BASE)" rsync -ax $(cvs_root_dir)/pd/nw/nw/nwjs.app/ $(BUILD_BASE)/$(PD_APP_NAME).app/ # set up app wrapper diff --git a/packages/linux_make/default.settings b/packages/linux_make/default.settings index 772d49e7647855c5164180cd400d741fb6fb19e5..dac29ce0a4b0623fcfd6eae5f71f0da8316f79fc 100644 --- a/packages/linux_make/default.settings +++ b/packages/linux_make/default.settings @@ -74,5 +74,4 @@ path33: /usr/lib/pd-l2ork/extra/flext path34: /usr/lib/pd-l2ork/extra/rjlib path35: /usr/lib/pd-l2ork/extra/disis path36: /usr/lib/pd-l2ork/extra/lyonpotpourri -path37: /usr/lib/pd-l2ork/extra/pdlua -npath: 37 +npath: 36 diff --git a/packages/win32_inno/Makefile b/packages/win32_inno/Makefile index 89714fead25e175ae1447a2f890f234805647bfd..a198acb643eff42abfed413a5154edbfaeddc223 100755 --- a/packages/win32_inno/Makefile +++ b/packages/win32_inno/Makefile @@ -99,6 +99,7 @@ lib_install: #install -p $(bin_src)/libgnurx-0.dll $(DESTDIR)$(bindir)/ install -p $(bin_src)/libogg-0.dll $(DESTDIR)$(bindir)/ install -p $(bin_src)/libsndfile-1.dll $(DESTDIR)$(bindir)/ + install -p $(bin_src)/libopus-0.dll $(DESTDIR)$(bindir)/ install -p $(bin_src)/libvorbis-0.dll $(DESTDIR)$(bindir)/ install -p $(bin_src)/libvorbisenc-2.dll $(DESTDIR)$(bindir)/ install -p $(bin_src)/libvorbisfile-3.dll $(DESTDIR)$(bindir)/ @@ -109,6 +110,7 @@ ifneq ($(LIGHT),yes) install -p $(bin_src)/libtre-5.dll $(DESTDIR)$(bindir)/ # For fluid~ install -p $(bin_src)/libfluidsynth-2.dll $(DESTDIR)$(bindir)/ + install -p $(bin_src)/SDL2.dll $(DESTDIR)$(bindir)/ install -p $(bin_src)/libgmodule-2.0-0.dll $(DESTDIR)$(bindir)/ install -p $(bin_src)/libreadline8.dll $(DESTDIR)$(bindir)/ install -p $(bin_src)/libtermcap-0.dll $(DESTDIR)$(bindir)/ @@ -132,6 +134,11 @@ ifneq ($(LIGHT),yes) install -p $(bin_src)/libpcre-1.dll $(DESTDIR)$(bindir)/ install -p $(bin_src)/libgraphite2.dll $(DESTDIR)$(bindir)/ install -p $(bin_src)/libjpeg-8.dll $(DESTDIR)$(bindir)/ + # New: lossless compression algorithm. Gem.dll won't load without it. + # Cf.: https://github.com/bagder/libbrotli. Looks like this recently + # got added to MSYS2. Apparently Gem needs only the decoder , but we + # include the entire shebang just in case. + install -p $(bin_src)/libbrotli*.dll $(DESTDIR)$(bindir)/ # Apparently these Gem dependencies must be in the bindir # to be found on Windows -install -p $(DESTDIR)/extra/Gem/gem_film*.dll $(DESTDIR)$(bindir)/ diff --git a/packages/win32_inno/pd-inno-light.iss.in b/packages/win32_inno/pd-inno-light.iss.in index b31855b5309a0a5ba55e0e4d055feda90115d31d..276b6cb4301ebce180da307742bd928045e74157 100644 --- a/packages/win32_inno/pd-inno-light.iss.in +++ b/packages/win32_inno/pd-inno-light.iss.in @@ -12,7 +12,7 @@ AppPublisher=purrdata.net AppPublisherURL=http://purrdata.net AppSupportURL=http://puredata.org/community/lists/ AppUpdatesURL=http://puredata.org/downloads/ -DefaultDirName={pf}\Purr Data +DefaultDirName={commonpf}\Purr Data DefaultGroupName=Purr Data LicenseFile=..\gpl-3.0.txt DisableWelcomePage=no @@ -706,12 +706,12 @@ Source: pd.ico; DestDir: {app}\lib ;----------------------------------------------------------------------------- ; put pdsend and pdreceive in the System dir so that they are in the path ; -Source: build\bin\pdsend.exe; DestDir: {sys}; Flags: confirmoverwrite promptifolder -Source: build\bin\pdreceive.exe; DestDir: {sys}; Flags: confirmoverwrite promptifolder +;Source: build\bin\pdsend.exe; DestDir: {sys}; Flags: confirmoverwrite promptifolder +;Source: build\bin\pdreceive.exe; DestDir: {sys}; Flags: confirmoverwrite promptifolder ; add Cyclone's cyclist.exe if it is present -#ifexist "build\bin\cyclist.exe" -Source: build\bin\cyclist.exe; DestDir: {sys}; Flags: confirmoverwrite promptifolder -#endif +;#ifexist "build\bin\cyclist.exe" +;Source: build\bin\cyclist.exe; DestDir: {sys}; Flags: confirmoverwrite promptifolder +;#endif ; ; ;----------------------------------------------------------------------------- @@ -756,13 +756,13 @@ Source: build\lib\*.*; DestDir: {app}\lib; Flags: ignoreversion recursesubdirs ; ; DLLs ; -Source: build\bin\lib*.dll; DestDir: {sys}; Flags: restartreplace confirmoverwrite sharedfile -#ifexist "build\msvcp71.dll" -Source: build\msvcp71.dll; DestDir: {sys}; Flags: restartreplace uninsneveruninstall sharedfile -#endif -#ifexist "build\msvcr71.dll" -Source: build\msvcr71.dll; DestDir: {sys}; Flags: restartreplace uninsneveruninstall sharedfile -#endif +;Source: build\bin\lib*.dll; DestDir: {sys}; Flags: restartreplace confirmoverwrite sharedfile +;#ifexist "build\msvcp71.dll" +;Source: build\msvcp71.dll; DestDir: {sys}; Flags: restartreplace uninsneveruninstall sharedfile +;#endif +;#ifexist "build\msvcr71.dll" +;Source: build\msvcr71.dll; DestDir: {sys}; Flags: restartreplace ;uninsneveruninstall sharedfile +;#endif ;; build stuff is not included now ;Source: build\portaudio\*.*; DestDir: {app}\portaudio; Flags: ignoreversion recursesubdirs ;Source: build\src\*.*; DestDir: {app}\src; Flags: ignoreversion recursesubdirs @@ -779,11 +779,11 @@ begin if(FileExists(ExpandConstant('{app}\unins000.exe')) AND FileExists(ExpandConstant('{app}\bin\pd.exe'))) then begin if MsgBox('Found a previous Version of Pure Data at ' + ExpandConstant('{app} ') + #13#13 'Do you want to uninstall it first? (recommended)', mbConfirmation, MB_YESNO) = idYes then begin if not Exec(ExpandConstant('{app}\unins000.exe'), '', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode) then - MsgBox('NextButtonClick:' #13#13 'The uninstall file could not be executed. ' + SysErrorMessage(ResultCode) + '.', mbError, MB_OK); + MsgBox('Error:' #13#13 'The uninstall file could not be executed. ' + SysErrorMessage(ResultCode) + '.', mbError, MB_OK); end; end; BringToFrontAndRestore(); - MsgBox('NextButtonClick:' #13#13 'The normal installation will now start.', mbInformation, MB_OK); + MsgBox('Note:' #13#13 'The installation will now start.', mbInformation, MB_OK); end; end; diff --git a/packages/win32_inno/pd-inno.iss.in b/packages/win32_inno/pd-inno.iss.in index 420111fca98d489f0b11defff03c00b2b7baf8ab..95e339ba47f9860a363f5c4391b7365757091d19 100755 --- a/packages/win32_inno/pd-inno.iss.in +++ b/packages/win32_inno/pd-inno.iss.in @@ -12,7 +12,7 @@ AppPublisher=purrdata.net AppPublisherURL=http://purrdata.net AppSupportURL=http://puredata.org/community/lists/ AppUpdatesURL=http://puredata.org/downloads/ -DefaultDirName={pf}\Purr Data +DefaultDirName={commonpf}\Purr Data DefaultGroupName=Purr Data LicenseFile=..\gpl-3.0.txt DisableWelcomePage=no @@ -706,12 +706,12 @@ Source: pd.ico; DestDir: {app}\lib ;----------------------------------------------------------------------------- ; put pdsend and pdreceive in the System dir so that they are in the path ; -Source: build\bin\pdsend.exe; DestDir: {sys}; Flags: confirmoverwrite promptifolder -Source: build\bin\pdreceive.exe; DestDir: {sys}; Flags: confirmoverwrite promptifolder +;Source: build\bin\pdsend.exe; DestDir: {sys}; Flags: confirmoverwrite promptifolder +;Source: build\bin\pdreceive.exe; DestDir: {sys}; Flags: confirmoverwrite promptifolder ; add Cyclone's cyclist.exe if it is present -#ifexist "build\bin\cyclist.exe" -Source: build\bin\cyclist.exe; DestDir: {sys}; Flags: confirmoverwrite promptifolder -#endif +;#ifexist "build\bin\cyclist.exe" +;Source: build\bin\cyclist.exe; DestDir: {sys}; Flags: confirmoverwrite promptifolder +;#endif ; ; ;----------------------------------------------------------------------------- @@ -756,13 +756,13 @@ Source: build\lib\*.*; DestDir: {app}\lib; Flags: ignoreversion recursesubdirs ; ; DLLs ; -Source: build\bin\lib*.dll; DestDir: {sys}; Flags: restartreplace confirmoverwrite sharedfile -#ifexist "build\msvcp71.dll" -Source: build\msvcp71.dll; DestDir: {sys}; Flags: restartreplace uninsneveruninstall sharedfile -#endif -#ifexist "build\msvcr71.dll" -Source: build\msvcr71.dll; DestDir: {sys}; Flags: restartreplace uninsneveruninstall sharedfile -#endif +;Source: build\bin\lib*.dll; DestDir: {sys}; Flags: restartreplace confirmoverwrite sharedfile +;#ifexist "build\msvcp71.dll" +;Source: build\msvcp71.dll; DestDir: {sys}; Flags: restartreplace uninsneveruninstall sharedfile +;#endif +;#ifexist "build\msvcr71.dll" +;Source: build\msvcr71.dll; DestDir: {sys}; Flags: restartreplace uninsneveruninstall sharedfile +;#endif ;; build stuff is not included now ;Source: build\portaudio\*.*; DestDir: {app}\portaudio; Flags: ignoreversion recursesubdirs ;Source: build\src\*.*; DestDir: {app}\src; Flags: ignoreversion recursesubdirs @@ -779,11 +779,11 @@ begin if(FileExists(ExpandConstant('{app}\unins000.exe')) AND FileExists(ExpandConstant('{app}\bin\pd.exe'))) then begin if MsgBox('Found a previous Version of Pure Data at ' + ExpandConstant('{app} ') + #13#13 'Do you want to uninstall it first? (recommended)', mbConfirmation, MB_YESNO) = idYes then begin if not Exec(ExpandConstant('{app}\unins000.exe'), '', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode) then - MsgBox('NextButtonClick:' #13#13 'The uninstall file could not be executed. ' + SysErrorMessage(ResultCode) + '.', mbError, MB_OK); + MsgBox('Error:' #13#13 'The uninstall file could not be executed. ' + SysErrorMessage(ResultCode) + '.', mbError, MB_OK); end; end; BringToFrontAndRestore(); - MsgBox('NextButtonClick:' #13#13 'The normal installation will now start.', mbInformation, MB_OK); + MsgBox('Note:' #13#13 'The installation will now start.', mbInformation, MB_OK); end; end; diff --git a/packages/win64_inno/Makefile b/packages/win64_inno/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..c95c8a7a1a50ff4c20078c050520ce34da5bb4cb --- /dev/null +++ b/packages/win64_inno/Makefile @@ -0,0 +1,237 @@ +# +# This is a grand unifying Makefile for compiling Pd-extended under MinGW +# +all: install + +export CC = gcc +CWD := $(shell pwd) + +DESTDIR = $(CWD)/build +cvs_root_dir := $(shell cd $(CWD)/../.. && pwd) +BUILDLAYOUT_DIR = $(cvs_root_dir)/packages + + +include $(BUILDLAYOUT_DIR)/Makefile.buildlayout + + +# Generic x86 (tune for Pentium III, since that's most common these days) +#OPT_CFLAGS += -mcpu=i586 -mtune=pentium3 + + +# these are sent to all of the various Makefiles so that they all copy their +# output to the same directory tree +DEST_PATHS = BUILDLAYOUT_DIR=$(BUILDLAYOUT_DIR) \ + cvs_root_dir=$(cvs_root_dir) \ + DESTDIR=$(DESTDIR) \ + prefix=$(prefix) \ + OPT_CFLAGS="$(OPT_CFLAGS)" \ + UNAME=$(UNAME) + +ifeq ($(LIGHT),yes) +PD_INNO_SETUP = pd-inno-light.iss +else +PD_INNO_SETUP = pd-inno.iss +endif + +package: $(PD_INNO_SETUP) +## this pops up the GUI app +# start $(PD_INNO_SETUP) +## this compiles the package on the command line. On 64-bit Windows +# we have to look in a different path, hence the ugly ifeq below... +ifeq (,$(wildcard /c/Program\ Files/Inno\ Setup\ 6/ISCC.exe)) + /c/Program\ Files\ \(x86\)/Inno\ Setup\ 6/ISCC.exe $(PD_INNO_SETUP) +else + /c/Program\ Files/Inno\ Setup\ 6/ISCC.exe $(PD_INNO_SETUP) +endif + @echo " " + @echo "win64_inno install succeeded!" + +git_version: $(pd_src)/src/s_version.h.in + @cd $(pd_src)/src/ && \ + sed 's|^\(#define PD_BUILD_VERSION "\).*"|\1$(PD_BUILD_VERSION)"|' s_version.h.in > s_version.h.new && \ + (test -f s_version.h && diff -q s_version.h s_version.h.new > /dev/null && rm -f s_version.h.new && echo s_version.h unchanged || (rm -f s_version.h && mv s_version.h.new s_version.h)) + +build_pd: git_version + cd $(pd_src)/src && $(MAKE) -f makefile.mingw + +pd_install: build_pd +# the autoconf/MinGW setup doesn't compile the extras yet +# $(MAKE) -C $(pd_src)/src $(DEST_PATHS) bin +# -$(MAKE) -C $(pd_src)/src $(DEST_PATHS) install + $(MAKE) -C $(pd_src)/src -f makefile.mingw $(DEST_PATHS) install + +install: pd_install prebuilt_install lib_install exe_install + @echo " " + @echo "win64_inno install succeeded!" + + +prebuilt_install: + $(MAKE) -C $(packages_src) $(DEST_PATHS) extended_install INCREMENTAL=$(INCREMENTAL) LIGHT=$(LIGHT) + $(MAKE) -C $(packages_src) $(DEST_PATHS) doc_format +ifeq ($(LIGHT),yes) + install -p pd-settings-light.reg $(DESTDIR)$(prefix)/pd-settings.reg +else + install -p pd-settings.reg $(DESTDIR)$(prefix) +endif + +#==============================================================================# +# +## setup Pd binaries +# +#==============================================================================# + +#bin_src = /usr/local/bin +bin_src = /mingw64/bin +system32 = /c/WINDOWS/system32 +lib_install: +# ultimately, the DLLs should be installed in %SystemRoot%\system32 by +# InnoSetup since they are 'officially' named and versioned DLLs, and can be +# shared between apps +# GUI port note: Pd doesn't seem to be able to find the following libs +# unless they are in $(DESTDIR)$(bindir) instead of $(DESTDIR)$(prefix). +# I figured that out by trial and error. If a Windows expert wants to figure +# out a better way to do it, that's fine-- I'm just trying to get it to build +# at all at this point... + install -d $(DESTDIR)$(prefix)/ + install -d $(DESTDIR)$(bindir) + install -p $(bin_src)/libfftw3-3.dll $(DESTDIR)$(bindir)/ + install -p $(bin_src)/libfftw3f-3.dll $(DESTDIR)$(bindir)/ + #install -p $(bin_src)/libgnurx-0.dll $(DESTDIR)$(bindir)/ + install -p $(bin_src)/libogg-0.dll $(DESTDIR)$(bindir)/ + install -p $(bin_src)/libsndfile-1.dll $(DESTDIR)$(bindir)/ + install -p $(bin_src)/libopus-0.dll $(DESTDIR)$(bindir)/ + install -p $(bin_src)/libvorbis-0.dll $(DESTDIR)$(bindir)/ + install -p $(bin_src)/libvorbisenc-2.dll $(DESTDIR)$(bindir)/ + install -p $(bin_src)/libvorbisfile-3.dll $(DESTDIR)$(bindir)/ + install -p $(bin_src)/libmp3lame-0.dll $(DESTDIR)$(bindir)/ +ifneq ($(LIGHT),yes) + # I think these two are needed for zexy/matchbox and zexy/regex + install -p $(bin_src)/libsystre-0.dll $(DESTDIR)$(bindir)/ + install -p $(bin_src)/libtre-5.dll $(DESTDIR)$(bindir)/ + # For fluid~ + install -p $(bin_src)/libfluidsynth-2.dll $(DESTDIR)$(bindir)/ + install -p $(bin_src)/SDL2.dll $(DESTDIR)$(bindir)/ + install -p $(bin_src)/libgmodule-2.0-0.dll $(DESTDIR)$(bindir)/ + install -p $(bin_src)/libreadline8.dll $(DESTDIR)$(bindir)/ + install -p $(bin_src)/libtermcap-0.dll $(DESTDIR)$(bindir)/ + # For other external libs + install -p $(bin_src)/lua53.dll $(DESTDIR)$(bindir)/ + #install -p $(bin_src)/pthreadGC2.dll $(DESTDIR)$(bindir)/ + install -p $(bin_src)/libdl.dll $(DESTDIR)$(bindir)/ + install -p $(bin_src)/libportaudio-2.dll $(DESTDIR)$(bindir)/ + install -p $(bin_src)/libFLAC-8.dll $(DESTDIR)$(bindir)/ + install -p $(bin_src)/libspeex-1.dll $(DESTDIR)$(bindir)/ + # These are for Gem + install -p $(bin_src)/libftgl-2.dll $(DESTDIR)$(bindir)/ + install -p $(bin_src)/libfreetype-6.dll $(DESTDIR)$(bindir)/ + install -p $(bin_src)/libbz2-1.dll $(DESTDIR)$(bindir)/ + install -p $(bin_src)/libharfbuzz-0.dll $(DESTDIR)$(bindir)/ + install -p $(bin_src)/libglib-2.0-0.dll $(DESTDIR)$(bindir)/ + install -p $(bin_src)/libintl-8.dll $(DESTDIR)$(bindir)/ + install -p $(bin_src)/libiconv-2.dll $(DESTDIR)$(bindir)/ + install -p $(bin_src)/libpng16-16.dll $(DESTDIR)$(bindir)/ + install -p $(bin_src)/zlib1.dll $(DESTDIR)$(bindir)/ + install -p $(bin_src)/libpcre-1.dll $(DESTDIR)$(bindir)/ + install -p $(bin_src)/libgraphite2.dll $(DESTDIR)$(bindir)/ + install -p $(bin_src)/libjpeg-8.dll $(DESTDIR)$(bindir)/ + # New: lossless compression algorithm. Gem.dll won't load without it. + # Cf.: https://github.com/bagder/libbrotli. Looks like this recently + # got added to MSYS2. Apparently Gem needs only the decoder , but we + # include the entire shebang just in case. + install -p $(bin_src)/libbrotli*.dll $(DESTDIR)$(bindir)/ + # Apparently these Gem dependencies must be in the bindir + # to be found on Windows + -install -p $(DESTDIR)/extra/Gem/gem_film*.dll $(DESTDIR)$(bindir)/ + -install -p $(DESTDIR)/extra/Gem/gem_image*.dll $(DESTDIR)$(bindir)/ + -install -p $(DESTDIR)/extra/Gem/gem_model*.dll $(DESTDIR)$(bindir)/ + -install -p $(DESTDIR)/extra/Gem/gem_record*.dll $(DESTDIR)$(bindir)/ + -install -p $(DESTDIR)/extra/Gem/gem_video*.dll $(DESTDIR)$(bindir)/ +endif +# these stay with pd.exe +# if these are installed, include them in the build root + #-install -p $(system32)/msvcp71.dll $(DESTDIR)$(bindir) + #-install -p $(system32)/msvcr71.dll $(DESTDIR)$(bindir) + #-install -p $(system32)/pthreadVC.dll $(DESTDIR)$(bindir) + install -p $(bin_src)/libwinpthread-1.dll $(DESTDIR)$(bindir) + install -p $(bin_src)/libgcc_s_seh-1.dll $(DESTDIR)$(bindir) + install -p $(bin_src)/libstdc++-6.dll $(DESTDIR)$(bindir) +ifneq ($(LIGHT),yes) +# lyonpotpourri compiles its own shared lib. On Windows it needs to be +# in the path of the pd executable in order to get loaded. (There's probably +# also a way to add the external lib's path but I don't know how to do that.) + install -p $(DESTDIR)/extra/lyonpotpourri/liblyonpotpourri.dll $(DESTDIR)$(bindir) +# fftease also uses a shared lib... + install -p $(DESTDIR)/extra/fftease/libfftease.dll $(DESTDIR)$(bindir) +endif + + +exe_install: + install -d $(DESTDIR)$(bindir) + +$(PD_INNO_SETUP): $(PD_INNO_SETUP).in + @echo "Making Inno Setup file: $(PD_INNO_SETUP)" + cat "$(PD_INNO_SETUP).in" | \ + sed 's/PACKAGE_NAME/$(PACKAGE_NAME)/g' | \ + sed 's/PD_VERSION/$(PD_VERSION)/g' | \ + sed 's/PD_BUILD_VERSION/$(PD_BUILD_VERSION)/g' > \ + $(PD_INNO_SETUP) +# in incremental builds the lib directory may not exist, in that case we need +# to edit the setup file to prevent an inno-setup error + test -d $(DESTDIR)$(libdir) || sed -i -e 's/^Source: build\\lib/;Source: build\\lib/' $(PD_INNO_SETUP) +# start $(PD_INNO_SETUP) + + +#==============================================================================# +# +## CLEAN TARGETS +# +#==============================================================================# + +distclean: package_clean + $(MAKE) -C $(packages_src) $(DEST_PATHS) distclean + + +package_clean: + -rm $(PD_INNO_SETUP) + -rm -rf $(DESTDIR) + -rm -rf Output + + +clean: package_clean + $(MAKE) -C $(packages_src) $(DEST_PATHS) clean + +#==============================================================================# +# +## TEST TARGETS +# +#==============================================================================# + +test_package: + echo "No tests here yet" + + +test_locations: + @echo -------------------------------------------------- + @echo "PD_VERSION: $(PD_VERSION)" + @echo "PD_BUILD_VERSION: $(PD_BUILD_VERSION)" + @echo "CWD $(CWD)" + @echo "DESTDIR $(DESTDIR)" + @echo "PREFIX $(prefix)" + @echo "BINDIR $(bindir)" + @echo "LIBDIR $(libdir)" + @echo "OBJECTSDIR $(objectsdir)" + @echo "PDDOCDIR $(pddocdir)" + @echo "LIBPDDIR $(libpddir)" + @echo "LIBPDBINDIR $(libpdbindir)" + @echo "HELPDIR $(helpdir)" + @echo "MANUALSDIR $(manualsdir)" + @echo "EXAMPLESDIR $(examplesdir)" + @echo -------------------------------------------------- + autoconf --version + @echo -------------------------------------------------- + make --version + @echo -------------------------------------------------- + gcc --version + + +.PHONY: all install package clean distclean test_locations test_package exe_install diff --git a/packages/win64_inno/Makefile.nmake b/packages/win64_inno/Makefile.nmake new file mode 100644 index 0000000000000000000000000000000000000000..d6e3bc032f7ad1c45290960b4bd2cbd690e31bf2 --- /dev/null +++ b/packages/win64_inno/Makefile.nmake @@ -0,0 +1,27 @@ +# ----------------------- NT ----------------------- + + +.SUFFIXES: .dll + +VC="C:\Program Files\Microsoft Visual Studio\Vc98" + +PDNTINCLUDE = /I. /I /I..\..\pd\src /I$(VC)\include + +PDNTLDIR = $(VC)\lib + + +all: +# externals + cd ..\..\externals\build\win && nmake +# flext +# non-standard paths in T. Grill's config-pd-*.txt files +# use need to edit config-pd-msvc.txt to get this to work +# cd ..\..\externals\grill\flext && nmake /f makefile.pd-msvc + + +clean: +# externals + cd ..\..\externals\build\win && nmake clean +# flext + cd ..\..\externals\grill\flext && nmake /f makefile.pd-msvc clean + diff --git a/packages/win64_inno/README.txt b/packages/win64_inno/README.txt new file mode 100644 index 0000000000000000000000000000000000000000..821f4ffb9ca1aca1eb05b07d571b4441da18a048 --- /dev/null +++ b/packages/win64_inno/README.txt @@ -0,0 +1,122 @@ + + +Check this webpage for full build instructions: +http://puredata.org/docs/developer/mingw + +------------------------------------------------------------------------------ +Software Requirements +------------------------------------------------------------------------------ + +MinGW + MinGW provides a free, complete build environment for Pd. + +Inno Setup - http://www.jrsoftware.org/isinfo.php + This package is assembled using Inno Setup, check pd.iss for details. + +ogg vorbis win32k SDK - + Install into C:\ to make it work with the current Makefile + +Tcl/Tk + Compile for MinGW. + +pthreads - ftp://sources.redhat.com/pub/pthreads-win32/ + pthreads is a standard, cross-platform threading library used in the pd + core and externals. You can use the version included with Pd. + +MinGW/gcc + Pd is free software, and can be compiled using free tools. MinGW is the + preferred way of compiling Pd on Windows. + +Microsoft Visual Studio - + You can use MS Visual Studio 6.0 or better to compile Pd and some + +------------------------------------------------------------------------------ +MinGW Makefile +------------------------------------------------------------------------------ + +See: http://puredata.org/docs/developer/windows + + +------------------------------------------------------------------------------ +Microsoft Visual Studio Makefile +------------------------------------------------------------------------------ + +You will need to do this to compile: + +nmake /f Makefile.nmake + +Currently, the Makefile.nmake only compiles the 'externals' collection. It +can also compile flext if you manually check the flext config and uncomment +things from the Makefile.nmake. + +------------------------------------------------------------------------------ +Directory Layout +------------------------------------------------------------------------------ + +This directory is for files that are used in the creation of the Windows +installer. In order to use this to compile/assemble Pd and externals. + + +-| + +-abstractions + | + +-packages-| + | +-win32_inno-| + | +-noncvs-| + | +-extra + | +-doc-| + | +-5.reference + | + +-doc-| + | +-additional + | +-pddp + | +-tutorials + | + +-externals-| + | +-... + | +-ext13 + | +-ggee + | +-maxlib + | +-unauthorized + | +-zexy + | +-... + | + +-pd-| + +-src + +-doc + +-etc... + + +The recommended way to do this is (these are probably somewhat wrong): + + mkdir pure-data && cd pure-data + setenv CVSROOT :pserver:anonymous@cvs.sourceforge.net:/cvsroot/pure-data + unzip pd source + cvs checkout packages + cvs checkout doc + cvs checkout externals + cd packages/win32_inno + make clean && make + +------------------------------------------------------------------------------ +non-CVS binaries +------------------------------------------------------------------------------ + +Binary Sources I Used (I haven't tested them all, I just downloaded them): + +cyclone: http://suita.chopin.edu.pl/~czaja/miXed/externs/cyclone.html +freeverb~: http://www.akustische-kunst.org/puredata/freeverb/index.html +iemlibs: http://iem.kug.ac.at/~musil/iemlib/ +maxlib: http://www.akustische-kunst.org/puredata/maxlib/index.html +OSC: http://barely.a.live.fm/pd/OSC/ +percolate: http://www.akustische-kunst.org/puredata/percolate/index.html +toxy: http://suita.chopin.edu.pl/~czaja/miXed/externs/toxy.html +xeq: http://suita.chopin.edu.pl/~czaja/miXed/externs/xeq.html +zexy: ftp://iem.kug.ac.at/pd/Externals/ZEXY + +all of T.Grill's code: http://www.parasitaere-kapazitaeten.net/ext/ + + + + +-Hans-Christoph Steiner <hans@at.or.at> + diff --git a/packages/win64_inno/big_cat.bmp b/packages/win64_inno/big_cat.bmp new file mode 100644 index 0000000000000000000000000000000000000000..929d12d60fa9b8ed739e70df6428c13ce62dfb88 Binary files /dev/null and b/packages/win64_inno/big_cat.bmp differ diff --git a/packages/win64_inno/pd-inno-light.iss.in b/packages/win64_inno/pd-inno-light.iss.in new file mode 100644 index 0000000000000000000000000000000000000000..f6325fc7985eeda316f9d87238f2595774a197c8 --- /dev/null +++ b/packages/win64_inno/pd-inno-light.iss.in @@ -0,0 +1,792 @@ +; +; +; This file is a template with packages/win32_inno/Makefile turns +; into a proper .iss ISTool/Inno Setup file. <hans@at.or.at> +; +; + +[Setup] +AppName=Purr Data (64-bit) +AppVerName=Purr Data PD_VERSION (64-bit) +AppPublisher=purrdata.net +AppPublisherURL=http://purrdata.net +AppSupportURL=http://puredata.org/community/lists/ +AppUpdatesURL=http://puredata.org/downloads/ +DefaultDirName={commonpf64}\Purr Data +DefaultGroupName=Purr Data (64-bit) +LicenseFile=..\gpl-3.0.txt +DisableWelcomePage=no +UninstallDisplayIcon={app}\lib\pdPatch_catGraphics.ico + +Compression=lzma/ultra +ChangesAssociations=true +OutputBaseFilename=Purr Data PD_VERSION (64-bit) +AppCopyright=GNU GPL +WizardImageFile=big_cat.bmp +WizardImageStretch=no +WizardSmallImageFile=small_cat.bmp +[Tasks] +; NOTE: The following entry contains English phrases ("Create a desktop icon" and "Additional icons"). You are free to translate them into another language if required. +Name: desktopicon; Description: Create a &desktop icon; GroupDescription: Additional icons:; Flags: unchecked +; NOTE: The following entry contains English phrases ("Create a Quick Launch icon" and "Additional icons"). You are free to translate them into another language if required. +Name: quicklaunchicon; Description: Create a &Quick Launch icon; GroupDescription: Additional icons:; Flags: unchecked +Name: fileassociations; Description: Reset File Associations +Name: libs; Description: Reset Libraries and Paths + +[INI] +Filename: {app}\pd.url; Section: InternetShortcut; Key: URL; String: http://purrdata.net +Filename: {app}\asio4all.url; Section: InternetShortcut; Key: URL; String: http://asio4all.com +Filename: {app}\puredata.url; Section: InternetShortcut; Key: URL; String: http://en.flossmanuals.net/puredata +Filename: {app}\techniques.url; Section: InternetShortcut; Key: URL; String: http://crca.ucsd.edu/~msp/techniques.htm +Filename: {app}\pd-tutorial.url; Section: InternetShortcut; Key: URL; String: http://www.pd-tutorial.com/ + +[Icons] +Name: {group}\Purr-Data; Filename: {app}\bin\pd.exe; IconFilename: {app}\lib\pd.ico; IconIndex: 0; WorkingDir: {app} +Name: {group}\puredata.org; Filename: {app}\pd.url +Name: {group}\ASIO4ALL; Filename: {app}\asio4all.url +Name: {group}\Uninstall Purr-Data; Filename: {uninstallexe} +Name: {userdesktop}\Purr-Data (64-bit); Filename: {app}\bin\pd.exe; Tasks: desktopicon; IconFilename: {app}\lib\pd.ico; IconIndex: 0; WorkingDir: {app} +Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\Purr-Data; Filename: {app}\bin\pd.exe; Tasks: quicklaunchicon; WorkingDir: {app}; IconFilename: {app}\lib\pd.ico; IconIndex: 0 +Name: {group}\Documentation\Pd Manual; Filename: {app}\doc\1.manual\index.htm +Name: {group}\Documentation\Pd Drums Tutorial; Filename: {app}\doc\tutorials\footils\pddrums\pddrums.html +Name: {group}\Documentation\Pure Data FLOSSmanual; Filename: {app}\puredata.url +Name: {group}\Documentation\Programming Electronic Music in Pd; Filename: {app}\pd-tutorial.url +Name: {group}\Documentation\Theory and Techniques of Electronic Music; Filename: {app}\techniques.url + + +[Run] +; NOTE: The following entry contains an English phrase ("Launch"). You are free to translate it into another language if required. +;Filename: {app}\bin\pd.exe; Description: Launch Purr-Data; Flags: nowait postinstall skipifsilent +; failed attempt at getting this url to open after the install is complete +;Filename: rundll32 url.dll,FileProtocolHandler http://asio4all.com; Description: open ASIO4ALL website; Flags: nowait postinstall skipifsilent + +[UninstallDelete] +Type: files; Name: {app}\pd.url +Type: files; Name: {app}\asio4all.url +Type: files; Name: {app}\puredata.url +Type: files; Name: {app}\pd-tutorial.url +Type: files; Name: {app}\techniques.url + +[Registry] +Root: HKCR; SubKey: Purr.Data; ValueType: dword; ValueName: EditFlags; ValueData: $00000000; Flags: noerror uninsdeletekey; Tasks: fileassociations; Permissions: users-modify +Root: HKCR; SubKey: Purr.Data; ValueType: dword; ValueName: BrowserFlags; ValueData: $00000008; Flags: uninsdeletekey noerror; Tasks: fileassociations +Root: HKCR; SubKey: Purr.Data; ValueType: string; ValueData: Purr Data; Flags: uninsdeletekey noerror; Tasks: fileassociations +Root: HKCR; SubKey: Purr.Data\DefaultIcon; ValueType: string; ValueData: {app}\lib\pdpatch.ico,0; Flags: createvalueifdoesntexist noerror; Tasks: fileassociations +Root: HKCR; SubKey: Purr.Data\shell; ValueType: string; ValueData: open; Flags: noerror uninsdeletekey; Tasks: fileassociations +Root: HKCR; SubKey: Purr.Data\shell\open\command; ValueType: string; ValueData: """{app}\bin\pd.exe"" -listdev ""%1"""; Flags: uninsdeletekey noerror; Tasks: fileassociations +Root: HKCR; SubKey: .pd; ValueType: string; ValueData: Purr.Data; Flags: noerror uninsdeletekey; Tasks: fileassociations +Root: HKCR; SubKey: .pd; ValueType: string; ValueName: Content Type; ValueData: text/plain; Flags: noerror uninsdeletekey; Tasks: fileassociations +; +; STARTHERE: add pd-inno_registry after this comment: + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: flags; ValueData: ; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: flags; ValueData: ; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib1; ValueData: libdir; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib1; ValueData: libdir; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib2; ValueData: pddp; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib2; ValueData: pddp; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: nloadlib; ValueData: 2; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: nloadlib; ValueData: 2; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib3; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib3; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib4; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib4; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib5; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib5; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib6; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib6; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib7; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib7; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib8; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib8; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib9; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib9; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib10; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib10; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib11; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib11; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib12; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib12; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib13; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib13; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib14; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib14; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib15; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib15; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib16; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib16; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib17; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib17; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib18; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib18; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib19; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib19; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib20; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib20; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib21; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib21; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib22; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib22; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib23; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib23; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib24; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib24; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib25; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib25; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib26; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib26; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib27; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib27; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib28; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib28; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib29; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib29; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib30; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib30; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib31; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib31; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib32; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib32; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib33; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib33; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib34; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib34; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib35; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib35; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib36; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib36; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib37; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib37; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib38; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib38; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib39; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib39; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib40; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib40; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib41; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib41; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib42; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib42; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib43; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib43; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib44; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib44; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib45; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib45; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib46; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib46; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib47; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib47; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib48; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib48; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib49; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib49; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib50; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib50; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib51; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib51; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib52; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib52; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib53; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib53; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib54; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib54; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib55; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib55; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib56; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib56; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib57; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib57; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib58; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib58; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib59; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib59; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib60; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib60; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib61; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib61; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib62; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib62; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib63; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib63; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib64; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib64; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib65; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib65; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib66; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib66; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib67; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib67; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib68; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib68; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib69; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib69; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib70; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib70; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib71; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib71; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib72; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib72; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib73; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib73; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib74; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib74; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib75; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib75; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib76; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib76; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib77; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib77; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib78; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib78; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib79; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib79; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib80; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib80; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib81; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib81; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib82; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib82; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib83; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib83; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib84; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib84; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib85; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib85; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib86; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib86; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib87; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib87; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib88; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib88; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib89; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib89; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib90; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib90; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib91; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib91; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib92; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib92; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib93; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib93; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib94; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib94; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib95; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib95; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib96; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib96; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib97; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib97; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib98; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib98; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib99; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib99; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib100; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib100; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: expandsz; ValueName: path1; ValueData: %SystemRoot%/Fonts; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: expandsz; ValueName: path1; ValueData: %SystemRoot%/Fonts; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path2; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path2; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path3; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path3; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path4; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path4; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path5; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path5; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path6; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path6; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path7; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path7; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path8; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path8; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path9; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path9; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path10; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path10; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path11; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path11; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path12; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path12; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path13; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path13; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path14; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path14; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path15; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path15; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path16; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path16; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path17; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path17; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path18; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path18; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path19; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path19; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path20; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path20; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path21; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path21; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path22; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path22; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path23; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path23; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path24; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path24; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path25; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path25; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path26; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path26; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path27; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path27; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path28; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path28; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path29; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path29; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path30; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path30; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path31; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path31; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path32; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path32; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path33; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path33; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path34; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path34; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path35; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path35; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path36; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path36; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path37; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path37; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path38; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path38; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path39; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path39; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path40; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path40; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path41; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path41; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path42; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path42; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path43; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path43; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path44; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path44; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path45; Tasks: libs; Flags: uninsdeletekey +Root: HKCu; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path45; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path46; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path46; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path47; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path47; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path48; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path48; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path49; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path49; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path50; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path50; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path51; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path51; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path52; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path52; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path53; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path53; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path54; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path54; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path55; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path55; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path56; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path56; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path57; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path57; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path58; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path58; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path59; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path59; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path60; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path60; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path61; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path61; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path62; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path62; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path63; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path63; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path64; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path64; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path65; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path65; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path66; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path66; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path67; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path67; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path68; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path68; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path69; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path69; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path70; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path70; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path71; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path71; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path72; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path72; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path73; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path73; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path74; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path74; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path75; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path75; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path76; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path76; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path77; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path77; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path78; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path78; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path79; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path79; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path80; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path80; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path81; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path81; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path82; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path82; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path83; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path83; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path84; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path84; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path85; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path85; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path86; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path86; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path87; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path87; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path88; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path88; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path89; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path89; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path90; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path90; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path91; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path91; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path92; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path92; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path93; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path93; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path94; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path94; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path95; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path95; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path96; Tasks: libs; Flags: uninsdeletekey +Root: HKCu; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path96; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path97; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path97; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path98; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path98; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path99; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path99; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path100; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path100; Tasks: libs; Flags: uninsdeletekey + +; ENDHERE: add pd-inno_registry before this comment: + +[_ISTool] +Use7zip=true +OutputExeFilename=Output\PACKAGE_NAME.exe + +[Files] +; commented out lines have no files, so they give an error +; NOTE: Don't use "Flags: ignoreversion" on any shared system files +; +; +;----------------------------------------------------------------------------- +; packages\win32_inno +Source: pdpatch.ico; DestDir: {app}\lib +Source: pdPatch_catGraphics.ico; DestDir: {app}\lib +Source: pd.ico; DestDir: {app}\lib +; +; +;----------------------------------------------------------------------------- +; put pdsend and pdreceive in the System dir so that they are in the path +; +;Source: build\bin\pdsend.exe; DestDir: {sys}; Flags: confirmoverwrite promptifolder +;Source: build\bin\pdreceive.exe; DestDir: {sys}; Flags: confirmoverwrite promptifolder +; add Cyclone's cyclist.exe if it is present +;#ifexist "build\bin\cyclist.exe" +;Source: build\bin\cyclist.exe; DestDir: {sys}; Flags: confirmoverwrite promptifolder +;#endif +; +; +;----------------------------------------------------------------------------- +; MinGW Files +; these are some helpful utilities from MinGW +; +; start.exe - like Mac OS X's 'open' command, allows you to open files and +; URLs from the command line +;Source: C:\msys\1.0\bin\start.exe; DestDir: {sys}; Flags: confirmoverwrite +; +; +;----------------------------------------------------------------------------- +; DejaVu Sans Mono Font Files +; the files needed for the Pd-0.39.2-extended default font +;Source: C:\WINDOWS\Fonts\DejaVuSans.ttf; DestDir: {fonts}; Flags: onlyifdoesntexist uninsneveruninstall; FontInstall: DejaVu Sans +;Source: C:\WINDOWS\Fonts\DejaVuSans-Bold.ttf; DestDir: {fonts}; Flags: onlyifdoesntexist uninsneveruninstall; FontInstall: DejaVu Sans Bold +;Source: C:\WINDOWS\Fonts\DejaVuSans-BoldOblique.ttf; DestDir: {fonts}; Flags: onlyifdoesntexist uninsneveruninstall; FontInstall: DejaVu Sans Bold Oblique +;Source: C:\WINDOWS\Fonts\DejaVuSansMono.ttf; DestDir: {fonts}; Flags: onlyifdoesntexist uninsneveruninstall; FontInstall: DejaVu Sans Mono +;Source: C:\WINDOWS\Fonts\DejaVuSansMono-Bold.ttf; DestDir: {fonts}; Flags: onlyifdoesntexist uninsneveruninstall; FontInstall: DejaVu Sans Mono Bold +;Source: C:\WINDOWS\Fonts\DejaVuSansMono-BoldOblique.ttf; DestDir: {fonts}; Flags: onlyifdoesntexist uninsneveruninstall; FontInstall: DejaVu Sans Mono Bold Oblique +;Source: C:\WINDOWS\Fonts\DejaVuSansMono-Oblique.ttf; DestDir: {fonts}; Flags: onlyifdoesntexist uninsneveruninstall; FontInstall: DejaVu Sans Mono Oblique +;Source: C:\WINDOWS\Fonts\DejaVuSans-Oblique.ttf; DestDir: {fonts}; Flags: onlyifdoesntexist uninsneveruninstall; FontInstall: DejaVu Sans Oblique +;Source: C:\WINDOWS\Fonts\DejaVuSerif.ttf; DestDir: {fonts}; Flags: onlyifdoesntexist uninsneveruninstall; FontInstall: DejaVu Serif +;Source: C:\WINDOWS\Fonts\DejaVuSerif-Bold.ttf; DestDir: {fonts}; Flags: onlyifdoesntexist uninsneveruninstall; FontInstall: DejaVu Serif Bold +; Inconsolata font +;Source: C:\WINDOWS\Fonts\Inconsolata.otf; DestDir: {fonts}; Flags: onlyifdoesntexist uninsneveruninstall; FontInstall: Inconsolata +; +; +;----------------------------------------------------------------------------- +; build system files +; +;Source: build\doc\manuals\Pd\Welcome.html; DestDir: {app}; Flags: isreadme; Tasks: +Source: build\doc\manuals\Pd\ReadMe.html; DestDir: {app}; Flags: isreadme +;Source: build\doc\manuals\Pd\License.html; DestDir: {app}; Flags: isreadme +;Source: build\doc\manuals\Pd\Pd-LICENSE.txt; DestDir: {app}; Flags: isreadme +Source: build\pd-settings.reg; DestDir: {app}; Flags: ignoreversion +Source: build\bin\*.*; DestDir: {app}\bin; Flags: ignoreversion confirmoverwrite recursesubdirs uninsremovereadonly +Source: build\doc\*.*; DestDir: {app}\doc; Flags: ignoreversion confirmoverwrite recursesubdirs uninsremovereadonly; Attribs: readonly +Source: build\extra\*.*; DestDir: {app}\extra; Flags: ignoreversion recursesubdirs uninsremovereadonly promptifolder; Attribs: readonly +Source: build\include\*.*; DestDir: {app}\include; Flags: ignoreversion confirmoverwrite recursesubdirs uninsremovereadonly +Source: build\lib\*.*; DestDir: {app}\lib; Flags: ignoreversion recursesubdirs +; +; DLLs +; +;Source: build\bin\lib*.dll; DestDir: {sys}; Flags: restartreplace confirmoverwrite sharedfile +;#ifexist "build\msvcp71.dll" +;Source: build\msvcp71.dll; DestDir: {sys}; Flags: restartreplace uninsneveruninstall sharedfile +;#endif +;#ifexist "build\msvcr71.dll" +;Source: build\msvcr71.dll; DestDir: {sys}; Flags: restartreplace uninsneveruninstall sharedfile +;#endif +;; build stuff is not included now +;Source: build\portaudio\*.*; DestDir: {app}\portaudio; Flags: ignoreversion recursesubdirs +;Source: build\src\*.*; DestDir: {app}\src; Flags: ignoreversion recursesubdirs +;Source: build\tcl\*.*; DestDir: {app}\tcl; Flags: ignoreversion recursesubdirs + +[Code] +function NextButtonClick(CurPageID: Integer): Boolean; +var + ResultCode: Integer; +begin + case CurPageID of + wpReady: + begin + if(FileExists(ExpandConstant('{app}\unins000.exe')) AND FileExists(ExpandConstant('{app}\bin\pd.exe'))) then begin + if MsgBox('Found a previous Version of Pure Data at ' + ExpandConstant('{app} ') + #13#13 'Do you want to uninstall it first? (recommended)', mbConfirmation, MB_YESNO) = idYes then begin + if not Exec(ExpandConstant('{app}\unins000.exe'), '', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode) then + MsgBox('Error:' #13#13 'The uninstall file could not be executed. ' + SysErrorMessage(ResultCode) + '.', mbError, MB_OK); + end; + end; + BringToFrontAndRestore(); + MsgBox('Note:' #13#13 'The installation will now start.', mbInformation, MB_OK); + end; + end; + + Result := True; +end; + diff --git a/packages/win64_inno/pd-inno.iss.in b/packages/win64_inno/pd-inno.iss.in new file mode 100644 index 0000000000000000000000000000000000000000..a5fbaf0d339f79b4a62a2081a81578b73c2f12e7 --- /dev/null +++ b/packages/win64_inno/pd-inno.iss.in @@ -0,0 +1,792 @@ +; +; +; This file is a template with packages/win32_inno/Makefile turns +; into a proper .iss ISTool/Inno Setup file. <hans@at.or.at> +; +; + +[Setup] +AppName=Purr Data (64-bit) +AppVerName=Purr Data PD_VERSION (64-bit) +AppPublisher=purrdata.net +AppPublisherURL=http://purrdata.net +AppSupportURL=http://puredata.org/community/lists/ +AppUpdatesURL=http://puredata.org/downloads/ +DefaultDirName={commonpf64}\Purr Data +DefaultGroupName=Purr Data (64-bit) +LicenseFile=..\gpl-3.0.txt +DisableWelcomePage=no +UninstallDisplayIcon={app}\lib\pdPatch_catGraphics.ico + +Compression=lzma/ultra +ChangesAssociations=true +OutputBaseFilename=Purr Data PD_VERSION (64-bit) +AppCopyright=GNU GPL +WizardImageFile=big_cat.bmp +WizardImageStretch=no +WizardSmallImageFile=small_cat.bmp +[Tasks] +; NOTE: The following entry contains English phrases ("Create a desktop icon" and "Additional icons"). You are free to translate them into another language if required. +Name: desktopicon; Description: Create a &desktop icon; GroupDescription: Additional icons:; Flags: unchecked +; NOTE: The following entry contains English phrases ("Create a Quick Launch icon" and "Additional icons"). You are free to translate them into another language if required. +Name: quicklaunchicon; Description: Create a &Quick Launch icon; GroupDescription: Additional icons:; Flags: unchecked +Name: fileassociations; Description: Reset File Associations +Name: libs; Description: Reset Libraries and Paths + +[INI] +Filename: {app}\pd.url; Section: InternetShortcut; Key: URL; String: http://purrdata.net +Filename: {app}\asio4all.url; Section: InternetShortcut; Key: URL; String: http://asio4all.com +Filename: {app}\puredata.url; Section: InternetShortcut; Key: URL; String: http://en.flossmanuals.net/puredata +Filename: {app}\techniques.url; Section: InternetShortcut; Key: URL; String: http://crca.ucsd.edu/~msp/techniques.htm +Filename: {app}\pd-tutorial.url; Section: InternetShortcut; Key: URL; String: http://www.pd-tutorial.com/ + +[Icons] +Name: {group}\Purr-Data; Filename: {app}\bin\pd.exe; IconFilename: {app}\lib\pd.ico; IconIndex: 0; WorkingDir: {app} +Name: {group}\puredata.org; Filename: {app}\pd.url +Name: {group}\ASIO4ALL; Filename: {app}\asio4all.url +Name: {group}\Uninstall Purr-Data; Filename: {uninstallexe} +Name: {userdesktop}\Purr-Data (64-bit); Filename: {app}\bin\pd.exe; Tasks: desktopicon; IconFilename: {app}\lib\pd.ico; IconIndex: 0; WorkingDir: {app} +Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\Purr-Data; Filename: {app}\bin\pd.exe; Tasks: quicklaunchicon; WorkingDir: {app}; IconFilename: {app}\lib\pd.ico; IconIndex: 0 +Name: {group}\Documentation\Pd Manual; Filename: {app}\doc\1.manual\index.htm +Name: {group}\Documentation\Pd Drums Tutorial; Filename: {app}\doc\tutorials\footils\pddrums\pddrums.html +Name: {group}\Documentation\Pure Data FLOSSmanual; Filename: {app}\puredata.url +Name: {group}\Documentation\Programming Electronic Music in Pd; Filename: {app}\pd-tutorial.url +Name: {group}\Documentation\Theory and Techniques of Electronic Music; Filename: {app}\techniques.url + + +[Run] +; NOTE: The following entry contains an English phrase ("Launch"). You are free to translate it into another language if required. +;Filename: {app}\bin\pd.exe; Description: Launch Purr-Data; Flags: nowait postinstall skipifsilent +; failed attempt at getting this url to open after the install is complete +;Filename: rundll32 url.dll,FileProtocolHandler http://asio4all.com; Description: open ASIO4ALL website; Flags: nowait postinstall skipifsilent + +[UninstallDelete] +Type: files; Name: {app}\pd.url +Type: files; Name: {app}\asio4all.url +Type: files; Name: {app}\puredata.url +Type: files; Name: {app}\pd-tutorial.url +Type: files; Name: {app}\techniques.url + +[Registry] +Root: HKCR; SubKey: Purr.Data; ValueType: dword; ValueName: EditFlags; ValueData: $00000000; Flags: noerror uninsdeletekey; Tasks: fileassociations; Permissions: users-modify +Root: HKCR; SubKey: Purr.Data; ValueType: dword; ValueName: BrowserFlags; ValueData: $00000008; Flags: uninsdeletekey noerror; Tasks: fileassociations +Root: HKCR; SubKey: Purr.Data; ValueType: string; ValueData: Purr Data; Flags: uninsdeletekey noerror; Tasks: fileassociations +Root: HKCR; SubKey: Purr.Data\DefaultIcon; ValueType: string; ValueData: {app}\lib\pdpatch.ico,0; Flags: createvalueifdoesntexist noerror; Tasks: fileassociations +Root: HKCR; SubKey: Purr.Data\shell; ValueType: string; ValueData: open; Flags: noerror uninsdeletekey; Tasks: fileassociations +Root: HKCR; SubKey: Purr.Data\shell\open\command; ValueType: string; ValueData: """{app}\bin\pd.exe"" -listdev ""%1"""; Flags: uninsdeletekey noerror; Tasks: fileassociations +Root: HKCR; SubKey: .pd; ValueType: string; ValueData: Purr.Data; Flags: noerror uninsdeletekey; Tasks: fileassociations +Root: HKCR; SubKey: .pd; ValueType: string; ValueName: Content Type; ValueData: text/plain; Flags: noerror uninsdeletekey; Tasks: fileassociations +; +; STARTHERE: add pd-inno_registry after this comment: + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: flags; ValueData: ; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: flags; ValueData: ; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib1; ValueData: libdir; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib1; ValueData: libdir; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib2; ValueData: Gem; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib2; ValueData: Gem; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib3; ValueData: cyclone; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib3; ValueData: cyclone; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib4; ValueData: zexy; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib4; ValueData: zexy; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib5; ValueData: creb; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib5; ValueData: creb; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib6; ValueData: cxc; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib6; ValueData: cxc; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib7; ValueData: iemlib; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib7; ValueData: iemlib; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib8; ValueData: list-abs; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib8; ValueData: list-abs; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib9; ValueData: mapping; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib9; ValueData: mapping; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib10; ValueData: markex; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib10; ValueData: markex; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib11; ValueData: maxlib; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib11; ValueData: maxlib; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib12; ValueData: memento; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib12; ValueData: memento; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib13; ValueData: mjlib; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib13; ValueData: mjlib; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib14; ValueData: motex; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib14; ValueData: motex; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib15; ValueData: oscx; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib15; ValueData: oscx; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib16; ValueData: pddp; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib16; ValueData: pddp; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib17; ValueData: pdogg; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib17; ValueData: pdogg; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib18; ValueData: pixeltango; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib18; ValueData: pixeltango; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib19; ValueData: pmpd; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib19; ValueData: pmpd; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib20; ValueData: rradical; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib20; ValueData: rradical; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib21; ValueData: sigpack; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib21; ValueData: sigpack; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib22; ValueData: smlib; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib22; ValueData: smlib; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib23; ValueData: unauthorized; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib23; ValueData: unauthorized; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib24; ValueData: vbap; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib24; ValueData: vbap; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib25; ValueData: pan; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib25; ValueData: pan; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib26; ValueData: freeverb~; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib26; ValueData: freeverb~; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib27; ValueData: hcs; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib27; ValueData: hcs; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib28; ValueData: jmmmp; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib28; ValueData: jmmmp; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib29; ValueData: ext13; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib29; ValueData: ext13; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib30; ValueData: ggee; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib30; ValueData: ggee; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib31; ValueData: iem_anything; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib31; ValueData: iem_anything; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib32; ValueData: ekext; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib32; ValueData: ekext; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib33; ValueData: disis; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib33; ValueData: disis; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib34; ValueData: lyonpotpourri; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib34; ValueData: lyonpotpourri; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib35; ValueData: pdlua; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: loadlib35; ValueData: pdlua; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: nloadlib; ValueData: 35; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: string; ValueName: nloadlib; ValueData: 35; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib36; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib36; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib37; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib37; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib38; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib38; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib39; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib39; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib40; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib40; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib41; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib41; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib42; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib42; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib43; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib43; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib44; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib44; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib45; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib45; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib46; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib46; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib47; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib47; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib48; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib48; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib49; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib49; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib50; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib50; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib51; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib51; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib52; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib52; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib53; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib53; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib54; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib54; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib55; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib55; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib56; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib56; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib57; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib57; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib58; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib58; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib59; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib59; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib60; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib60; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib61; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib61; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib62; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib62; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib63; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib63; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib64; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib64; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib65; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib65; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib66; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib66; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib67; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib67; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib68; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib68; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib69; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib69; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib70; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib70; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib71; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib71; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib72; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib72; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib73; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib73; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib74; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib74; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib75; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib75; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib76; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib76; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib77; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib77; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib78; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib78; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib79; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib79; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib80; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib80; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib81; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib81; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib82; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib82; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib83; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib83; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib84; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib84; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib85; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib85; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib86; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib86; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib87; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib87; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib88; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib88; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib89; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib89; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib90; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib90; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib91; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib91; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib92; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib92; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib93; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib93; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib94; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib94; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib95; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib95; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib96; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib96; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib97; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib97; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib98; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib98; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib99; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib99; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib100; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: loadlib100; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: expandsz; ValueName: path1; ValueData: %SystemRoot%/Fonts; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: expandsz; ValueName: path1; ValueData: %SystemRoot%/Fonts; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path2; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path2; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path3; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path3; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path4; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path4; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path5; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path5; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path6; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path6; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path7; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path7; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path8; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path8; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path9; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path9; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path10; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path10; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path11; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path11; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path12; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path12; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path13; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path13; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path14; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path14; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path15; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path15; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path16; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path16; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path17; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path17; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path18; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path18; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path19; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path19; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path20; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path20; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path21; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path21; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path22; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path22; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path23; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path23; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path24; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path24; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path25; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path25; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path26; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path26; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path27; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path27; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path28; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path28; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path29; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path29; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path30; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path30; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path31; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path31; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path32; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path32; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path33; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path33; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path34; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path34; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path35; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path35; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path36; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path36; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path37; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path37; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path38; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path38; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path39; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path39; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path40; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path40; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path41; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path41; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path42; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path42; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path43; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path43; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path44; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path44; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path45; Tasks: libs; Flags: uninsdeletekey +Root: HKCu; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path45; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path46; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path46; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path47; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path47; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path48; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path48; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path49; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path49; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path50; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path50; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path51; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path51; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path52; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path52; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path53; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path53; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path54; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path54; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path55; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path55; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path56; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path56; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path57; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path57; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path58; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path58; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path59; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path59; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path60; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path60; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path61; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path61; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path62; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path62; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path63; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path63; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path64; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path64; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path65; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path65; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path66; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path66; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path67; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path67; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path68; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path68; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path69; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path69; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path70; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path70; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path71; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path71; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path72; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path72; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path73; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path73; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path74; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path74; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path75; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path75; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path76; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path76; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path77; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path77; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path78; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path78; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path79; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path79; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path80; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path80; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path81; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path81; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path82; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path82; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path83; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path83; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path84; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path84; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path85; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path85; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path86; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path86; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path87; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path87; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path88; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path88; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path89; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path89; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path90; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path90; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path91; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path91; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path92; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path92; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path93; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path93; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path94; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path94; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path95; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path95; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path96; Tasks: libs; Flags: uninsdeletekey +Root: HKCu; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path96; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path97; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path97; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path98; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path98; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path99; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path99; Tasks: libs; Flags: uninsdeletekey + +Root: HKLM; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path100; Tasks: libs; Flags: uninsdeletekey +Root: HKCU; SubKey: SOFTWARE\Purr-Data; ValueType: none; ValueName: path100; Tasks: libs; Flags: uninsdeletekey + +; ENDHERE: add pd-inno_registry before this comment: + +[_ISTool] +Use7zip=true +OutputExeFilename=Output\PACKAGE_NAME.exe + +[Files] +; commented out lines have no files, so they give an error +; NOTE: Don't use "Flags: ignoreversion" on any shared system files +; +; +;----------------------------------------------------------------------------- +; packages\win32_inno +Source: pdpatch.ico; DestDir: {app}\lib +Source: pdPatch_catGraphics.ico; DestDir: {app}\lib +Source: pd.ico; DestDir: {app}\lib +; +; +;----------------------------------------------------------------------------- +; put pdsend and pdreceive in the System dir so that they are in the path +; +;Source: build\bin\pdsend.exe; DestDir: {sys}; Flags: confirmoverwrite promptifolder +;Source: build\bin\pdreceive.exe; DestDir: {sys}; Flags: confirmoverwrite promptifolder +; add Cyclone's cyclist.exe if it is present +;#ifexist "build\bin\cyclist.exe" +;Source: build\bin\cyclist.exe; DestDir: {sys}; Flags: confirmoverwrite promptifolder +;#endif +; +; +;----------------------------------------------------------------------------- +; MinGW Files +; these are some helpful utilities from MinGW +; +; start.exe - like Mac OS X's 'open' command, allows you to open files and +; URLs from the command line +;Source: C:\msys\1.0\bin\start.exe; DestDir: {sys}; Flags: confirmoverwrite +; +; +;----------------------------------------------------------------------------- +; DejaVu Sans Mono Font Files +; the files needed for the Pd-0.39.2-extended default font +;Source: C:\WINDOWS\Fonts\DejaVuSans.ttf; DestDir: {fonts}; Flags: onlyifdoesntexist uninsneveruninstall; FontInstall: DejaVu Sans +;Source: C:\WINDOWS\Fonts\DejaVuSans-Bold.ttf; DestDir: {fonts}; Flags: onlyifdoesntexist uninsneveruninstall; FontInstall: DejaVu Sans Bold +;Source: C:\WINDOWS\Fonts\DejaVuSans-BoldOblique.ttf; DestDir: {fonts}; Flags: onlyifdoesntexist uninsneveruninstall; FontInstall: DejaVu Sans Bold Oblique +;Source: C:\WINDOWS\Fonts\DejaVuSansMono.ttf; DestDir: {fonts}; Flags: onlyifdoesntexist uninsneveruninstall; FontInstall: DejaVu Sans Mono +;Source: C:\WINDOWS\Fonts\DejaVuSansMono-Bold.ttf; DestDir: {fonts}; Flags: onlyifdoesntexist uninsneveruninstall; FontInstall: DejaVu Sans Mono Bold +;Source: C:\WINDOWS\Fonts\DejaVuSansMono-BoldOblique.ttf; DestDir: {fonts}; Flags: onlyifdoesntexist uninsneveruninstall; FontInstall: DejaVu Sans Mono Bold Oblique +;Source: C:\WINDOWS\Fonts\DejaVuSansMono-Oblique.ttf; DestDir: {fonts}; Flags: onlyifdoesntexist uninsneveruninstall; FontInstall: DejaVu Sans Mono Oblique +;Source: C:\WINDOWS\Fonts\DejaVuSans-Oblique.ttf; DestDir: {fonts}; Flags: onlyifdoesntexist uninsneveruninstall; FontInstall: DejaVu Sans Oblique +;Source: C:\WINDOWS\Fonts\DejaVuSerif.ttf; DestDir: {fonts}; Flags: onlyifdoesntexist uninsneveruninstall; FontInstall: DejaVu Serif +;Source: C:\WINDOWS\Fonts\DejaVuSerif-Bold.ttf; DestDir: {fonts}; Flags: onlyifdoesntexist uninsneveruninstall; FontInstall: DejaVu Serif Bold +; Inconsolata font +;Source: C:\WINDOWS\Fonts\Inconsolata.otf; DestDir: {fonts}; Flags: onlyifdoesntexist uninsneveruninstall; FontInstall: Inconsolata +; +; +;----------------------------------------------------------------------------- +; build system files +; +;Source: build\doc\manuals\Pd\Welcome.html; DestDir: {app}; Flags: isreadme; Tasks: +Source: build\doc\manuals\Pd\ReadMe.html; DestDir: {app}; Flags: isreadme +;Source: build\doc\manuals\Pd\License.html; DestDir: {app}; Flags: isreadme +;Source: build\doc\manuals\Pd\Pd-LICENSE.txt; DestDir: {app}; Flags: isreadme +Source: build\pd-settings.reg; DestDir: {app}; Flags: ignoreversion +Source: build\bin\*.*; DestDir: {app}\bin; Flags: ignoreversion confirmoverwrite recursesubdirs uninsremovereadonly +Source: build\doc\*.*; DestDir: {app}\doc; Flags: ignoreversion confirmoverwrite recursesubdirs uninsremovereadonly; Attribs: readonly +Source: build\extra\*.*; DestDir: {app}\extra; Flags: ignoreversion recursesubdirs uninsremovereadonly promptifolder; Attribs: readonly +Source: build\include\*.*; DestDir: {app}\include; Flags: ignoreversion confirmoverwrite recursesubdirs uninsremovereadonly +Source: build\lib\*.*; DestDir: {app}\lib; Flags: ignoreversion recursesubdirs +; +; DLLs +; +;Source: build\bin\lib*.dll; DestDir: {sys}; Flags: restartreplace confirmoverwrite sharedfile +;#ifexist "build\msvcp71.dll" +;Source: build\msvcp71.dll; DestDir: {sys}; Flags: restartreplace uninsneveruninstall sharedfile +;#endif +;#ifexist "build\msvcr71.dll" +;Source: build\msvcr71.dll; DestDir: {sys}; Flags: restartreplace uninsneveruninstall sharedfile +;#endif +;; build stuff is not included now +;Source: build\portaudio\*.*; DestDir: {app}\portaudio; Flags: ignoreversion recursesubdirs +;Source: build\src\*.*; DestDir: {app}\src; Flags: ignoreversion recursesubdirs +;Source: build\tcl\*.*; DestDir: {app}\tcl; Flags: ignoreversion recursesubdirs + +[Code] +function NextButtonClick(CurPageID: Integer): Boolean; +var + ResultCode: Integer; +begin + case CurPageID of + wpReady: + begin + if(FileExists(ExpandConstant('{app}\unins000.exe')) AND FileExists(ExpandConstant('{app}\bin\pd.exe'))) then begin + if MsgBox('Found a previous Version of Pure Data at ' + ExpandConstant('{app} ') + #13#13 'Do you want to uninstall it first? (recommended)', mbConfirmation, MB_YESNO) = idYes then begin + if not Exec(ExpandConstant('{app}\unins000.exe'), '', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode) then + MsgBox('Error:' #13#13 'The uninstall file could not be executed. ' + SysErrorMessage(ResultCode) + '.', mbError, MB_OK); + end; + end; + BringToFrontAndRestore(); + MsgBox('Note:' #13#13 'The installation will now start.', mbInformation, MB_OK); + end; + end; + + Result := True; +end; + diff --git a/packages/win64_inno/pd-nolibs.bat b/packages/win64_inno/pd-nolibs.bat new file mode 100644 index 0000000000000000000000000000000000000000..fdbfb0921af5dfe22145ce49dd93a379520d22bf --- /dev/null +++ b/packages/win64_inno/pd-nolibs.bat @@ -0,0 +1 @@ +"bin\pd.exe" -font 10 -listdev %1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/packages/win64_inno/pd-novideo.bat b/packages/win64_inno/pd-novideo.bat new file mode 100644 index 0000000000000000000000000000000000000000..9bff82a678d88a10bcb34cf8e44813c3bde72e0b --- /dev/null +++ b/packages/win64_inno/pd-novideo.bat @@ -0,0 +1 @@ +"bin\pd.exe" -font 10 -lib cyclone -lib OSC -lib xeq -lib xsample -listdev %1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/packages/win64_inno/pd-settings-light.reg b/packages/win64_inno/pd-settings-light.reg new file mode 100644 index 0000000000000000000000000000000000000000..b33e4ff2b9395fc4c69fcbc4472983e5dd0e4b46 --- /dev/null +++ b/packages/win64_inno/pd-settings-light.reg @@ -0,0 +1,209 @@ +Windows Registry Editor Version 5.00 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Pd-extended] +"flags"="-font-size 12" +"loadlib1"="libdir" +"loadlib2"="pddp" +"nloadlib"=2 +; delete any previous loadlib flags +"loadlib3"=- +"loadlib4"=- +"loadlib5"=- +"loadlib6"=- +"loadlib7"=- +"loadlib8"=- +"loadlib9"=- +"loadlib10"=- +"loadlib11"=- +"loadlib12"=- +"loadlib13"=- +"loadlib14"=- +"loadlib15"=- +"loadlib16"=- +"loadlib17"=- +"loadlib18"=- +"loadlib19"=- +"loadlib20"=- +"loadlib21"=- +"loadlib22"=- +"loadlib23"=- +"loadlib24"=- +"loadlib25"=- +"loadlib26"=- +"loadlib27"=- +"loadlib28"=- +"loadlib29"=- +"loadlib30"=- +"loadlib31"=- +"loadlib32"=- +"loadlib33"=- +"loadlib34"=- +"loadlib35"=- +"loadlib36"=- +"loadlib37"=- +"loadlib38"=- +"loadlib39"=- +"loadlib40"=- +"loadlib41"=- +"loadlib42"=- +"loadlib43"=- +"loadlib44"=- +"loadlib45"=- +"loadlib46"=- +"loadlib47"=- +"loadlib48"=- +"loadlib49"=- +"loadlib50"=- +"loadlib51"=- +"loadlib52"=- +"loadlib53"=- +"loadlib54"=- +"loadlib55"=- +"loadlib56"=- +"loadlib57"=- +"loadlib58"=- +"loadlib59"=- +"loadlib60"=- +"loadlib61"=- +"loadlib62"=- +"loadlib63"=- +"loadlib64"=- +"loadlib65"=- +"loadlib66"=- +"loadlib67"=- +"loadlib68"=- +"loadlib69"=- +"loadlib70"=- +"loadlib71"=- +"loadlib72"=- +"loadlib73"=- +"loadlib74"=- +"loadlib75"=- +"loadlib76"=- +"loadlib77"=- +"loadlib78"=- +"loadlib79"=- +"loadlib80"=- +"loadlib81"=- +"loadlib82"=- +"loadlib83"=- +"loadlib84"=- +"loadlib85"=- +"loadlib86"=- +"loadlib87"=- +"loadlib88"=- +"loadlib89"=- +"loadlib90"=- +"loadlib91"=- +"loadlib92"=- +"loadlib93"=- +"loadlib94"=- +"loadlib95"=- +"loadlib96"=- +"loadlib97"=- +"loadlib98"=- +"loadlib99"=- +"loadlib100"=- +"path1"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,00,2f,00,46,00,6f,00,6e,00,74,00,73,00,00,00 +"npath"=1 +; delete all existing path flags +"path2"=- +"path3"=- +"path4"=- +"path5"=- +"path6"=- +"path7"=- +"path8"=- +"path9"=- +"path10"=- +"path11"=- +"path12"=- +"path13"=- +"path14"=- +"path15"=- +"path16"=- +"path17"=- +"path18"=- +"path19"=- +"path20"=- +"path21"=- +"path22"=- +"path23"=- +"path24"=- +"path25"=- +"path26"=- +"path27"=- +"path28"=- +"path29"=- +"path30"=- +"path31"=- +"path32"=- +"path33"=- +"path34"=- +"path35"=- +"path36"=- +"path37"=- +"path38"=- +"path39"=- +"path40"=- +"path41"=- +"path42"=- +"path43"=- +"path44"=- +"path45"=- +"path46"=- +"path47"=- +"path48"=- +"path49"=- +"path50"=- +"path51"=- +"path52"=- +"path53"=- +"path54"=- +"path55"=- +"path56"=- +"path57"=- +"path58"=- +"path59"=- +"path60"=- +"path61"=- +"path62"=- +"path63"=- +"path64"=- +"path65"=- +"path66"=- +"path67"=- +"path68"=- +"path69"=- +"path70"=- +"path71"=- +"path72"=- +"path73"=- +"path74"=- +"path75"=- +"path76"=- +"path77"=- +"path78"=- +"path79"=- +"path80"=- +"path81"=- +"path82"=- +"path83"=- +"path84"=- +"path85"=- +"path86"=- +"path87"=- +"path88"=- +"path89"=- +"path90"=- +"path91"=- +"path92"=- +"path93"=- +"path94"=- +"path95"=- +"path96"=- +"path97"=- +"path98"=- +"path99"=- +"path100"=- +; delete all existing path flags diff --git a/packages/win64_inno/pd-settings.reg b/packages/win64_inno/pd-settings.reg new file mode 100644 index 0000000000000000000000000000000000000000..d4383bf893eab8518123c018c89e06967f01fd45 --- /dev/null +++ b/packages/win64_inno/pd-settings.reg @@ -0,0 +1,210 @@ +Windows Registry Editor Version 5.00 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Pd-extended] +"flags"="-font-size 12" +"loadlib1"="libdir" +"loadlib2"="Gem" +"loadlib3"="cyclone" +"loadlib4"="zexy" +"loadlib5"="creb" +"loadlib6"="cxc" +"loadlib7"="iemlib" +"loadlib8"="list-abs" +"loadlib9"="mapping" +"loadlib10"="markex" +"loadlib11"="maxlib" +"loadlib12"="memento" +"loadlib13"="mjlib" +"loadlib14"="motex" +"loadlib15"="oscx" +"loadlib16"="pddp" +"loadlib17"="pdogg" +"loadlib18"="pixeltango" +"loadlib19"="pmpd" +"loadlib20"="rradical" +"loadlib21"="sigpack" +"loadlib22"="smlib" +"loadlib23"="unauthorized" +"loadlib24"="vbap" +"loadlib25"="pan" +"loadlib26"="freeverb~" +"loadlib27"="hcs" +"loadlib28"="jmmmp" +"loadlib29"="ext13" +"loadlib30"="ggee" +"loadlib31"="iem_anything" +"loadlib32"="ekext" +"loadlib33"="hexloader" +"loadlib34"="disis" +"loadlib35"="lyonpotpourri" +"nloadlib"=35 +; delete any previous loadlib flags +"loadlib35"=- +"loadlib36"=- +"loadlib37"=- +"loadlib38"=- +"loadlib39"=- +"loadlib40"=- +"loadlib41"=- +"loadlib42"=- +"loadlib43"=- +"loadlib44"=- +"loadlib45"=- +"loadlib46"=- +"loadlib47"=- +"loadlib48"=- +"loadlib49"=- +"loadlib50"=- +"loadlib51"=- +"loadlib52"=- +"loadlib53"=- +"loadlib54"=- +"loadlib55"=- +"loadlib56"=- +"loadlib57"=- +"loadlib58"=- +"loadlib59"=- +"loadlib60"=- +"loadlib61"=- +"loadlib62"=- +"loadlib63"=- +"loadlib64"=- +"loadlib65"=- +"loadlib66"=- +"loadlib67"=- +"loadlib68"=- +"loadlib69"=- +"loadlib70"=- +"loadlib71"=- +"loadlib72"=- +"loadlib73"=- +"loadlib74"=- +"loadlib75"=- +"loadlib76"=- +"loadlib77"=- +"loadlib78"=- +"loadlib79"=- +"loadlib80"=- +"loadlib81"=- +"loadlib82"=- +"loadlib83"=- +"loadlib84"=- +"loadlib85"=- +"loadlib86"=- +"loadlib87"=- +"loadlib88"=- +"loadlib89"=- +"loadlib90"=- +"loadlib91"=- +"loadlib92"=- +"loadlib93"=- +"loadlib94"=- +"loadlib95"=- +"loadlib96"=- +"loadlib97"=- +"loadlib98"=- +"loadlib99"=- +"loadlib100"=- +"path1"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,00,2f,00,46,00,6f,00,6e,00,74,00,73,00,00,00 +"npath"=1 +; delete all existing path flags +"path2"=- +"path3"=- +"path4"=- +"path5"=- +"path6"=- +"path7"=- +"path8"=- +"path9"=- +"path10"=- +"path11"=- +"path12"=- +"path13"=- +"path14"=- +"path15"=- +"path16"=- +"path17"=- +"path18"=- +"path19"=- +"path20"=- +"path21"=- +"path22"=- +"path23"=- +"path24"=- +"path25"=- +"path26"=- +"path27"=- +"path28"=- +"path29"=- +"path30"=- +"path31"=- +"path32"=- +"path33"=- +"path34"=- +"path35"=- +"path36"=- +"path37"=- +"path38"=- +"path39"=- +"path40"=- +"path41"=- +"path42"=- +"path43"=- +"path44"=- +"path45"=- +"path46"=- +"path47"=- +"path48"=- +"path49"=- +"path50"=- +"path51"=- +"path52"=- +"path53"=- +"path54"=- +"path55"=- +"path56"=- +"path57"=- +"path58"=- +"path59"=- +"path60"=- +"path61"=- +"path62"=- +"path63"=- +"path64"=- +"path65"=- +"path66"=- +"path67"=- +"path68"=- +"path69"=- +"path70"=- +"path71"=- +"path72"=- +"path73"=- +"path74"=- +"path75"=- +"path76"=- +"path77"=- +"path78"=- +"path79"=- +"path80"=- +"path81"=- +"path82"=- +"path83"=- +"path84"=- +"path85"=- +"path86"=- +"path87"=- +"path88"=- +"path89"=- +"path90"=- +"path91"=- +"path92"=- +"path93"=- +"path94"=- +"path95"=- +"path96"=- +"path97"=- +"path98"=- +"path99"=- +"path100"=- +; delete all existing path flags diff --git a/packages/win64_inno/pd.bat b/packages/win64_inno/pd.bat new file mode 100644 index 0000000000000000000000000000000000000000..ac1ae891223c48f7265181f0f7c742c0db219d0b --- /dev/null +++ b/packages/win64_inno/pd.bat @@ -0,0 +1 @@ +"bin\pd.exe" -font 10 -path "doc\vasp" -lib cyclone -lib Gem -lib OSC -lib vasp -lib xeq -lib xsample -listdev %1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/packages/win64_inno/pd.ico b/packages/win64_inno/pd.ico new file mode 100644 index 0000000000000000000000000000000000000000..2da5c243623c9ea56b6faca91b5e687d2c4f62fb Binary files /dev/null and b/packages/win64_inno/pd.ico differ diff --git a/packages/win64_inno/pdPatch_catGraphics.ico b/packages/win64_inno/pdPatch_catGraphics.ico new file mode 100644 index 0000000000000000000000000000000000000000..04921c65cfc6b75be80f995e0094112a7cbb42c5 Binary files /dev/null and b/packages/win64_inno/pdPatch_catGraphics.ico differ diff --git a/packages/win64_inno/pdpatch.ico b/packages/win64_inno/pdpatch.ico new file mode 100644 index 0000000000000000000000000000000000000000..565a39e12331d3f8aca9035d4455e1177c919c72 Binary files /dev/null and b/packages/win64_inno/pdpatch.ico differ diff --git a/packages/win64_inno/small_cat.bmp b/packages/win64_inno/small_cat.bmp new file mode 100644 index 0000000000000000000000000000000000000000..de859a5161589e99dca858fe2a9e953acf5fa60e Binary files /dev/null and b/packages/win64_inno/small_cat.bmp differ diff --git a/pd/doc/5.reference/ab-help.pd b/pd/doc/5.reference/ab-help.pd new file mode 100755 index 0000000000000000000000000000000000000000..4e4747a0f6eb4fe97f21158210ae26aee9a6c44f --- /dev/null +++ b/pd/doc/5.reference/ab-help.pd @@ -0,0 +1,136 @@ +#N canvas 717 240 480 339 12; +#X abframe 1; +#N canvas 870 153 488 334 12; +#X obj 27 32 inlet; +#X obj 27 61 t f b b; +#X obj 27 140 expr 2*$f1*$f2+$f3; +#X obj 27 169 outlet; +#X obj 88 104 f \$1; +#X obj 150 104 f \$2; +#X obj 252 225 abinfo; +#X obj 252 254 print abinfo; +#X msg 219 188 name; +#X msg 264 188 instances; +#X msg 344 188 within; +#X obj 27 233 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 +#000000; +#X obj 27 257 f \$0; +#X obj 27 286 print; +#X text 94 61 private abstractions can have arguments...; +#X text 26 202 ... and have their own \$0; +#X obj 115 233 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc +#000000 #000000; +#X obj 115 257 ab bar; +#X floatatom 115 286 5 0 0 0 - - -, f 5; +#X text 218 98 abinfo yields the name of the abstraction \, the number +of its instances \, and the names of other private abstractions they +are contained in (if any), f 35; +#X connect 0 0 1 0; +#X connect 1 0 2 0; +#X connect 1 1 4 0; +#X connect 1 2 5 0; +#X connect 2 0 3 0; +#X connect 4 0 2 1; +#X connect 5 0 2 2; +#X connect 6 0 7 0; +#X connect 8 0 6 0; +#X connect 9 0 6 0; +#X connect 10 0 6 0; +#X connect 11 0 12 0; +#X connect 12 0 13 0; +#X connect 16 0 17 0; +#X connect 17 0 18 0; +#X abpush foo; +#N canvas 869 280 453 305 12; +#X obj 23 21 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 +#000000; +#X obj 23 45 ab bar; +#X floatatom 23 74 5 0 0 0 - - -, f 5; +#X text 81 45 <-- open "bar" and try abinfo "within"!; +#X obj 23 203 ab other_foobar; +#X text 20 233 Normally \, private abstractions such as [ab bar] above +have global scope \, so they are visible through the entire root patch +\, including all its subpatches and private abstractions., f 57; +#X text 20 109 Note that @foobar has local scope (indicated by the +"@" prefix) \, which includes all subpatches \, but doesn't cross (private) +abstraction boundaries. Thus the @foobar inside the other_foobar abstraction +below is a different @foobar than this one.; +#X connect 0 0 1 0; +#X connect 1 0 2 0; +#X abpush @foobar; +#N canvas 1023 266 454 304 12; +#X obj 44 54 f \$0; +#X obj 44 83 outlet; +#X obj 44 25 inlet; +#X obj 147 63 abinfo; +#X obj 147 92 print abinfo; +#X msg 114 26 name; +#X msg 159 26 instances; +#X msg 239 26 within; +#X connect 0 0 1 0; +#X connect 2 0 0 0; +#X connect 3 0 4 0; +#X connect 5 0 3 0; +#X connect 6 0 3 0; +#X connect 7 0 3 0; +#X abpush bar foo @foobar; +#N canvas 788 330 452 303 12; +#X obj 22 24 ab @foobar; +#X text 112 24 <-- click here; +#X abpush other_foobar @foobar; +#N canvas 950 315 452 304 12; +#X text 16 31 Note that this instance of @foobar is different from +the one in the main patch!; +#X abpush other_foobar#@foobar other_foobar; +#X abframe 0; +#X floatatom 31 12 5 0 0 0 - - -, f 5; +#X floatatom 31 70 5 0 0 0 - - -, f 5; +#X obj 31 41 ab foo 3 2; +#X obj 267 89 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 +#000000; +#X obj 267 113 abdefs; +#X obj 267 142 print defs; +#X floatatom 30 159 5 0 0 0 - - -, f 5; +#X floatatom 30 217 5 0 0 0 - - -, f 5; +#X floatatom 128 71 5 0 0 0 - - -, f 5; +#X text 127 28 ... and cloned, f 10; +#X obj 128 99 pack f f; +#X msg 128 128 \$2 \$1; +#X obj 128 187 unpack f f; +#X floatatom 128 216 5 0 0 0 - - -, f 5; +#X floatatom 195 216 5 0 0 0 - - -, f 5; +#X text 29 117 ab's can be copied..., f 11; +#X obj 30 188 ab foo 3 5; +#X text 265 13 abdefs prints the list of all private abstractions contained +in a patch \, along with their instance counts, f 27; +#X text 22 266 CAVEAT: Private abstractions are identified by their +name. In contrast to one-offs \, editing their name may create a new +(and empty) abstraction!; +#X obj 128 158 abclone foo 4 5; +#X obj 181 73 hradio 15 0 0 4 empty empty empty 0 -8 0 10 #fcfcfc #000000 +#000000 0; +#X obj 267 230 ab @foobar; +#N canvas 432 306 417 220 META 0; +#X text 13 47 LIBRARY internal; +#X text 13 1 KEYWORDS abstraction private; +#X text 13 24 DESCRIPTION creates a private abstraction; +#X text 13 70 AUTHOR Guillem Bartrina; +#X text 13 116 RELEASE_DATE 2020; +#X text 13 139 HELP_PATCH_AUTHORS Albert Gräf; +#X text 13 93 WEBSITE https://agraef.github.io/purr-data/; +#X restore 408 306 pd META; +#X text 265 174 a "local" abstraction which illustrates local scope +as well as abinfo "within"., f 27; +#X connect 0 0 2 0; +#X connect 2 0 1 0; +#X connect 3 0 4 0; +#X connect 4 0 5 0; +#X connect 6 0 16 0; +#X connect 8 0 10 0; +#X connect 10 0 11 0; +#X connect 11 0 19 0; +#X connect 12 0 13 0; +#X connect 12 1 14 0; +#X connect 16 0 7 0; +#X connect 19 0 12 0; +#X connect 20 0 10 1; diff --git a/pd/doc/5.reference/bendin-help.pd b/pd/doc/5.reference/bendin-help.pd index 846a474440a22a9b12eda1d4137aa93284a51478..db15680bedc3e86f19d11195ca5cdc7c1a3620e0 100644 --- a/pd/doc/5.reference/bendin-help.pd +++ b/pd/doc/5.reference/bendin-help.pd @@ -1,10 +1,10 @@ -#N canvas 427 32 555 619 10; +#N canvas 508 58 560 619 10; #X obj 0 595 cnv 15 552 21 empty \$0-pddp.cnv.footer empty 20 12 0 -14 -228856 -66577 0; +14 #dcdcdc #404040 0; #X obj 0 0 cnv 15 552 40 empty \$0-pddp.cnv.header bendin 3 12 0 18 --204280 -1 0; -#X obj 0 395 cnv 3 550 3 empty \$0-pddp.cnv.inlets inlets 8 12 0 13 --228856 -1 0; +#c4dcdc #000000 0; +#X obj 0 365 cnv 3 550 3 empty \$0-pddp.cnv.inlets inlets 8 12 0 13 +#dcdcdc #000000 0; #N canvas 477 282 494 344 META 0; #X text 12 105 LIBRARY internal; #X text 12 145 WEBSITE http://crca.ucsd.edu/~msp/; @@ -21,16 +21,16 @@ to conform to the PDDP template for Pd version 0.42.; #X text 12 85 OUTLET_1 float; #X text 12 165 RELEASE_DATE 1997; #X restore 500 597 pd META; -#X obj 0 430 cnv 3 550 3 empty \$0-pddp.cnv.outlets outlets 8 12 0 -13 -228856 -1 0; -#X obj 0 495 cnv 3 550 3 empty \$0-pddp.cnv.argument arguments 8 12 -0 13 -228856 -1 0; +#X obj 0 400 cnv 3 550 3 empty \$0-pddp.cnv.outlets outlets 8 12 0 +13 #dcdcdc #000000 0; +#X obj 0 465 cnv 3 550 3 empty \$0-pddp.cnv.argument arguments 8 12 +0 13 #dcdcdc #000000 0; #X obj 0 560 cnv 3 550 3 empty \$0-pddp.cnv.more_info more_info 8 12 -0 13 -228856 -1 0; -#X text 98 439 float; +0 13 #dcdcdc #000000 0; +#X text 98 409 float; #N canvas 213 167 428 456 Related_objects 0; #X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 3 12 0 -14 -204280 -1 0; +14 #c4dcdc #000000 0; #X text 7 1 [bendin] Related Objects; #X obj 75 89 ctlin; #X obj 25 116 pgmin; @@ -67,34 +67,58 @@ by Olaf Matthes); #X obj 186 365 chord; #X restore 101 597 pd Related_objects; #X obj 497 10 bendin; -#X text 98 405 (none); -#X obj 78 439 cnv 17 3 17 empty \$0-pddp.cnv.let.0 0 5 9 0 16 -228856 --162280 0; -#X obj 78 467 cnv 17 3 17 empty \$0-pddp.cnv.let.0 1 5 9 0 16 -228856 --162280 0; -#X text 98 467 float; -#X floatatom 148 171 5 0 0 0 - - -, f 5; -#X floatatom 191 171 5 0 0 0 - - -, f 5; -#X obj 148 144 bendin; -#X text 85 221 The [bendin] object reads incoming pitch bend values -and reports them. If started with no arguments it reports the channel -number through the right outlet.; -#X obj 260 144 bendin 2; -#X floatatom 260 171 5 0 0 0 - - -, f 5; -#X text 311 171 <-- pitch bend values on channel 2; +#X text 98 375 (none); +#X obj 78 409 cnv 17 3 17 empty \$0-pddp.cnv.let.0 0 5 9 0 16 #dcdcdc +#9c9c9c 0; +#X obj 78 437 cnv 17 3 17 empty \$0-pddp.cnv.let.0 1 5 9 0 16 #dcdcdc +#9c9c9c 0; +#X text 98 437 float; +#X floatatom 138 81 5 0 0 0 - - -, f 5; +#X floatatom 195 81 5 0 0 0 - - -, f 5; +#X obj 138 54 bendin; +#X obj 260 54 bendin 2; +#X floatatom 260 81 5 0 0 0 - - -, f 5; +#X text 311 81 <-- pitch bend values on channel 2; #X obj 99 564 pddp/pddplink all_about_midi_flags.pd -text all_about_midi_flags ; #X text 11 23 read incoming pitch bend values; -#X text 167 514 - (optional) a single MIDI channel number from which +#X text 167 484 - (optional) a single MIDI channel number from which to read. If the argument is present \, the [bendin] object does not show the second (right) outlet.; -#X text 168 405 - [bendin] reads directly from the MIDI port.; -#X text 168 439 - pitchbend value (a 14-bit integer).; -#X text 168 467 - MIDI channel number (available unless argument is +#X text 168 375 - [bendin] reads directly from the MIDI port.; +#X text 168 437 - MIDI channel number (available unless argument is given).; -#X text 80 514 1) float; +#X text 80 484 1) float; #X obj 4 597 pddp/pddplink all_about_help_patches.pd -text Usage Guide ; +#X floatatom 138 141 5 0 0 0 - - -, f 5; +#X floatatom 195 141 5 0 0 0 - - -, f 5; +#X floatatom 260 141 5 0 0 0 - - -, f 5; +#X obj 138 114 bendin 0 1; +#X obj 260 114 bendin 2 1; +#X text 80 531 2) float; +#X text 167 531 - (optional) flag. If nonzero \, [bendin] yields signed +output values (-8192 - 8191).; +#X text 168 409 - pitchbend value (signed range -8192 - 8191 by default). +; +#X text 37 120 unsigned values; +#X text 48 66 signed values; +#X text 7 135 (vanilla-compatible); +#X text 85 171 The [bendin] object reads incoming pitch bend values +and reports them. If invoked with no arguments (or a zero argument +meaning "omni") it reports the channel number through the right outlet. +; +#X text 85 233 CAVEAT: In pd-l2ork \, for consistency with bendout +\, bendin yields *signed* 14 bit values (-8192 - 8191) by default. +However \, for compatibility with vanilla pd \, you can also make bendin +use the *unsigned* 14 bit range (0 - 16384) by adding 1 (or any non-zero +value) as the second argument. This also becomes the default if the +-legacy-bendin option is specified on the command line. You can add +that option to the startup flags in the preferences if you need out-of-the-box +interoperability with vanilla Pd.; #X connect 16 0 14 0; #X connect 16 1 15 0; -#X connect 18 0 19 0; +#X connect 17 0 18 0; +#X connect 30 0 27 0; +#X connect 30 1 28 0; +#X connect 31 0 29 0; diff --git a/pd/doc/5.reference/bendout-help.pd b/pd/doc/5.reference/bendout-help.pd index 4960f50d19b8ff7394a8ca5a146509a70ccf1808..b4e58ea73a2affc130ba159b02b79fbe3502c9ad 100644 --- a/pd/doc/5.reference/bendout-help.pd +++ b/pd/doc/5.reference/bendout-help.pd @@ -1,10 +1,10 @@ -#N canvas 432 35 555 619 10; +#N canvas 432 38 556 623 10; #X obj 0 595 cnv 15 552 21 empty \$0-pddp.cnv.footer empty 20 12 0 -14 -228856 -66577 0; +14 #dcdcdc #404040 0; #X obj 0 0 cnv 15 552 40 empty \$0-pddp.cnv.header bendout 3 12 0 18 --204280 -1 0; +#c4dcdc #000000 0; #X obj 0 377 cnv 3 550 3 empty \$0-pddp.cnv.inlets inlets 8 12 0 13 --228856 -1 0; +#dcdcdc #000000 0; #N canvas 489 282 494 344 META 0; #X text 12 105 LIBRARY internal; #X text 12 145 WEBSITE http://crca.ucsd.edu/~msp/; @@ -22,15 +22,15 @@ to conform to the PDDP template for Pd version 0.42.; #X text 12 165 RELEASE_DATE 2009; #X restore 500 597 pd META; #X obj 0 458 cnv 3 550 3 empty \$0-pddp.cnv.outlets outlets 8 12 0 -13 -228856 -1 0; +13 #dcdcdc #000000 0; #X obj 0 486 cnv 3 550 3 empty \$0-pddp.cnv.argument arguments 8 12 -0 13 -228856 -1 0; +0 13 #dcdcdc #000000 0; #X obj 0 561 cnv 3 550 3 empty \$0-pddp.cnv.more_info more_info 8 12 -0 13 -228856 -1 0; +0 13 #dcdcdc #000000 0; #X text 98 387 float; #N canvas 204 206 441 421 Related_objects 0; #X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 3 12 0 -14 -204280 -1 0; +14 #c4dcdc #000000 0; #X text 8 2 [bendout] Related Objects; #X obj 73 80 ctlin; #X obj 216 80 pgmin; @@ -65,10 +65,10 @@ by Olaf Matthes); #X obj 22 390 pddp/helplink cyclone/midiflush; #X restore 101 598 pd Related_objects; #X text 98 462 (none); -#X obj 78 387 cnv 17 3 35 empty \$0-pddp.cnv.let.0 0 5 9 0 16 -228856 --162280 0; -#X obj 78 430 cnv 17 3 17 empty \$0-pddp.cnv.let.0 1 5 9 0 16 -228856 --162280 0; +#X obj 78 387 cnv 17 3 35 empty \$0-pddp.cnv.let.0 0 5 9 0 16 #dcdcdc +#9c9c9c 0; +#X obj 78 430 cnv 17 3 17 empty \$0-pddp.cnv.let.0 1 5 9 0 16 #dcdcdc +#9c9c9c 0; #X text 98 430 float; #X obj 99 565 pddp/pddplink all_about_midi_flags.pd -text all_about_midi_flags ; @@ -83,14 +83,14 @@ by Olaf Matthes); #X text 168 505 - (optional) the MIDI channel number to be written to. If no argument is given \, [bendout] defaults to channel 1 . The channel can be changed by sending an integer to the right inlet.; -#X text 168 387 - pitchbend value (0-127).; #X text 168 430 - MIDI channel number (defaults to channel 1).; -#X text 168 462 - [bendin] writes directly to the MIDI port.; #X text 80 505 1) float; #X obj 4 597 pddp/pddplink all_about_help_patches.pd -text Usage Guide ; #X text 98 407 list; #X text 168 407 - a list is distributed to the inlets.; +#X text 168 387 - pitchbend value (-8192 - 8191).; +#X text 168 462 - [bendout] writes directly to the MIDI port.; #X connect 15 0 17 0; #X connect 16 0 17 1; #X connect 18 0 20 0; diff --git a/pd/doc/5.reference/inlet~-help.pd b/pd/doc/5.reference/inlet~-help.pd index fd16c84f9cb243528c18569c08d7fabc610c4ee1..3407ebbd6c959ff6564d1a8c6f9cc10d73ce79d5 100644 --- a/pd/doc/5.reference/inlet~-help.pd +++ b/pd/doc/5.reference/inlet~-help.pd @@ -1,10 +1,10 @@ -#N canvas 431 34 555 619 10; +#N canvas 436 61 555 619 10; #X obj 0 595 cnv 15 552 21 empty \$0-pddp.cnv.footer empty 20 12 0 -14 -228856 -66577 0; +14 #dcdcdc #404040 0; #X obj 0 0 cnv 15 552 40 empty \$0-pddp.cnv.header inlet~ 3 12 0 18 --204280 -1 0; -#X obj 0 350 cnv 3 550 3 empty \$0-pddp.cnv.inlets inlets 8 12 0 13 --228856 -1 0; +#c4dcdc #000000 0; +#X obj 0 325 cnv 3 550 3 empty \$0-pddp.cnv.inlets inlets 8 12 0 13 +#dcdcdc #000000 0; #N canvas 486 283 494 344 META 0; #X text 12 85 LIBRARY internal; #X text 12 125 WEBSITE http://crca.ucsd.edu/~msp/; @@ -18,15 +18,15 @@ Jonathan Wilkes to conform to the PDDP template for Pd version 0.42. #X text 12 5 KEYWORDS signal nonlocal canvas_op; #X text 12 145 RELEASE_DATE 1997; #X restore 500 597 pd META; -#X obj 0 377 cnv 3 550 3 empty \$0-pddp.cnv.outlets outlets 8 12 0 -13 -228856 -1 0; -#X obj 0 459 cnv 3 550 3 empty \$0-pddp.cnv.argument arguments 8 12 -0 13 -228856 -1 0; +#X obj 0 352 cnv 3 550 3 empty \$0-pddp.cnv.outlets outlets 8 12 0 +13 #dcdcdc #000000 0; +#X obj 0 434 cnv 3 550 3 empty \$0-pddp.cnv.argument arguments 8 12 +0 13 #dcdcdc #000000 0; #X obj 0 566 cnv 3 550 3 empty \$0-pddp.cnv.more_info more_info 8 12 -0 13 -228856 -1 0; +0 13 #dcdcdc #000000 0; #N canvas 220 515 428 109 Related_objects 0; #X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 3 12 0 -14 -204280 -1 0; +14 #c4dcdc #000000 0; #X obj 22 43 inlet; #X obj 67 43 outlet; #X obj 118 43 inlet~; @@ -35,16 +35,16 @@ Jonathan Wilkes to conform to the PDDP template for Pd version 0.42. #X text 8 2 [inlet~] Related Objects; #X obj 277 43 switch~; #X restore 102 598 pd Related_objects; -#X obj 78 386 cnv 17 3 60 empty \$0-pddp.cnv.let.0 0 5 9 0 16 -228856 --162280 0; -#X obj 369 259 print~; -#X obj 369 199 sig~ 12; -#X floatatom 126 203 0 0 0 0 - - -; -#X floatatom 126 255 0 0 0 0 - - -; -#X text 96 182 messages in and out; -#X text 339 176 audio in and out; -#X obj 369 237 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; +#X obj 78 361 cnv 17 3 60 empty \$0-pddp.cnv.let.0 0 5 9 0 16 #dcdcdc +#9c9c9c 0; +#X obj 369 234 print~; +#X obj 369 174 sig~ 12; +#X floatatom 126 178 0 0 0 0 - - -; +#X floatatom 126 228 0 0 0 0 - - -; +#X text 96 157 messages in and out; +#X text 339 151 audio in and out; +#X obj 369 212 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc +#000000 #000000; #N canvas 50 247 428 293 subpatch-with-inlets-and-outlets 0; #X obj 68 68 inlet; #X text 20 38 control inlet for receiving messages; @@ -60,30 +60,30 @@ Jonathan Wilkes to conform to the PDDP template for Pd version 0.42. #X text 333 38 same for; #X text 334 57 signals.; #X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 3 12 0 -14 -204280 -1 0; +14 #c4dcdc #000000 0; #X text 8 2 [inlet~] Creating Inlets/Outlets on Subpatches; #X connect 0 0 2 0; #X connect 3 0 4 0; #X connect 6 0 7 0; #X connect 8 0 7 0; #X connect 10 0 9 0; -#X restore 126 229 pd subpatch-with-inlets-and-outlets; -#X text 98 353 (none); +#X restore 126 204 pd subpatch-with-inlets-and-outlets; +#X text 98 328 (none); #X text 11 23 signal inlet for a subpatch; #X obj 497 10 inlet~; -#X text 98 385 signal; +#X text 98 360 signal; #N canvas 61 152 428 466 up/downsampling 0; #X obj 30 396 print~; -#X obj 48 370 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 --1; +#X obj 48 370 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 +#000000; #X obj 112 396 print~; -#X obj 130 372 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; +#X obj 130 372 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc +#000000 #000000; #X obj 195 396 print~; -#X obj 213 370 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; +#X obj 213 370 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc +#000000 #000000; #N canvas 0 0 450 300 (subpatch) 0; -#X array \$0-tab 64 float 3; +#X array \$0-tab 64 float 3 black black; #A 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; #X coords 0 1 64 -1 200 140 1; @@ -91,22 +91,22 @@ Jonathan Wilkes to conform to the PDDP template for Pd version 0.42. #X obj 274 368 s \$0-tab; #X msg 274 341 const 0 \, 0 0 1; #X obj 145 233 print~; -#X obj 145 208 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; +#X obj 145 208 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc +#000000 #000000; #X obj 23 181 tabreceive~ \$0-tab; #N canvas 81 269 585 267 test-subpatch-upsampled 0; #X obj 40 17 block~ 128 1 2; #X obj 209 149 inlet~ hold; #X obj 367 153 inlet~ lin; #X obj 23 202 print~; -#X obj 41 176 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 --1; +#X obj 41 176 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 +#000000; #X obj 209 209 print~; -#X obj 227 183 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; +#X obj 227 183 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc +#000000 #000000; #X obj 366 213 print~; -#X obj 383 187 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; +#X obj 383 187 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc +#000000 #000000; #X text 42 49 Upsampling methods:; #X text 206 114 sample/hold; #X text 337 111 linear interpolation; @@ -141,7 +141,7 @@ sample rate \, as demonstrated below.) There is no corresponding choice of downsampling method - downsampling is done simply by dropping the extra samples.; #X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 3 12 0 -14 -204280 -1 0; +14 #c4dcdc #000000 0; #X text 8 2 [inlet~] Up/downsampling; #X connect 1 0 0 0; #X connect 3 0 2 0; @@ -155,25 +155,61 @@ extra samples.; #X connect 13 0 0 0; #X connect 13 1 2 0; #X connect 13 2 4 0; -#X restore 171 538 pd up/downsampling; -#X text 80 477 1) symbol atom; -#X text 98 127 The subpatch below shows how to use [inlet] \, [inlet~] +#X restore 171 513 pd up/downsampling; +#X text 80 452 1) symbol atom; +#X text 98 102 The subpatch below shows how to use [inlet] \, [inlet~] \, [outlet] \, and [outlet~] objects to get data into and out of a subpatch:; -#X text 168 477 - (optional) The word "hold" will cause sample/hold +#X text 168 452 - (optional) The word "hold" will cause sample/hold upsampling/downsampling \, and the word "lin" will cause linear upsampling/downsampling. See the subpatch below for more details:; -#X text 98 77 The [inlet~] object allows signals to be sent to a subpatch +#X text 98 62 The [inlet~] object allows signals to be sent to a subpatch from objects on the parent canvas.; #X obj 4 597 pddp/pddplink all_about_help_patches.pd -text Usage Guide ; -#X text 168 385 - the [inlet~] object outputs the signal sent to the +#X text 168 360 - the [inlet~] object outputs the signal sent to the inlet of the subpatch in which it is found. When multiple [inlet~] or [inlet] objects are in one subpatch \, their horizontal order corresponds with the inlets drawn on the containing object in the parent patch. ; +#N canvas 582 179 543 415 inlet~-forwarding 0; +#X obj 173 182 inlet~ fwd; +#X obj 106 145 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc +#000000 #000000; +#X floatatom 131 145 5 0 0 0 - - -, f 5; +#X msg 174 145 1 2 3; +#X msg 221 145 poodle 50; +#X obj 174 283 print~; +#X text 206 254 (check that audio is on); +#X obj 186 256 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc +#000000 #000000; +#X text 58 16 you can pass "fwd" as an argument to inlet~ to ask for +a second outlet that forwards messages. Float messages aren't forwarded +though - instead \, they set the signal output value in case the parent +inlet isn't connected. Messages to the inlet~ object are treated the +same as messages to the inlet on the parent.; +#X text 64 339 (note: inlet~ objects inside patches that are copied +using clone~ are always connected to incoming signals \, so a float +message to such an inlet~ has no effect.); +#X obj 240 214 print fwd; +#X connect 0 0 5 0; +#X connect 0 1 10 0; +#X connect 7 0 5 0; +#X restore 118 294 pd inlet~-forwarding; +#X obj 50 259 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 +#000000; +#X floatatom 75 259 5 0 0 0 - - -, f 5; +#X msg 118 259 1 2 3; +#X msg 165 259 poodle 50; +#X text 267 293 <= catching messages to inlet~ objects; +#X text 168 532 - the word "fwd" will allow non-signal message to be +forwarded. See [pd inlet~-forwarding] above for details.; #X connect 10 0 16 1; #X connect 11 0 16 0; #X connect 15 0 9 0; #X connect 16 0 12 0; #X connect 16 1 9 0; +#X connect 29 0 28 0; +#X connect 30 0 28 0; +#X connect 31 0 28 0; +#X connect 32 0 28 0; diff --git a/pd/doc/5.reference/log-help.pd b/pd/doc/5.reference/log-help.pd index c2cdc6bbbc667f498b12792d79284ff25feca9cd..e2de07e408de4a53c9fbbacc239a455c149062f8 100644 --- a/pd/doc/5.reference/log-help.pd +++ b/pd/doc/5.reference/log-help.pd @@ -1,9 +1,9 @@ -#N canvas 428 60 555 619 10; +#N canvas 626 70 555 619 10; #X obj 0 595 cnv 15 552 21 empty \$0-pddp.cnv.footer empty 20 12 0 14 -228856 -66577 0; #X obj 0 0 cnv 15 552 40 empty \$0-pddp.cnv.header log 3 12 0 18 -204280 -1 0; -#X obj 0 389 cnv 3 550 3 empty \$0-pddp.cnv.inlets inlets 8 12 0 13 +#X obj 0 299 cnv 3 550 3 empty \$0-pddp.cnv.inlets inlets 8 12 0 13 -228856 -1 0; #N canvas 483 285 494 344 META 0; #X text 12 105 LIBRARY internal; @@ -21,13 +21,12 @@ for Pd version 0.42.; #X text 12 85 OUTLET_0 float; #X text 12 165 RELEASE_DATE 1997; #X restore 500 597 pd META; -#X obj 0 454 cnv 3 550 3 empty \$0-pddp.cnv.outlets outlets 8 12 0 +#X obj 0 414 cnv 3 550 3 empty \$0-pddp.cnv.outlets outlets 8 12 0 13 -228856 -1 0; -#X obj 0 491 cnv 3 550 3 empty \$0-pddp.cnv.argument arguments 8 12 +#X obj 0 451 cnv 3 550 3 empty \$0-pddp.cnv.argument arguments 8 12 0 13 -228856 -1 0; #X obj 0 518 cnv 3 550 3 empty \$0-pddp.cnv.more_info more_info 8 12 0 13 -228856 -1 0; -#X text 98 495 (none); #N canvas 215 516 428 109 Related_objects 0; #X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 3 12 0 14 -204280 -1 0; @@ -45,22 +44,22 @@ for Pd version 0.42.; #X text 7 1 [log] Related Objects; #X obj 181 42 exp; #X restore 101 597 pd Related_objects; -#X obj 78 398 cnv 17 3 45 empty \$0-pddp.cnv.let.0 0 5 9 0 16 -228856 +#X obj 78 308 cnv 17 3 45 empty \$0-pddp.cnv.let.0 0 5 9 0 16 -228856 -162280 0; -#X text 98 397 float; -#X text 98 417 list; -#X text 98 462 float; -#X obj 78 463 cnv 17 3 17 empty \$0-pddp.cnv.let.0 0 5 9 0 16 -228856 +#X text 98 307 float; +#X text 98 327 list; +#X text 98 422 float; +#X obj 78 423 cnv 17 3 17 empty \$0-pddp.cnv.let.0 0 5 9 0 16 -228856 -162280 0; -#X floatatom 239 217 0 0 0 0 - - -; -#X floatatom 239 160 0 0 0 0 - - -; -#X text 94 274 [log] will output the natural logarithm (base E) of +#X floatatom 239 177 0 0 0 0 - - -; +#X floatatom 239 120 0 0 0 0 - - -; +#X text 94 234 [log] will output the natural logarithm (base E) of a number. The value of zero will produce "-1000" which represents "negative infinity".; -#X obj 239 190 log; +#X obj 239 150 log; #X obj 515 9 log; #X text 11 23 natural logarithm of a number; -#X text 168 417 - a list will be truncated \, and the first element +#X text 168 307 - a list will be truncated \, and the first element will be used as input.; #X obj 4 597 pddp/pddplink all_about_help_patches.pd -text Usage Guide ; @@ -70,5 +69,18 @@ will be used as input.; #X obj 98 548 pddp/pddplink otherbinops-help.pd; #X obj 98 568 pddp/pddplink math-help.pd; #X text 217 568 - higher math objects; -#X connect 15 0 17 0; -#X connect 17 0 14 0; +#X floatatom 282 118 5 0 0 1 base_value - -, f 5; +#X obj 33 148 log 2; +#X floatatom 33 173 5 0 0 0 - - -, f 5; +#X floatatom 33 120 5 0 0 0 - - -, f 5; +#X obj 78 358 cnv 17 3 30 empty \$0-pddp.cnv.let.0 1 5 9 0 16 -228856 +-162280 0; +#X text 98 357 float; +#X text 168 357 - set the base; +#X text 78 485 1) float; +#X text 138 485 - set the base; +#X connect 14 0 16 0; +#X connect 16 0 13 0; +#X connect 27 0 16 1; +#X connect 28 0 29 0; +#X connect 30 0 28 0; diff --git a/pd/doc/5.reference/noise~-help.pd b/pd/doc/5.reference/noise~-help.pd index 6e4c3cb2564d0c120c9e5a54e3eea3df18b3f19e..06653e9719ded7da044012f827f6d0848e9c7438 100644 --- a/pd/doc/5.reference/noise~-help.pd +++ b/pd/doc/5.reference/noise~-help.pd @@ -1,9 +1,9 @@ -#N canvas 429 34 555 619 10; +#N canvas 475 24 555 619 10; #X obj 0 595 cnv 15 552 21 empty \$0-pddp.cnv.footer empty 20 12 0 14 -228856 -66577 0; #X obj 0 0 cnv 15 552 40 empty \$0-pddp.cnv.header noise~ 3 12 0 18 -204280 -1 0; -#X obj 0 466 cnv 3 550 3 empty \$0-pddp.cnv.inlets inlets 8 12 0 13 +#X obj 0 446 cnv 3 550 3 empty \$0-pddp.cnv.inlets inlets 8 12 0 13 -228856 -1 0; #N canvas 481 283 494 344 META 0; #X text 12 105 LIBRARY internal; @@ -32,7 +32,7 @@ Wilkes revised the patch to conform to the PDDP template for Pd version #X text 8 2 [noise~] Related Objects; #X obj 22 43 random; #X restore 102 597 pd Related_objects; -#X obj 78 475 cnv 17 3 17 empty \$0-pddp.cnv.let.0 0 5 9 0 16 -228856 +#X obj 78 455 cnv 17 3 17 empty \$0-pddp.cnv.let.0 0 5 9 0 16 -228856 -162280 0; #X obj 78 512 cnv 17 3 17 empty \$0-pddp.cnv.let.0 0 5 9 0 16 -228856 -162280 0; @@ -41,18 +41,22 @@ Wilkes revised the patch to conform to the PDDP template for Pd version #X obj 218 217 noise~; #X obj 284 256 print~; #X obj 218 256 env~ 4096; -#X text 216 192 the output range is -1 to 1...; +#X text 156 322 the output range is -1 to 1...; #X obj 152 256 snapshot~; #X floatatom 152 283 0 0 0 0 - - -; #X msg 152 229 bang; #X msg 284 229 bang; -#X text 168 474 - the inlet to [noise~] is not used.; #X text 98 511 signal; #X text 11 23 uniformly distributed white noise; -#X text 98 474 (inactive); #X obj 4 597 pddp/pddplink all_about_help_patches.pd -text Usage Guide ; #X obj 480 53 pddp/dsp; +#X msg 218 169 seed 42; +#X text 278 169 provide a seed for a deterministic sequence of samples +; +#X text 98 454 seed; +#X text 168 454 - provide a seed for the random number generator. A +given seed will always output the same sequence of samples.; #X connect 13 0 14 0; #X connect 13 0 15 0; #X connect 13 0 17 0; @@ -60,3 +64,4 @@ Wilkes revised the patch to conform to the PDDP template for Pd version #X connect 17 0 18 0; #X connect 19 0 17 0; #X connect 20 0 14 0; +#X connect 25 0 13 0; diff --git a/pd/doc/5.reference/savestate-example.pd b/pd/doc/5.reference/savestate-example.pd new file mode 100644 index 0000000000000000000000000000000000000000..dc10b95c5fb167c7746026caf8b7df1007e4292c --- /dev/null +++ b/pd/doc/5.reference/savestate-example.pd @@ -0,0 +1,49 @@ +#N canvas 112 69 693 505 12; +#X obj 36 158 osc~; +#X floatatom 103 72 7 0 10000 1 frequency - -; +#X obj 37 336 outlet~; +#X floatatom 103 97 7 0 10000 1 bandwidth - -; +#X obj 109 152 max 1; +#X obj 109 178 t b f; +#X obj 37 279 *~; +#X obj 37 307 expr~ exp(-$v1*$v1); +#X obj 36 125 * 0.5; +#X obj 348 242 f; +#X obj 348 271 pack; +#X obj 288 145 savestate; +#X obj 288 316 unpack; +#X obj 103 207 / 1; +#X text 63 19 this pulse generator is used by the savestate help file. +; +#X text 80 388 This is a waveshaping pulse generator using a Gaussian +table lookup \, as described in Theory and Technique of electronic +music \, chapter 6 The controls are "F" to set fundamental frequency +\, and "BW" to set bandwidth \, both in cycles per second.; +#X text 362 145 right outlet gets bang when parent patch is saved. +In response we send 'savestate' one or more lists that will be stored +as part of the parent patch, f 35; +#X text 344 304 Left outlet returns the list or lists to the abstraction +which can use them to restore its state when it is reloaded., f 38 +; +#X text 389 237 In response \, we build and send a list of parameters +we want to save, f 34; +#X connect 0 0 6 0; +#X connect 1 0 8 0; +#X connect 1 0 9 1; +#X connect 3 0 10 1; +#X connect 3 0 13 0; +#X connect 4 0 5 0; +#X connect 5 0 13 0; +#X connect 5 1 13 1; +#X connect 6 0 7 0; +#X connect 7 0 2 0; +#X connect 8 0 0 0; +#X connect 8 0 4 0; +#X connect 9 0 10 0; +#X connect 10 0 11 0; +#X connect 11 0 12 0; +#X connect 11 1 9 0; +#X connect 12 0 1 0; +#X connect 12 1 3 0; +#X connect 13 0 6 1; +#X coords 0 -1 1 1 125 70 1 100 50; diff --git a/pd/doc/5.reference/savestate-help.pd b/pd/doc/5.reference/savestate-help.pd new file mode 100644 index 0000000000000000000000000000000000000000..83ffe822025608710d64631217b3d0b368b013d4 --- /dev/null +++ b/pd/doc/5.reference/savestate-help.pd @@ -0,0 +1,34 @@ +#N canvas 711 48 578 672 12; +#X obj 82 73 savestate-example; +#A saved 110 660; +#X text 223 71 open the abstraction at left (right- or CTRL- click +and select "open" in popup menu) to see how the savestate object is +used from within., f 46; +#X obj 82 158 savestate-example; +#A saved 221 440; +#X text 223 162 parameters for different copies of the abstraction +are saved and restored independently., f 32; +#X text 348 610 updated for Pd version 0.49.; +#X text 81 445 The abstraction may itself be modified at will without +disturbing the saved states of its copies in any calling patches \, +as long as the usage of the saved and restored lists is kept compatible. +; +#X text 80 512 Multiple savestate objects are not differentated - they +all receive all lists sent to any one of them.; +#X text 81 550 Hint: 'text' objects can be saved/restored using 'text +tolist' and 'text fromlist'.; +#X text 82 422 Abstractions within 'clone' objects are not handled. +; +#X obj 75 27 savestate; +#X text 148 26 - save and restore run-time state from within an abstraction +, f 70; +#X text 81 250 The savestate object is used inside abstractions to +save their state as they are used in a calling (parent) patch. When +the parent patch (such as this one \, which calls the "savestate-example" +abstraction) is saved \, the included savestate object sends a 'bang' +message out its right outlet \, with which the abstraction may respond +by presenting one or more 'list' messages back to the 'savestate' object. +These lists are saved as part of the calling patch. If the calling +patch is reopened later \, the lists are sent out the left outlet of +the savestate object. The abstraction can then use them to restore +its state.; diff --git a/pd/doc/5.reference/text-object-help.pd b/pd/doc/5.reference/text-object-help.pd index cf142a36179fd5a41a56d33496e69a5242db0cac..a887b3167d791dfb2f74cfc671d14df3ed9c7a06 100644 --- a/pd/doc/5.reference/text-object-help.pd +++ b/pd/doc/5.reference/text-object-help.pd @@ -1,5 +1,5 @@ #N struct text-help-struct float x float y text z; -#N canvas 976 92 622 580 12; +#N canvas 628 105 622 580 12; #X obj 131 529 list; #X obj 18 6 text; #X text 25 528 see also:; @@ -12,16 +12,16 @@ #X obj 280 217 text define; #X text 81 173 The text object's first argument sets its function: , f 30; -#N canvas 1163 93 631 733 define 0; +#N canvas 725 103 631 758 define 0; #X msg 39 141 clear; #X msg 46 167 read text-object-help.txt; #X msg 51 196 write text-object-help.txt; #X text 32 20 "text define" maintains a text object and can name it so that other objects can find it (and later should have some alternative \, anonymous way to be found).; -#X text 91 416 click to open and edit text:; -#X text 296 404 creation arguments:; -#X text 306 439 optional name; +#X text 91 456 click to open and edit text:; +#X text 296 444 creation arguments:; +#X text 306 479 optional name; #X text 77 263 (optionally you can read or write to/from a file interpreting carriage returns as separators \; this should allow reading some text file formats - like this:); @@ -29,33 +29,47 @@ file formats - like this:); #X text 257 196 write to a file; #X obj 58 228 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; -#X obj 38 531 t b p; -#X obj 38 580 text get -s text t; -#X msg 39 555 0; -#X obj 38 630 print; -#X obj 38 605 list trim; +#X obj 38 571 t b p; +#X obj 38 620 text get -s text t; +#X msg 39 595 0; +#X obj 38 670 print; +#X obj 38 645 list trim; #X text 79 222 bang to output a pointer to a scalar (struct) containing the text, f 35; -#X obj 38 440 text define -k text-help-1; +#X obj 38 480 text define -k text-help-1; #A set this is a message \; this is another 1 ... \;; #X msg 149 326 write -c /tmp/test-cr.txt; #X msg 68 354 send text-help-send; #X text 213 354 send pointer to a named receive object; #X obj 438 110 r text-help-send; #X obj 438 139 print; -#X obj 217 470 print notify-outlet; -#X text 215 498 Second outlet notifies you when text changes. As of +#X obj 217 510 print notify-outlet; +#X text 215 538 Second outlet notifies you when text changes. As of Pd 0.48 this only outputs the message "updated" when text changes \, but this might be extended to offer more information in the future. , f 42; -#X text 119 616 First outlet is pointer to a "text" scalar containing +#X text 119 656 First outlet is pointer to a "text" scalar containing the text \, which is output when the object is sent a "bang". For example \, here's machinery for printing out first line of text., f 46; #X text 107 139 clear the object's state; -#X msg 105 384 click; -#X msg 153 384 close; -#X text 201 384 open and close text window; -#X text 304 422 optional -k flag to save contents with patch; +#X msg 105 424 click; +#X msg 153 424 close; +#X text 201 424 open and close text window; +#X text 304 462 optional -k flag to save contents with patch; +#X msg 90 390 sort; +#X text 130 391 comment; +#N canvas 1071 152 647 361 sorting-text 0; +#X obj 45 126 text define text-help-sorting; +#X msg 76 89 sort; +#X msg 44 54 set zz \; yy \; 1 2 \; 1 2 3 \; 1 \; 2 \;; +#X text 63 168 Numbers come before symbols \, which are sorted alphabetically +(details such as case sensitivity (does 'b' come before 'A'?) may depend +on operating system). Shorter lines come before longer ones that match +the entire shorter lines. As a special case empty lines come before +anything else.; +#X connect 1 0 0 0; +#X connect 2 0 0 0; +#X restore 402 423 pd sorting-text; #X connect 0 0 17 0; #X connect 1 0 17 0; #X connect 2 0 17 0; @@ -72,6 +86,7 @@ the text \, which is output when the object is sent a "bang". For example #X connect 21 0 22 0; #X connect 27 0 17 0; #X connect 28 0 17 0; +#X connect 31 0 17 0; #X restore 392 217 pd define; #X obj 280 240 text get; #N canvas 885 156 859 566 get 0; diff --git a/pd/extra/fiddle~/fiddle~.c b/pd/extra/fiddle~/fiddle~.c index c11bbf6708f336bccf0bfddd6e22528146b91176..7e2fa8e7602428d3a016c3f285c28b4feb075041 100644 --- a/pd/extra/fiddle~/fiddle~.c +++ b/pd/extra/fiddle~/fiddle~.c @@ -1118,9 +1118,9 @@ int sigfiddle_doinit(t_sigfiddle *x, long npoints, long npitch, int i; if (!npeakanal && !npeakout) npeakanal = DEFNPEAK, npeakout = 0; - if (!npeakanal < 0) npeakanal = 0; + if (npeakanal < 0) npeakanal = 0; else if (npeakanal > MAXPEAK) npeakanal = MAXPEAK; - if (!npeakout < 0) npeakout = 0; + if (npeakout < 0) npeakout = 0; else if (npeakout > MAXPEAK) npeakout = MAXPEAK; if (npitch <= 0) npitch = 0; else if (npitch > MAXNPITCH) npitch = MAXNPITCH; diff --git a/pd/extra/pd~/pd~.c b/pd/extra/pd~/pd~.c index 226edffee8b05b4174792a9bab1eb50095378740..dde893908e6e21c41b1c615b64c0a27b6c7e3703 100644 --- a/pd/extra/pd~/pd~.c +++ b/pd/extra/pd~/pd~.c @@ -11,7 +11,7 @@ #include <process.h> #include <windows.h> typedef int socklen_t; -#define EADDRINUSE WSAEADDRINUSE +//#define EADDRINUSE WSAEADDRINUSE #else #include <stdio.h> #include <string.h> diff --git a/pd/nw/bookmark.svg b/pd/nw/bookmark.svg new file mode 100644 index 0000000000000000000000000000000000000000..ddc28c52f08b5dfeaf68b9e85eb319a140c37700 --- /dev/null +++ b/pd/nw/bookmark.svg @@ -0,0 +1,13 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20" viewBox="0 0 16 16"> + <defs id="defs3051"> + <style type="text/css" id="current-color-scheme"> + .ColorScheme-Text { + color:#4d4d4d; + } + </style> + </defs> + <path style="fill:currentColor;fill-opacity:1;stroke:none" + d="m4 2v12l4-1.594 4 1.594v-12h-7zm1 1h6v9.594l-3-1.188-3 1.188v-2.594z" + class="ColorScheme-Text" + /> +</svg> diff --git a/pd/nw/bookmark2.svg b/pd/nw/bookmark2.svg new file mode 100644 index 0000000000000000000000000000000000000000..4bfd3facacfb8941d06192b991d75c9514c7515f --- /dev/null +++ b/pd/nw/bookmark2.svg @@ -0,0 +1,22 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20" viewBox="0 0 16 16"> + <defs id="defs3051"> + <style type="text/css" id="current-color-scheme"> + .ColorScheme-Text { + color:#4d4d4d; + } + .ColorScheme-NegativeText { + color:#da4453; + } + </style> + </defs> + <g transform="translate(-421.71-531.79)"> + <path + style="fill:currentColor;fill-opacity:1;stroke:none" + d="m425.71 533.79v12l4-1.594v-1l-3 1.188v-9.594h6v5h1v-6h-7z" + class="ColorScheme-Text"/> +<path style="fill:currentColor;fill-opacity:1;stroke:none" + class="ColorScheme-NegativeText" + d="m431.42 540.82l-.707.707 1.793 1.793-1.793 1.793.707.707 1.793-1.793 1.793 1.793.707-.707-1.793-1.793 1.793-1.793-.707-.707-1.793 1.793z" + /> +</g> +</svg> diff --git a/pd/nw/css/c64.css b/pd/nw/css/c64.css index 62c3c54d9926626dc0ae3039d3d5b5413f16b338..0b21bfad57b978c6167d43ae9800809e56b71582 100644 --- a/pd/nw/css/c64.css +++ b/pd/nw/css/c64.css @@ -12,6 +12,17 @@ body { font-family: "DejaVu Sans Mono"; } +#hscroll:hover, #vscroll:hover { + background-color: rgba(0, 0, 0, 0.39) !important; +} +#hscroll, #vscroll { + background-color: rgba(0, 0, 0, 0.267); +} + +#hscroll, #vscroll { + cursor: -webkit-grabbing; +} + .noselect { -webkit-touch-callout: none; -webkit-user-select: none; @@ -164,7 +175,7 @@ mark.console_find_highlighted { min-width: 3ch; position: absolute; display: table-cell; - padding: 3px 2px 3px 2px; + padding: 1px 0px 3px 1.5px; /* box-shadow: inset 1px 0px 0px 1px #000; */ color: #a49aea; /* text color */ background-color: transparent; @@ -377,6 +388,18 @@ text { -webkit-animation: fizzle 0.5s linear 1; } +#console_find { + width: 100%; + height: 1em; + padding-top: 2px; + padding-left: 3px; + padding-bottom: 9px; + background: silver; + position: fixed; + bottom: 0; + left: 0; +} + #canvas_find { width: 100%; height: 1em; @@ -397,6 +420,19 @@ text { box-shadow: 7px 7px 5px black; } +/* Dialog to ask to save the patch before quitting */ +#save_before_quit { + background-color: #f3f3f3; + border:1px solid #f3f3f3; + padding: 12px; + /* margin: 12px; */ + /*box-shadow: 7px 7px 5px grey;*/ + width: 70%; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); +} + /* Search dialog */ .search_body { @@ -418,6 +454,11 @@ text { padding: 8px; } +form { + margin-left: 4px; + margin-right: 4px; +} + fieldset { color: #a49aea; background-color: #3e32a2; @@ -487,7 +528,7 @@ input[name="receive_symbol"] { } input[name="label"] { - width: 8em; + width: 9em; } input[name="font_size"] { @@ -498,6 +539,18 @@ input[name="startup_flags"] { width: 16em; } +/* All radios */ +input[type="radio"] { + position: relative; + top: 2px; +} + +/* All checkboxes */ +input[type=checkbox] { + position: relative; + top: 2px; +} + /* Canvas dialog */ div.x-scale { @@ -554,13 +607,13 @@ div.y2 { without becoming an order of magnitude more complex, do feel free... */ .prefs_tab_group { display: table; - width: 90%; + width: 100%; } /* Configure the radio buttons to hide off-screen */ .prefs_tab { position: absolute; - left:-100px; + left:-500px; top:-100px; } @@ -615,6 +668,13 @@ div.y2 { height: 78vh; } +#midi_in1, #midi_in2, #midi_in3, #midi_in4, #midi_in5, + #midi_in6, #midi_in7, #midi_in8, #midi_in9, #midi_in10, + #midi_out1, #midi_out2, #midi_out3, #midi_out4, #midi_out5, + #midi_out6, #midi_out7, #midi_out8, #midi_out9, #midi_out10 { + width: 205px; +} + .tab_settings { padding-top: 8px; color: #a49aea; @@ -634,3 +694,65 @@ input[name="rate"] { margin-bottom: -10px; padding: 30px; } + +/* used for the custom dialog titlebar */ +#titlebar { + width: 100%; + height: 20px; + margin-bottom: 4px; + -webkit-app-region: drag; + background-color: gray; + cursor: grab; +} + +#titlebar_buttons_td { + padding-right: 1px; +} + +#titlebar_title { + color: white; + position: relative; + left: 1px; + top: 1px; + background-color: gray; +} + +#titlebar_close_button { + width: 16px; + height: 16px; + background: #a2a2a2; + -webkit-app-region: no-drag; + color: #FFF; + font-size: 18px; + text-align: center; + line-height: 16px; + cursor: default; +} + +/*#titlebar_close_button:after { + position: absolute; + right: 6px; + top: 1px; + content: "\d7"; + font-size: 20px; + color: #FFF; +}*/ + +#titlebar_close_button:hover { + background: #b2b2b2; +} + +#titlebar_close_button:active { + background: #e2e2e2; +} + +input[type="color"] { + margin-bottom: 2px; +} + +.foreground_color span, +.background_color span, +.label_color span { + position: relative; + bottom: 2px; +} diff --git a/pd/nw/css/default.css b/pd/nw/css/default.css index 5abd5f15e8170544e966dc688e68a73c4c922c38..66e5e2c74389d69eb3191988ccfc4af69fb8f251 100644 --- a/pd/nw/css/default.css +++ b/pd/nw/css/default.css @@ -27,6 +27,17 @@ body { background: transparent; } +#hscroll:hover, #vscroll:hover { + background-color: rgba(0, 0, 0, 0.39) !important; +} +#hscroll, #vscroll { + background-color: rgba(0, 0, 0, 0.267); +} + +#hscroll, #vscroll { + cursor: -webkit-grabbing; +} + .noselect { -webkit-touch-callout: none; -webkit-user-select: none; @@ -189,11 +200,11 @@ mark { mark.console_find_current.console_find_highlighted, mark.console_find_current { - background: yellow; + background: #e87216; } mark.console_find_highlighted { - background: red; + background: yellow; } #console_find { @@ -279,7 +290,7 @@ mark.console_find_highlighted { min-width: 3ch; position: absolute; display: table-cell; - padding: 3px 1.5px 3px 1.5px; + padding: 1px 0px 3px 1.5px; margin-left: 1px; /* box-shadow: inset 1px 0px 0px 1px #000; */ color: black; /* text color */ @@ -316,10 +327,16 @@ p.msg::after { /* not sure what this is doing here... */ text { - // fill: red; + //fill: red; //cursor: default; } +/* used for numbox2 to highlight contents when clicked on in runmode */ +text.activated { + fill: red; + cursor: default; +} + /* not sure if this is still needed... updated the coloring just in case */ .selected_border { @@ -356,7 +373,7 @@ text { } /* gatom "activated" text (i.e., when it has the keyboard focus) */ -.atom.activated text { +.atom.activated .data { fill: red; } @@ -401,6 +418,14 @@ text { stroke: #ccc; } +.obj .border.dirty { + stroke: #ff0000; +} + +.obj .border.subdirty { + stroke: #ff8800; +} + .comment .border { fill: none; } @@ -513,7 +538,7 @@ text { stroke: #e87216; fill: #e87216; stroke-width: 5; - -webkit-animation: fizzle 0.2s ease-in 1; + -webkit-animation: fizzle 0.1s ease-in 1; } .xlet_disabled { @@ -521,12 +546,24 @@ text { fill: gray !important; } +#console_find { + width: 100%; + height: 1em; + padding-top: 2px; + padding-left: 3px; + padding-bottom: 9px; + background: silver; + position: fixed; + bottom: 0; + left: 0; +} + #canvas_find { width: 100%; height: 1em; padding-top: 2px; - padding-left: 2px; - padding-bottom: 8px; + padding-left: 3px; + padding-bottom: 9px; background: silver; position: fixed; bottom: 0; @@ -538,11 +575,11 @@ text { background-color: #f3f3f3; border:1px solid #f3f3f3; padding: 12px; - margin: 12px; + /* margin: 12px; */ /*box-shadow: 7px 7px 5px grey;*/ + width: 70%; left: 50%; top: 50%; - width: 40%; transform: translate(-50%, -50%); } @@ -563,7 +600,7 @@ dialog::backdrop { .dialog_body { font-family: "DejaVu Sans", sans-serif; font-size: 10pt; - background-color: #f3f3f3; + background: rgba(243, 243, 243, 0.941); /* #f3f3f3f0; */ } .submit_buttons { @@ -571,9 +608,14 @@ dialog::backdrop { padding: 8px; } +form { + margin-left: 4px; + margin-right: 4px; +} + fieldset { /* font-family:Georgia; */ - background-color:#f3f3f3; + background-color: rgba(243, 243, 243, 0.627); /* #f3f3f3a0; */ border-radius:3px; border:1px solid #ddd; margin-left:auto; @@ -639,7 +681,7 @@ input[name="receive_symbol"] { } input[name="label"] { - width: 8em; + width: 9em; } input[name="font_size"] { @@ -650,6 +692,18 @@ input[name="startup_flags"] { width: 16em; } +/* All radios */ +input[type="radio"] { + position: relative; + top: 2px; +} + +/* All checkboxes */ +input[type=checkbox] { + position: relative; + top: 2px; +} + /* Canvas dialog */ div.x-scale { @@ -719,13 +773,13 @@ div.y2 { without becoming an order of magnitude more complex, do feel free... */ .prefs_tab_group { display: table; - width: 90%; + width: 100%; } /* Configure the radio buttons to hide off-screen */ .prefs_tab { position: absolute; - left:-100px; + left:-500px; top:-100px; } @@ -780,6 +834,13 @@ div.y2 { height: 78vh; } +#midi_in1, #midi_in2, #midi_in3, #midi_in4, #midi_in5, + #midi_in6, #midi_in7, #midi_in8, #midi_in9, #midi_in10, + #midi_out1, #midi_out2, #midi_out3, #midi_out4, #midi_out5, + #midi_out6, #midi_out7, #midi_out8, #midi_out9, #midi_out10 { + width: 205px; +} + .tab_settings { padding-top: 8px; } @@ -798,3 +859,65 @@ input[name="rate"] { margin-bottom: -10px; padding: 30px; } + +/* used for the custom dialog titlebar */ +#titlebar { + width: 100%; + height: 20px; + margin-bottom: 4px; + -webkit-app-region: drag; + background-color: gray; + cursor: grab; +} + +#titlebar_buttons_td { + padding-right: 1px; +} + +#titlebar_title { + color: white; + position: relative; + left: 1px; + top: 1px; + background-color: gray; +} + +#titlebar_close_button { + width: 16px; + height: 16px; + background: #a2a2a2; + -webkit-app-region: no-drag; + color: #FFF; + font-size: 18px; + text-align: center; + line-height: 16px; + cursor: default; +} + +/*#titlebar_close_button:after { + position: absolute; + right: 6px; + top: 1px; + content: "\d7"; + font-size: 20px; + color: #FFF; +}*/ + +#titlebar_close_button:hover { + background: #b2b2b2; +} + +#titlebar_close_button:active { + background: #e2e2e2; +} + +input[type="color"] { + margin-bottom: 2px; +} + +.foreground_color span, +.background_color span, +.label_color span { + position: relative; + bottom: 2px; +} \ No newline at end of file diff --git a/pd/nw/css/extended.css b/pd/nw/css/extended.css index 9149fdc54d3ffc338341a1eda3dd9384cc4328ab..33acc0826c20dcca26df9cf53bee5477a5856046 100644 --- a/pd/nw/css/extended.css +++ b/pd/nw/css/extended.css @@ -12,6 +12,17 @@ body { font-family: "DejaVu Sans Mono"; } +#hscroll:hover, #vscroll:hover { + background-color: rgba(0, 0, 0, 0.39) !important; +} +#hscroll, #vscroll { + background-color: rgba(0, 0, 0, 0.267); +} + +#hscroll, #vscroll { + cursor: -webkit-grabbing; +} + .noselect { -webkit-touch-callout: none; -webkit-user-select: none; @@ -158,7 +169,7 @@ mark.console_find_highlighted { min-width: 3ch; position: absolute; display: table-cell; - padding: 3px 2px 3px 2px; + padding: 1px 0px 3px 1.5px; /* box-shadow: inset 1px 0px 0px 1px #000; */ background-color: transparent; white-space: pre-wrap; @@ -367,6 +378,18 @@ text { -webkit-animation: fizzle 0.5s linear 1; } +#console_find { + width: 100%; + height: 1em; + padding-top: 2px; + padding-left: 3px; + padding-bottom: 9px; + background: silver; + position: fixed; + bottom: 0; + left: 0; +} + #canvas_find { width: 100%; height: 1em; @@ -377,6 +400,19 @@ text { left: 0; } +/* Dialog to ask to save the patch before quitting */ +#save_before_quit { + background-color: #f3f3f3; + border:1px solid #f3f3f3; + padding: 12px; + /* margin: 12px; */ + /*box-shadow: 7px 7px 5px grey;*/ + width: 70%; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); +} + /* Search dialog */ .search_body { @@ -398,6 +434,11 @@ text { padding: 8px; } +form { + margin-left: 4px; + margin-right: 4px; +} + fieldset { background-color:#eeeeee; border-radius:3px; @@ -461,7 +502,7 @@ input[name="receive_symbol"] { } input[name="label"] { - width: 8em; + width: 9em; } input[name="font_size"] { @@ -472,6 +513,18 @@ input[name="startup_flags"] { width: 16em; } +/* All radios */ +input[type="radio"] { + position: relative; + top: 2px; +} + +/* All checkboxes */ +input[type=checkbox] { + position: relative; + top: 2px; +} + /* Canvas dialog */ div.x-scale { @@ -528,13 +581,13 @@ div.y2 { without becoming an order of magnitude more complex, do feel free... */ .prefs_tab_group { display: table; - width: 90%; + width: 100%; } /* Configure the radio buttons to hide off-screen */ .prefs_tab { position: absolute; - left:-100px; + left:-500px; top:-100px; } @@ -589,6 +642,13 @@ div.y2 { height: 78vh; } +#midi_in1, #midi_in2, #midi_in3, #midi_in4, #midi_in5, + #midi_in6, #midi_in7, #midi_in8, #midi_in9, #midi_in10, + #midi_out1, #midi_out2, #midi_out3, #midi_out4, #midi_out5, + #midi_out6, #midi_out7, #midi_out8, #midi_out9, #midi_out10 { + width: 205px; +} + .tab_settings { padding-top: 8px; } @@ -607,3 +667,65 @@ input[name="rate"] { margin-bottom: -10px; padding: 30px; } + +/* used for the custom dialog titlebar */ +#titlebar { + width: 100%; + height: 20px; + margin-bottom: 4px; + -webkit-app-region: drag; + background-color: gray; + cursor: grab; +} + +#titlebar_buttons_td { + padding-right: 1px; +} + +#titlebar_title { + color: white; + position: relative; + left: 1px; + top: 1px; + background-color: gray; +} + +#titlebar_close_button { + width: 16px; + height: 16px; + background: #a2a2a2; + -webkit-app-region: no-drag; + color: #FFF; + font-size: 18px; + text-align: center; + line-height: 16px; + cursor: default; +} + +/*#titlebar_close_button:after { + position: absolute; + right: 6px; + top: 1px; + content: "\d7"; + font-size: 20px; + color: #FFF; +}*/ + +#titlebar_close_button:hover { + background: #b2b2b2; +} + +#titlebar_close_button:active { + background: #e2e2e2; +} + +input[type="color"] { + margin-bottom: 2px; +} + +.foreground_color span, +.background_color span, +.label_color span { + position: relative; + bottom: 2px; +} diff --git a/pd/nw/css/footgun.css b/pd/nw/css/footgun.css index a24f8bfbee89d855d729e5e4d14fe9f30562aca9..04b325e9552b1470beb693eb517fb76945cf6120 100644 --- a/pd/nw/css/footgun.css +++ b/pd/nw/css/footgun.css @@ -26,6 +26,17 @@ body { font-family: "DejaVu Sans Mono"; } +#hscroll:hover, #vscroll:hover { + background-color: rgba(0, 0, 0, 0.39) !important; +} +#hscroll, #vscroll { + background-color: rgba(0, 0, 0, 0.267); +} + +#hscroll, #vscroll { + cursor: -webkit-grabbing; +} + .noselect { -webkit-touch-callout: none; -webkit-user-select: none; @@ -277,7 +288,7 @@ mark.console_find_highlighted { min-width: 3ch; position: absolute; display: table-cell; - padding: 3px 2px 3px 2px; + padding: 1px 0px 3px 1.5px; /* box-shadow: inset 1px 0px 0px 1px #000; */ color: black; /* text color */ background-color: transparent; @@ -495,6 +506,18 @@ text { -webkit-animation: fizzle 0.4s linear 1; } +#console_find { + width: 100%; + height: 1em; + padding-top: 2px; + padding-left: 3px; + padding-bottom: 9px; + background: silver; + position: fixed; + bottom: 0; + left: 0; +} + #canvas_find { width: 100%; height: 1em; @@ -516,6 +539,19 @@ text { box-shadow: 7px 7px 5px grey; } +/* Dialog to ask to save the patch before quitting */ +#save_before_quit { + background-color: #f3f3f3; + border:1px solid #f3f3f3; + padding: 12px; + /* margin: 12px; */ + /*box-shadow: 7px 7px 5px grey;*/ + width: 70%; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); +} + /* Search dialog */ .search_body { @@ -537,6 +573,11 @@ text { padding: 8px; } +form { + margin-left: 4px; + margin-right: 4px; +} + fieldset { /* font-family:Georgia; */ background-color:#f3f3f3; @@ -605,7 +646,7 @@ input[name="receive_symbol"] { } input[name="label"] { - width: 8em; + width: 9em; } input[name="font_size"] { @@ -616,6 +657,18 @@ input[name="startup_flags"] { width: 16em; } +/* All radios */ +input[type="radio"] { + position: relative; + top: 2px; +} + +/* All checkboxes */ +input[type=checkbox] { + position: relative; + top: 2px; +} + /* Canvas dialog */ div.x-scale { @@ -685,13 +738,13 @@ div.y2 { without becoming an order of magnitude more complex, do feel free... */ .prefs_tab_group { display: table; - width: 90%; + width: 100%; } /* Configure the radio buttons to hide off-screen */ .prefs_tab { position: absolute; - left:-100px; + left:-500px; top:-100px; } @@ -746,6 +799,13 @@ div.y2 { height: 78vh; } +#midi_in1, #midi_in2, #midi_in3, #midi_in4, #midi_in5, + #midi_in6, #midi_in7, #midi_in8, #midi_in9, #midi_in10, + #midi_out1, #midi_out2, #midi_out3, #midi_out4, #midi_out5, + #midi_out6, #midi_out7, #midi_out8, #midi_out9, #midi_out10 { + width: 205px; +} + .tab_settings { padding-top: 8px; } @@ -764,3 +824,65 @@ input[name="rate"] { margin-bottom: -10px; padding: 30px; } + +/* used for the custom dialog titlebar */ +#titlebar { + width: 100%; + height: 20px; + margin-bottom: 4px; + -webkit-app-region: drag; + background-color: gray; + cursor: grab; +} + +#titlebar_buttons_td { + padding-right: 1px; +} + +#titlebar_title { + color: white; + position: relative; + left: 1px; + top: 1px; + background-color: gray; +} + +#titlebar_close_button { + width: 16px; + height: 16px; + background: #a2a2a2; + -webkit-app-region: no-drag; + color: #FFF; + font-size: 18px; + text-align: center; + line-height: 16px; + cursor: default; +} + +/*#titlebar_close_button:after { + position: absolute; + right: 6px; + top: 1px; + content: "\d7"; + font-size: 20px; + color: #FFF; +}*/ + +#titlebar_close_button:hover { + background: #b2b2b2; +} + +#titlebar_close_button:active { + background: #e2e2e2; +} + +input[type="color"] { + margin-bottom: 2px; +} + +.foreground_color span, +.background_color span, +.label_color span { + position: relative; + bottom: 2px; +} diff --git a/pd/nw/css/inverted.css b/pd/nw/css/inverted.css index 8e3510bd04f062cd2e495a99e72c3c83398e4a1c..7de083e3e338d42d7e34c7253edadc8971cecd5c 100644 --- a/pd/nw/css/inverted.css +++ b/pd/nw/css/inverted.css @@ -12,6 +12,17 @@ body { font-family: "DejaVu Sans Mono"; } +#hscroll:hover, #vscroll:hover { + background-color: rgba(0, 0, 0, 0.39) !important; +} +#hscroll, #vscroll { + background-color: rgba(0, 0, 0, 0.267); +} + +#hscroll, #vscroll { + cursor: -webkit-grabbing; +} + .noselect { -webkit-touch-callout: none; -webkit-user-select: none; @@ -176,7 +187,7 @@ mark.console_find_highlighted { min-width: 3ch; position: absolute; display: table-cell; - padding: 3px 2px 3px 2px; + padding: 1px 0px 3px 1.5px; /* box-shadow: inset 1px 0px 0px 1px #000; */ color: white; /* text color */ background-color: transparent; @@ -210,6 +221,12 @@ text { //cursor: default; } +/* used for numbox2 to highlight contents when clicked on in runmode */ +text.activated { + fill: red; + cursor: default; +} + /* not sure if this is still needed */ .selected_border { stroke: blue; @@ -247,7 +264,7 @@ text { } /* gatom "activated" text (i.e., when it has the keyboard focus) */ -.atom.activated text { +.atom.activated .data { fill: red; } @@ -283,6 +300,14 @@ text { stroke: #3e3e3e; } +.obj .border.dirty { + stroke: #ff0000; +} + +.obj .border.subdirty { + stroke: #ff8800; +} + .comment .border { fill: none; } @@ -384,15 +409,29 @@ text { /* can't remember why this was tagged !important */ .xlet_selected { - stroke: blue !important; - fill: blue; - -webkit-animation: fizzle 0.5s linear 1; + stroke: #e87216; + fill: #e87216; + -webkit-animation: fizzle 0.1s ease-in 1; +} + +#console_find { + width: 100%; + height: 1em; + padding-top: 2px; + padding-left: 3px; + padding-bottom: 9px; + background: silver; + position: fixed; + bottom: 0; + left: 0; } #canvas_find { width: 100%; height: 1em; - padding: 3px; + padding-top: 2px; + padding-left: 3px; + padding-bottom: 9px; background: #444; color: #ccc; position: fixed; @@ -406,8 +445,12 @@ text { background-color: #222; border:1px solid #eee; padding: 12px; - margin: 12px; - box-shadow: 7px 7px 5px #444; + /* margin: 12px; */ + /*box-shadow: 7px 7px 5px #444;*/ + width: 70%; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); } #canvas_find_text { @@ -417,6 +460,19 @@ text { color: white; } +/* Dialog to ask to save the patch before quitting */ +#save_before_quit { + background-color: #f3f3f3; + border:1px solid #f3f3f3; + padding: 12px; + /* margin: 12px; */ + /*box-shadow: 7px 7px 5px grey;*/ + width: 70%; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); +} + /* Search dialog */ .search_body { @@ -430,7 +486,7 @@ text { .dialog_body { font-family: "DejaVu Sans", sans-serif; font-size: 10pt; - background-color: #f3f3f3; + background: rgba(243, 243, 243, 0.941); /* #f3f3f3f0; */ } .submit_buttons { @@ -438,13 +494,23 @@ text { padding: 8px; } +form { + margin-left: 4px; + margin-right: 4px; +} + fieldset { - background-color:#eeeeee; +/* font-family:Georgia; */ + background-color: rgba(243, 243, 243, 0.627); /* #f3f3f3a0; */ border-radius:3px; - border:2px solid black; + border:1px solid #ddd; margin-left:auto; margin-right:auto; - padding: 10px; + padding: 8px; +} + +legend { + font-size: 1.2em; } .hidden { @@ -501,7 +567,7 @@ input[name="receive_symbol"] { } input[name="label"] { - width: 8em; + width: 9em; } input[name="font_size"] { @@ -512,6 +578,18 @@ input[name="startup_flags"] { width: 16em; } +/* All radios */ +input[type="radio"] { + position: relative; + top: 2px; +} + +/* All checkboxes */ +input[type=checkbox] { + position: relative; + top: 2px; +} + /* Canvas dialog */ div.x-scale { @@ -568,13 +646,13 @@ div.y2 { without becoming an order of magnitude more complex, do feel free... */ .prefs_tab_group { display: table; - width: 90%; + width: 100%; } /* Configure the radio buttons to hide off-screen */ .prefs_tab { position: absolute; - left:-100px; + left:-500px; top:-100px; } @@ -629,6 +707,13 @@ div.y2 { height: 78vh; } +#midi_in1, #midi_in2, #midi_in3, #midi_in4, #midi_in5, + #midi_in6, #midi_in7, #midi_in8, #midi_in9, #midi_in10, + #midi_out1, #midi_out2, #midi_out3, #midi_out4, #midi_out5, + #midi_out6, #midi_out7, #midi_out8, #midi_out9, #midi_out10 { + width: 205px; +} + .tab_settings { padding-top: 8px; } @@ -647,3 +732,65 @@ input[name="rate"] { margin-bottom: -10px; padding: 30px; } + +/* used for the custom dialog titlebar */ +#titlebar { + width: 100%; + height: 20px; + margin-bottom: 4px; + -webkit-app-region: drag; + background-color: gray; + cursor: grab; +} + +#titlebar_buttons_td { + padding-right: 1px; +} + +#titlebar_title { + color: white; + position: relative; + left: 1px; + top: 1px; + background-color: gray; +} + +#titlebar_close_button { + width: 16px; + height: 16px; + background: #a2a2a2; + -webkit-app-region: no-drag; + color: #FFF; + font-size: 18px; + text-align: center; + line-height: 16px; + cursor: default; +} + +/*#titlebar_close_button:after { + position: absolute; + right: 6px; + top: 1px; + content: "\d7"; + font-size: 20px; + color: #FFF; +}*/ + +#titlebar_close_button:hover { + background: #b2b2b2; +} + +#titlebar_close_button:active { + background: #e2e2e2; +} + +input[type="color"] { + margin-bottom: 2px; +} + +.foreground_color span, +.background_color span, +.label_color span { + position: relative; + bottom: 2px; +} diff --git a/pd/nw/css/solarized.css b/pd/nw/css/solarized.css index 45aff43aa09cf773089ca76bb2d8aedffa2ce2e1..80e6e0d21ae39aabb0bbaf67c109d4c5aafb67a9 100644 --- a/pd/nw/css/solarized.css +++ b/pd/nw/css/solarized.css @@ -12,6 +12,17 @@ body { font-family: "DejaVu Sans Mono"; } +#hscroll:hover, #vscroll:hover { + background-color: rgba(0, 0, 0, 0.39) !important; +} +#hscroll, #vscroll { + background-color: rgba(0, 0, 0, 0.267); +} + +#hscroll, #vscroll { + cursor: -webkit-grabbing; +} + .noselect { -webkit-touch-callout: none; -webkit-user-select: none; @@ -169,7 +180,7 @@ mark.console_find_highlighted { min-width: 3ch; position: absolute; display: table-cell; - padding: 3px 2px 3px 2px; + padding: 1px 0px 3px 1.5px; /* box-shadow: inset 1px 0px 0px 1px #000; */ background-color: transparent; white-space: pre-wrap; @@ -383,6 +394,18 @@ text { -webkit-animation: fizzle 0.5s linear 1; } +#console_find { + width: 100%; + height: 1em; + padding-top: 2px; + padding-left: 3px; + padding-bottom: 9px; + background: silver; + position: fixed; + bottom: 0; + left: 0; +} + #canvas_find { width: 100%; height: 1em; @@ -403,6 +426,19 @@ text { box-shadow: 7px 7px 5px grey; } +/* Dialog to ask to save the patch before quitting */ +#save_before_quit { + background-color: #f3f3f3; + border:1px solid #f3f3f3; + padding: 12px; + /* margin: 12px; */ + /*box-shadow: 7px 7px 5px grey;*/ + width: 70%; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); +} + /* Search dialog */ .search_body { @@ -430,6 +466,11 @@ text { padding: 8px; } +form { + margin-left: 4px; + margin-right: 4px; +} + fieldset { border-radius:3px; border:2px solid #eee8d5; @@ -492,7 +533,7 @@ input[name="receive_symbol"] { } input[name="label"] { - width: 8em; + width: 9em; } input[name="font_size"] { @@ -503,6 +544,18 @@ input[name="startup_flags"] { width: 16em; } +/* All radios */ +input[type="radio"] { + position: relative; + top: 2px; +} + +/* All checkboxes */ +input[type=checkbox] { + position: relative; + top: 2px; +} + /* Canvas dialog */ div.x-scale { @@ -559,13 +612,13 @@ div.y2 { without becoming an order of magnitude more complex, do feel free... */ .prefs_tab_group { display: table; - width: 90%; + width: 100%; } /* Configure the radio buttons to hide off-screen */ .prefs_tab { position: absolute; - left:-100px; + left:-500px; top:-100px; } @@ -620,6 +673,13 @@ div.y2 { height: 78vh; } +#midi_in1, #midi_in2, #midi_in3, #midi_in4, #midi_in5, + #midi_in6, #midi_in7, #midi_in8, #midi_in9, #midi_in10, + #midi_out1, #midi_out2, #midi_out3, #midi_out4, #midi_out5, + #midi_out6, #midi_out7, #midi_out8, #midi_out9, #midi_out10 { + width: 205px; +} + .tab_settings { padding-top: 8px; } @@ -638,3 +698,65 @@ input[name="rate"] { margin-bottom: -10px; padding: 30px; } + +/* used for the custom dialog titlebar */ +#titlebar { + width: 100%; + height: 20px; + margin-bottom: 4px; + -webkit-app-region: drag; + background-color: gray; + cursor: grab; +} + +#titlebar_buttons_td { + padding-right: 1px; +} + +#titlebar_title { + color: white; + position: relative; + left: 1px; + top: 1px; + background-color: gray; +} + +#titlebar_close_button { + width: 16px; + height: 16px; + background: #a2a2a2; + -webkit-app-region: no-drag; + color: #FFF; + font-size: 18px; + text-align: center; + line-height: 16px; + cursor: default; +} + +/*#titlebar_close_button:after { + position: absolute; + right: 6px; + top: 1px; + content: "\d7"; + font-size: 20px; + color: #FFF; +}*/ + +#titlebar_close_button:hover { + background: #b2b2b2; +} + +#titlebar_close_button:active { + background: #e2e2e2; +} + +input[type="color"] { + margin-bottom: 2px; +} + +.foreground_color span, +.background_color span, +.label_color span { + position: relative; + bottom: 2px; +} diff --git a/pd/nw/css/solarized_inverted.css b/pd/nw/css/solarized_inverted.css index 834fff642ad4f11ba266b941b2d5e9714dee905f..fa7d2478954c4e985530ff6bcbd004e66395860a 100644 --- a/pd/nw/css/solarized_inverted.css +++ b/pd/nw/css/solarized_inverted.css @@ -12,6 +12,17 @@ body { font-family: "DejaVu Sans Mono"; } +#hscroll:hover, #vscroll:hover { + background-color: rgba(0, 0, 0, 0.39) !important; +} +#hscroll, #vscroll { + background-color: rgba(0, 0, 0, 0.267); +} + +#hscroll, #vscroll { + cursor: -webkit-grabbing; +} + .noselect { -webkit-touch-callout: none; -webkit-user-select: none; @@ -169,7 +180,7 @@ mark.console_find_highlighted { min-width: 3ch; position: absolute; display: table-cell; - padding: 3px 2px 3px 2px; + padding: 1px 0px 3px 1.5px; /* box-shadow: inset 1px 0px 0px 1px #000; */ background-color: transparent; white-space: pre-wrap; @@ -383,6 +394,18 @@ text { -webkit-animation: fizzle 0.5s linear 1; } +#console_find { + width: 100%; + height: 1em; + padding-top: 2px; + padding-left: 3px; + padding-bottom: 9px; + background: silver; + position: fixed; + bottom: 0; + left: 0; +} + #canvas_find { width: 100%; height: 1em; @@ -404,6 +427,19 @@ text { box-shadow: 7px 7px 5px grey; } +/* Dialog to ask to save the patch before quitting */ +#save_before_quit { + background-color: #f3f3f3; + border:1px solid #f3f3f3; + padding: 12px; + /* margin: 12px; */ + /*box-shadow: 7px 7px 5px grey;*/ + width: 70%; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); +} + /* Search dialog */ .search_body { @@ -431,6 +467,11 @@ text { padding: 8px; } +form { + margin-left: 4px; + margin-right: 4px; +} + fieldset { border-radius:3px; border:2px solid #eee8d5; @@ -493,7 +534,7 @@ input[name="receive_symbol"] { } input[name="label"] { - width: 8em; + width: 9em; } input[name="font_size"] { @@ -504,6 +545,18 @@ input[name="startup_flags"] { width: 16em; } +/* All radios */ +input[type="radio"] { + position: relative; + top: 2px; +} + +/* All checkboxes */ +input[type=checkbox] { + position: relative; + top: 2px; +} + /* Canvas dialog */ div.x-scale { @@ -560,13 +613,13 @@ div.y2 { without becoming an order of magnitude more complex, do feel free... */ .prefs_tab_group { display: table; - width: 90%; + width: 100%; } /* Configure the radio buttons to hide off-screen */ .prefs_tab { position: absolute; - left:-100px; + left:-500px; top:-100px; } @@ -621,6 +674,13 @@ div.y2 { height: 78vh; } +#midi_in1, #midi_in2, #midi_in3, #midi_in4, #midi_in5, + #midi_in6, #midi_in7, #midi_in8, #midi_in9, #midi_in10, + #midi_out1, #midi_out2, #midi_out3, #midi_out4, #midi_out5, + #midi_out6, #midi_out7, #midi_out8, #midi_out9, #midi_out10 { + width: 205px; +} + .tab_settings { padding-top: 8px; } @@ -639,3 +699,65 @@ input[name="rate"] { margin-bottom: -10px; padding: 30px; } + +/* used for the custom dialog titlebar */ +#titlebar { + width: 100%; + height: 20px; + margin-bottom: 4px; + -webkit-app-region: drag; + background-color: gray; + cursor: grab; +} + +#titlebar_buttons_td { + padding-right: 1px; +} + +#titlebar_title { + color: white; + position: relative; + left: 1px; + top: 1px; + background-color: gray; +} + +#titlebar_close_button { + width: 16px; + height: 16px; + background: #a2a2a2; + -webkit-app-region: no-drag; + color: #FFF; + font-size: 18px; + text-align: center; + line-height: 16px; + cursor: default; +} + +/*#titlebar_close_button:after { + position: absolute; + right: 6px; + top: 1px; + content: "\d7"; + font-size: 20px; + color: #FFF; +}*/ + +#titlebar_close_button:hover { + background: #b2b2b2; +} + +#titlebar_close_button:active { + background: #e2e2e2; +} + +input[type="color"] { + margin-bottom: 2px; +} + +.foreground_color span, +.background_color span, +.label_color span { + position: relative; + bottom: 2px; +} diff --git a/pd/nw/css/strongbad.css b/pd/nw/css/strongbad.css index 3251fc431bf73951e65dac358b5919790ddf93d5..9f9215a4cf5756c38cc9278d59715dd0ed9ca5fb 100644 --- a/pd/nw/css/strongbad.css +++ b/pd/nw/css/strongbad.css @@ -12,6 +12,17 @@ body { font-family: "DejaVu Sans Mono"; } +#hscroll:hover, #vscroll:hover { + background-color: rgba(0, 0, 0, 0.39) !important; +} +#hscroll, #vscroll { + background-color: rgba(0, 0, 0, 0.267); +} + +#hscroll, #vscroll { + cursor: -webkit-grabbing; +} + .noselect { -webkit-touch-callout: none; -webkit-user-select: none; @@ -166,7 +177,7 @@ mark.console_find_highlighted { min-width: 3ch; position: absolute; display: table-cell; - padding: 3px 2px 3px 2px; + padding: 1px 0px 3px 1.5px; /* box-shadow: inset 1px 0px 0px 1px #000; */ color: #4bd046; background-color: transparent; @@ -380,6 +391,18 @@ text { -webkit-animation: fizzle 0.5s linear 1; } +#console_find { + width: 100%; + height: 1em; + padding-top: 2px; + padding-left: 3px; + padding-bottom: 9px; + background: silver; + position: fixed; + bottom: 0; + left: 0; +} + #canvas_find { width: 100%; height: 1em; @@ -390,6 +413,19 @@ text { left: 0; } +/* Dialog to ask to save the patch before quitting */ +#save_before_quit { + background-color: #f3f3f3; + border:1px solid #f3f3f3; + padding: 12px; + /* margin: 12px; */ + /*box-shadow: 7px 7px 5px grey;*/ + width: 70%; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); +} + /* Search dialog */ .search_body { @@ -411,6 +447,11 @@ text { padding: 8px; } +form { + margin-left: 4px; + margin-right: 4px; +} + fieldset { background-color:#eeeeee; border-radius:3px; @@ -474,7 +515,7 @@ input[name="receive_symbol"] { } input[name="label"] { - width: 8em; + width: 9em; } input[name="font_size"] { @@ -485,6 +526,18 @@ input[name="startup_flags"] { width: 16em; } +/* All radios */ +input[type="radio"] { + position: relative; + top: 2px; +} + +/* All checkboxes */ +input[type=checkbox] { + position: relative; + top: 2px; +} + /* Canvas dialog */ div.x-scale { @@ -541,13 +594,13 @@ div.y2 { without becoming an order of magnitude more complex, do feel free... */ .prefs_tab_group { display: table; - width: 90%; + width: 100%; } /* Configure the radio buttons to hide off-screen */ .prefs_tab { position: absolute; - left:-100px; + left:-500px; top:-100px; } @@ -602,6 +655,13 @@ div.y2 { height: 78vh; } +#midi_in1, #midi_in2, #midi_in3, #midi_in4, #midi_in5, + #midi_in6, #midi_in7, #midi_in8, #midi_in9, #midi_in10, + #midi_out1, #midi_out2, #midi_out3, #midi_out4, #midi_out5, + #midi_out6, #midi_out7, #midi_out8, #midi_out9, #midi_out10 { + width: 205px; +} + .tab_settings { padding-top: 8px; } @@ -620,3 +680,65 @@ input[name="rate"] { margin-bottom: -10px; padding: 30px; } + +/* used for the custom dialog titlebar */ +#titlebar { + width: 100%; + height: 20px; + margin-bottom: 4px; + -webkit-app-region: drag; + background-color: gray; + cursor: grab; +} + +#titlebar_buttons_td { + padding-right: 1px; +} + +#titlebar_title { + color: white; + position: relative; + left: 1px; + top: 1px; + background-color: gray; +} + +#titlebar_close_button { + width: 16px; + height: 16px; + background: #a2a2a2; + -webkit-app-region: no-drag; + color: #FFF; + font-size: 18px; + text-align: center; + line-height: 16px; + cursor: default; +} + +/*#titlebar_close_button:after { + position: absolute; + right: 6px; + top: 1px; + content: "\d7"; + font-size: 20px; + color: #FFF; +}*/ + +#titlebar_close_button:hover { + background: #b2b2b2; +} + +#titlebar_close_button:active { + background: #e2e2e2; +} + +input[type="color"] { + margin-bottom: 2px; +} + +.foreground_color span, +.background_color span, +.label_color span { + position: relative; + bottom: 2px; +} diff --git a/pd/nw/css/subdued.css b/pd/nw/css/subdued.css index a0a9e3dd69f6764eacd98224834816c516d43a35..857887381f580f815ccd20b7adcfadb0e468a786 100644 --- a/pd/nw/css/subdued.css +++ b/pd/nw/css/subdued.css @@ -12,6 +12,17 @@ body { font-family: "DejaVu Sans Mono"; } +#hscroll:hover, #vscroll:hover { + background-color: rgba(0, 0, 0, 0.39) !important; +} +#hscroll, #vscroll { + background-color: rgba(0, 0, 0, 0.267); +} + +#hscroll, #vscroll { + cursor: -webkit-grabbing; +} + .noselect { -webkit-touch-callout: none; -webkit-user-select: none; @@ -166,7 +177,7 @@ mark.console_find_highlighted { min-width: 3ch; position: absolute; display: table-cell; - padding: 3px 2px 3px 2px; + padding: 1px 0px 3px 1.5px; /* box-shadow: inset 1px 0px 0px 1px #000; */ background-color: transparent; white-space: pre-wrap; @@ -374,6 +385,18 @@ text { -webkit-animation: fizzle 0.5s linear 1; } +#console_find { + width: 100%; + height: 1em; + padding-top: 2px; + padding-left: 3px; + padding-bottom: 9px; + background: silver; + position: fixed; + bottom: 0; + left: 0; +} + #canvas_find { width: 100%; height: 1em; @@ -393,6 +416,19 @@ text { box-shadow: 7px 7px 5px grey; } +/* Dialog to ask to save the patch before quitting */ +#save_before_quit { + background-color: #f3f3f3; + border:1px solid #f3f3f3; + padding: 12px; + /* margin: 12px; */ + /*box-shadow: 7px 7px 5px grey;*/ + width: 70%; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); +} + /* Search dialog */ .search_body { @@ -414,6 +450,11 @@ text { padding: 8px; } +form { + margin-left: 4px; + margin-right: 4px; +} + fieldset { background-color:#eeeeee; border-radius:3px; @@ -477,7 +518,7 @@ input[name="receive_symbol"] { } input[name="label"] { - width: 8em; + width: 9em; } input[name="font_size"] { @@ -488,6 +529,18 @@ input[name="startup_flags"] { width: 16em; } +/* All radios */ +input[type="radio"] { + position: relative; + top: 2px; +} + +/* All checkboxes */ +input[type=checkbox] { + position: relative; + top: 2px; +} + /* Canvas dialog */ div.x-scale { @@ -544,13 +597,13 @@ div.y2 { without becoming an order of magnitude more complex, do feel free... */ .prefs_tab_group { display: table; - width: 90%; + width: 100%; } /* Configure the radio buttons to hide off-screen */ .prefs_tab { position: absolute; - left:-100px; + left:-500px; top:-100px; } @@ -605,6 +658,13 @@ div.y2 { height: 78vh; } +#midi_in1, #midi_in2, #midi_in3, #midi_in4, #midi_in5, + #midi_in6, #midi_in7, #midi_in8, #midi_in9, #midi_in10, + #midi_out1, #midi_out2, #midi_out3, #midi_out4, #midi_out5, + #midi_out6, #midi_out7, #midi_out8, #midi_out9, #midi_out10 { + width: 205px; +} + .tab_settings { padding-top: 8px; } @@ -623,3 +683,65 @@ input[name="rate"] { margin-bottom: -10px; padding: 30px; } + +/* used for the custom dialog titlebar */ +#titlebar { + width: 100%; + height: 20px; + margin-bottom: 4px; + -webkit-app-region: drag; + background-color: gray; + cursor: grab; +} + +#titlebar_buttons_td { + padding-right: 1px; +} + +#titlebar_title { + color: white; + position: relative; + left: 1px; + top: 1px; + background-color: gray; +} + +#titlebar_close_button { + width: 16px; + height: 16px; + background: #a2a2a2; + -webkit-app-region: no-drag; + color: #FFF; + font-size: 18px; + text-align: center; + line-height: 16px; + cursor: default; +} + +/*#titlebar_close_button:after { + position: absolute; + right: 6px; + top: 1px; + content: "\d7"; + font-size: 20px; + color: #FFF; +}*/ + +#titlebar_close_button:hover { + background: #b2b2b2; +} + +#titlebar_close_button:active { + background: #e2e2e2; +} + +input[type="color"] { + margin-bottom: 2px; +} + +.foreground_color span, +.background_color span, +.label_color span { + position: relative; + bottom: 2px; +} diff --git a/pd/nw/css/vanilla.css b/pd/nw/css/vanilla.css index e8bf4f7a3b23368130cefda1da01b85df7e0accb..b987533a27782e38a57a67f49f246e1851db777b 100644 --- a/pd/nw/css/vanilla.css +++ b/pd/nw/css/vanilla.css @@ -12,6 +12,17 @@ body { font-family: "DejaVu Sans Mono"; } +#hscroll:hover, #vscroll:hover { + background-color: rgba(0, 0, 0, 0.39) !important; +} +#hscroll, #vscroll { + background-color: rgba(0, 0, 0, 0.267); +} + +#hscroll, #vscroll { + cursor: -webkit-grabbing; +} + .noselect { -webkit-touch-callout: none; -webkit-user-select: none; @@ -159,7 +170,7 @@ mark.console_find_highlighted { min-width: 3ch; position: absolute; display: table-cell; - padding: 3px 2px 3px 2px; + padding: 1px 0px 3px 1.5px; /* box-shadow: inset 1px 0px 0px 1px #000; */ background-color: transparent; white-space: pre-wrap; @@ -367,6 +378,18 @@ text { -webkit-animation: fizzle 0.5s linear 1; } +#console_find { + width: 100%; + height: 1em; + padding-top: 2px; + padding-left: 3px; + padding-bottom: 9px; + background: silver; + position: fixed; + bottom: 0; + left: 0; +} + #canvas_find { width: 100%; height: 1em; @@ -377,6 +400,19 @@ text { left: 0; } +/* Dialog to ask to save the patch before quitting */ +#save_before_quit { + background-color: #f3f3f3; + border:1px solid #f3f3f3; + padding: 12px; + /* margin: 12px; */ + /*box-shadow: 7px 7px 5px grey;*/ + width: 70%; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); +} + /* Search dialog */ .search_body { @@ -398,6 +434,11 @@ text { padding: 8px; } +form { + margin-left: 4px; + margin-right: 4px; +} + fieldset { background-color:#eeeeee; border-radius:3px; @@ -461,7 +502,7 @@ input[name="receive_symbol"] { } input[name="label"] { - width: 8em; + width: 9em; } input[name="font_size"] { @@ -472,6 +513,18 @@ input[name="startup_flags"] { width: 16em; } +/* All radios */ +input[type="radio"] { + position: relative; + top: 2px; +} + +/* All checkboxes */ +input[type=checkbox] { + position: relative; + top: 2px; +} + /* Canvas dialog */ div.x-scale { @@ -528,13 +581,13 @@ div.y2 { without becoming an order of magnitude more complex, do feel free... */ .prefs_tab_group { display: table; - width: 90%; + width: 100%; } /* Configure the radio buttons to hide off-screen */ .prefs_tab { position: absolute; - left:-100px; + left:-500px; top:-100px; } @@ -589,6 +642,13 @@ div.y2 { height: 78vh; } +#midi_in1, #midi_in2, #midi_in3, #midi_in4, #midi_in5, + #midi_in6, #midi_in7, #midi_in8, #midi_in9, #midi_in10, + #midi_out1, #midi_out2, #midi_out3, #midi_out4, #midi_out5, + #midi_out6, #midi_out7, #midi_out8, #midi_out9, #midi_out10 { + width: 205px; +} + .tab_settings { padding-top: 8px; } @@ -607,3 +667,65 @@ input[name="rate"] { margin-bottom: -10px; padding: 30px; } + +/* used for the custom dialog titlebar */ +#titlebar { + width: 100%; + height: 20px; + margin-bottom: 4px; + -webkit-app-region: drag; + background-color: gray; + cursor: grab; +} + +#titlebar_buttons_td { + padding-right: 1px; +} + +#titlebar_title { + color: white; + position: relative; + left: 1px; + top: 1px; + background-color: gray; +} + +#titlebar_close_button { + width: 16px; + height: 16px; + background: #a2a2a2; + -webkit-app-region: no-drag; + color: #FFF; + font-size: 18px; + text-align: center; + line-height: 16px; + cursor: default; +} + +/*#titlebar_close_button:after { + position: absolute; + right: 6px; + top: 1px; + content: "\d7"; + font-size: 20px; + color: #FFF; +}*/ + +#titlebar_close_button:hover { + background: #b2b2b2; +} + +#titlebar_close_button:active { + background: #e2e2e2; +} + +input[type="color"] { + margin-bottom: 2px; +} + +.foreground_color span, +.background_color span, +.label_color span { + position: relative; + bottom: 2px; +} diff --git a/pd/nw/css/vanilla_inverted.css b/pd/nw/css/vanilla_inverted.css index ee126862338670878fa7d88574a5d076f3c93106..e38f6a4d5e666deec837c58680036f7db535a949 100644 --- a/pd/nw/css/vanilla_inverted.css +++ b/pd/nw/css/vanilla_inverted.css @@ -12,6 +12,17 @@ body { font-family: "DejaVu Sans Mono"; } +#hscroll:hover, #vscroll:hover { + background-color: rgba(0, 0, 0, 0.39) !important; +} +#hscroll, #vscroll { + background-color: rgba(0, 0, 0, 0.267); +} + +#hscroll, #vscroll { + cursor: -webkit-grabbing; +} + .noselect { -webkit-touch-callout: none; -webkit-user-select: none; @@ -169,7 +180,7 @@ mark.console_find_highlighted { min-width: 3ch; position: absolute; display: table-cell; - padding: 3px 2px 3px 2px; + padding: 1px 0px 3px 1.5px; /* box-shadow: inset 1px 0px 0px 1px #000; */ color: white; /* text color */ background-color: transparent; @@ -378,6 +389,18 @@ text { -webkit-animation: fizzle 0.5s linear 1; } +#console_find { + width: 100%; + height: 1em; + padding-top: 2px; + padding-left: 3px; + padding-bottom: 9px; + background: silver; + position: fixed; + bottom: 0; + left: 0; +} + #canvas_find { width: 100%; height: 1em; @@ -395,6 +418,19 @@ text { border:1px solid white; } +/* Dialog to ask to save the patch before quitting */ +#save_before_quit { + background-color: #f3f3f3; + border:1px solid #f3f3f3; + padding: 12px; + /* margin: 12px; */ + /*box-shadow: 7px 7px 5px grey;*/ + width: 70%; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); +} + /* Search dialog */ .search_body { @@ -416,6 +452,11 @@ text { padding: 8px; } +form { + margin-left: 4px; + margin-right: 4px; +} + fieldset { background-color:#eeeeee; border-radius:3px; @@ -479,7 +520,7 @@ input[name="receive_symbol"] { } input[name="label"] { - width: 8em; + width: 9em; } input[name="font_size"] { @@ -490,6 +531,18 @@ input[name="startup_flags"] { width: 16em; } +/* All radios */ +input[type="radio"] { + position: relative; + top: 2px; +} + +/* All checkboxes */ +input[type=checkbox] { + position: relative; + top: 2px; +} + /* Canvas dialog */ div.x-scale { @@ -546,13 +599,13 @@ div.y2 { without becoming an order of magnitude more complex, do feel free... */ .prefs_tab_group { display: table; - width: 90%; + width: 100%; } /* Configure the radio buttons to hide off-screen */ .prefs_tab { position: absolute; - left:-100px; + left:-500px; top:-100px; } @@ -607,6 +660,13 @@ div.y2 { height: 78vh; } +#midi_in1, #midi_in2, #midi_in3, #midi_in4, #midi_in5, + #midi_in6, #midi_in7, #midi_in8, #midi_in9, #midi_in10, + #midi_out1, #midi_out2, #midi_out3, #midi_out4, #midi_out5, + #midi_out6, #midi_out7, #midi_out8, #midi_out9, #midi_out10 { + width: 205px; +} + .tab_settings { padding-top: 8px; } @@ -625,3 +685,65 @@ input[name="rate"] { margin-bottom: -10px; padding: 30px; } + +/* used for the custom dialog titlebar */ +#titlebar { + width: 100%; + height: 20px; + margin-bottom: 4px; + -webkit-app-region: drag; + background-color: gray; + cursor: grab; +} + +#titlebar_buttons_td { + padding-right: 1px; +} + +#titlebar_title { + color: white; + position: relative; + left: 1px; + top: 1px; + background-color: gray; +} + +#titlebar_close_button { + width: 16px; + height: 16px; + background: #a2a2a2; + -webkit-app-region: no-drag; + color: #FFF; + font-size: 18px; + text-align: center; + line-height: 16px; + cursor: default; +} + +/*#titlebar_close_button:after { + position: absolute; + right: 6px; + top: 1px; + content: "\d7"; + font-size: 20px; + color: #FFF; +}*/ + +#titlebar_close_button:hover { + background: #b2b2b2; +} + +#titlebar_close_button:active { + background: #e2e2e2; +} + +input[type="color"] { + margin-bottom: 2px; +} + +.foreground_color span, +.background_color span, +.label_color span { + position: relative; + bottom: 2px; +} diff --git a/pd/nw/dialog_abstractions.html b/pd/nw/dialog_abstractions.html new file mode 100644 index 0000000000000000000000000000000000000000..cf74b55a5702240f202c1f3ebf22ef1b973b04b3 --- /dev/null +++ b/pd/nw/dialog_abstractions.html @@ -0,0 +1,213 @@ +<!DOCTYPE html> +<html> + <head> + <link id="page_style" rel="stylesheet" type="text/css" href="css/default.css"> + </head> + <body class="dialog_body prefs_body" style="overflow: hidden;"> + <div class="container noselect prefs_container"> + <table id="titlebar"> + <tr> + <td style="width: 100%;"> + <div id="titlebar_title">Abstractions</div> + </td> + <td id="titlebar_buttons_td"> + <div class="titlebar_buttons"> + <div id="titlebar_close_button" onclick="cancel();">×</div> + </div> + </td> + </tr> + </table> + <form> + <fieldset style="width: 90%"> + <legend data-i18n="abstractions.private"></legend> + <strong data-i18n="abstractions.global"></strong> + <hr> + <table style="width: 90%; table-layout: fixed;"> + </table> + <br> + <strong data-i18n="abstractions.local"></strong> + <hr> + <table style="width: 90%; table-layout: fixed;"> + </table> + <br> + <button id="selectall_button" type="button" onClick="selectall()" data-i18n="[title]abstractions.selectall_tt" style="float: right;"> + <span data-i18n="abstractions.selectall"></span> + </button> + </fieldset> + <!-- + <hr> + <fieldset style="width: 90%; border: 2px solid grey"> + <legend data-i18n="abstractions.filebased"></legend> + <i>NOT IMPLEMENTED</i> + <table style="width: 90%; table-layout: fixed;"> + </table> + </fieldset> + <hr> + --> + <div class="submit_buttons"> + <button id="delete_button" type="button" onClick="deleteselected()" data-i18n="[title]abstractions.delete_tt"> + <span data-i18n="abstractions.delete"></span> + </button> + <button type="button" onClick="cancel()" data-i18n="[title]abstractions.close_tt"> + <span data-i18n="abstractions.close"></span> + </button> + </div> + </form> + </div> + <script> +"use strict"; +var gui = require("nw.gui"); +var pdgui = require("./pdgui.js"); + +// For translations +var l = pdgui.get_local_string; + +pdgui.skin.apply(window); + +var pd_object_callback; +var canvas; +var deletequeue; + +function selectall() { + var checkboxes = document.querySelectorAll('input[type="checkbox"]:not(:checked)'); + for(var i = 0, n = checkboxes.length; i < n; i++) { + if(!checkboxes[i].checked) + { + checkboxes[i].click(); + } + } +} + +function deleteselected() { + pdgui.pdsend(pd_object_callback, "delabstractions", Array.from(deletequeue).join(" ")); + cancel(); +} + +function cancel() { + pdgui.pdsend(pd_object_callback, "cancel"); +} + +function populate_form(attrs) { + var filebased_abs = attrs.filebased_abs, + private_abs = attrs.private_abs, + i, + zero = 0; + canvas = attrs.canvas; + deletequeue = new Set(); + var tables = document.querySelectorAll("table"), + privateglobal_table = tables[1], + privatelocal_table = tables[2]; + //filebased_table = tables[2] + + /* + for(i = 0; i < filebased_abs.length; i += 2) + { + var row = document.createElement("tr"); + cell1 = document.createElement("td"), + cell2 = document.createElement("td"), + cell3 = document.createElement("td"); + + cell1.textContent = filebased_abs[i]; + cell1.style.setProperty("width", "70%"); + cell2.textContent = filebased_abs[i+1]; + cell2.style.setProperty("width", "20%"); + row.appendChild(cell1); + row.appendChild(cell2); + row.appendChild(cell3); + filebased_table.appendChild(row); + } + */ + + for(i = 0; i < private_abs.length; i += 2) + { + var row = document.createElement("tr"), + cell1 = document.createElement("td"), + cell2 = document.createElement("td"), + cell3 = document.createElement("td"); + + cell1.textContent = private_abs[i]; + cell1.style.setProperty("width", "70%"); + cell2.textContent = private_abs[i+1]; + cell2.style.setProperty("width", "20%"); + + if(private_abs[i+1] === 0) + { + let input_elem = document.createElement("input"), + j = i; + input_elem.type = "checkbox"; + input_elem.style.setProperty("max-height", "10px"); + input_elem.style.setProperty("top", "0px"); + input_elem.onchange = function() { + if(input_elem.checked) { + deletequeue.add(private_abs[j]); + } else { + deletequeue.delete(private_abs[j]); + } + get_elem("delete_button").disabled = (deletequeue.size === 0); + }; + cell3.appendChild(input_elem); + zero++; + } + + row.appendChild(cell1); + row.appendChild(cell2); + row.appendChild(cell3); + + if(private_abs[i][0] === '@') { + privatelocal_table.appendChild(row); + } else { + privateglobal_table.appendChild(row); + } + } + + get_elem("selectall_button").disabled = (zero === 0); + get_elem("delete_button").disabled = true; +} + +// This gets called from the nw_create_window function in index.html +// It provides us with our window id from the C side. Once we have it +// we can create the menu and register event callbacks +function register_window_id(gfxstub, attrs) { + pd_object_callback = gfxstub; + add_events(gfxstub); + // not sure that we need this for properties windows + //pdgui.canvas_map(gfxstub); + translate_form(); + populate_form(attrs); + // We don't turn on rendering of the "container" div until + // We've finished displaying all the spans and populating the + // labels and form elements. That makes it more efficient and + // snappier, at least on older machines. + document.getElementsByClassName("container")[0].style.setProperty("display", "inline"); + + gui.Window.get().setResizable(false); +} + +function get_elem(name) { + return document.getElementById(name); +} + +// Stop-gap translator +function translate_form() { + var elements = document.querySelectorAll("[data-i18n]"), + data, + i; + for (i = 0; i < elements.length; i++) { + data = elements[i].dataset.i18n; + if (data.slice(0, 7) === "[title]") { + elements[i].title = l(data.slice(7)); + } else { + elements[i].textContent = l(data); + } + } +} + +function add_events(name) { + gui.Window.get().on("close", function () { + cancel(); + }); + pdgui.dialog_bindings(name); +} + </script> + </body> +</html> diff --git a/pd/nw/dialog_canvas.html b/pd/nw/dialog_canvas.html index ed9a8b1068975b4e0e72cca6ef1017828b3168da..c5f31c215cd0f864e07caaacde68624596ae6581 100644 --- a/pd/nw/dialog_canvas.html +++ b/pd/nw/dialog_canvas.html @@ -5,10 +5,21 @@ <link id="page_style" rel="stylesheet" type="text/css" href="css/default.css"> <title>Canvas Dialog</title> </head> - <body class="dialog_body"> + <body class="dialog_body" style="overflow: hidden;"> <div class="container noselect"> + <table id="titlebar"> + <tr> + <td style="width: 100%;"> + <div id="titlebar_title">Canvas Properties</div> + </td> + <td id="titlebar_buttons_td"> + <div class="titlebar_buttons"> + <div id="titlebar_close_button" onclick="cancel(false);">×</div> + </div> + </td> + </tr> + </table> <form> - <fieldset class="canvas"> <legend data-i18n="canvas.prop.heading.gop"></legend> @@ -96,7 +107,7 @@ <fieldset class="canvas"> <legend data-i18n="canvas.prop.heading.data_scaling"></legend> -<div style="display: inline-block; align: left;"> +<div style="display: inline-block; margin-right: -5px; width: 100%;"> <div class="x_scale prop hidden"> <nobr> <label class="no_gop_opt" data-i18n="[title]canvas.prop.x_scale_tt"> @@ -140,7 +151,6 @@ </label> </div> </div> -</div> </fieldset> @@ -151,7 +161,7 @@ <select id="arrays_select" class="hidden"></select> </label> - <div class="array-name prop"> + <div class="array-name prop" style="margin-right: -5px;"> <label class="array-name" data-i18n="[title]canvas.prop.array_name_tt"> <span data-i18n="canvas.prop.array_name"></span> @@ -187,7 +197,7 @@ </label> <br/> - <span data-i18n="canvas.prop.array_style"></span> + <span style="position: relative; top: 4px;" data-i18n="canvas.prop.array_style"></span> <br/> <table class="array_style"> <tr> @@ -245,7 +255,7 @@ </table> </div> - <div class="array-fill"> + <div class="array-fill" style="margin-top: 2px;"> <label data-i18n="[title]canvas.prop.array_fill_tt"> <input onchange="update_array_attr(this);" type="color" @@ -289,6 +299,7 @@ </label> </div> </fieldset> +</div> <div class="submit_buttons"> <button type="button" id="ok_button" onClick="ok()" data-i18n="[title]iem.prop.ok_tt"> @@ -620,9 +631,11 @@ function populate_array_form(objects) { a_field = document.getElementById("arrays"), opt, i; a_field.classList.remove("hidden"); + a_field.style.setProperty("height", "240px"); if (objects.length > 1) { // show the select element if there's more than one array arrays_select.classList.remove("hidden"); + arrays_select.style.setProperty("margin", "0px 0px 5px 0px"); } for (i = 0; i < objects.length; i++) { opt = document.createElement("option"); @@ -669,6 +682,7 @@ function register_window_id(gfxstub, attr_objects) { // attr_objects[0]: canvas properties // attr_objects[1...n-1]: array properties add_events(gfxstub); + pdgui.gui_check_for_dialog_appearance_inconsistencies(gfxstub); // not sure that we need this for properties windows... // pdgui.canvas_map(gfxstub); translate_form(); @@ -690,7 +704,7 @@ function register_window_id(gfxstub, attr_objects) { new_array_dialog = false; // this is a canvas/array props dialog populate_form(attr_objects[0]); } - init_arrays(pd_garray_attrs); + init_arrays(pd_garray_attrs); // Disabling the menus does not yet work, so we hide that button for // the moment diff --git a/pd/nw/dialog_data.html b/pd/nw/dialog_data.html index 15f09ae4bbe482adfbed32182e3951dcdce5ecba..88eb5b15035326cd8f413f37088a5ea1be05abf2 100644 --- a/pd/nw/dialog_data.html +++ b/pd/nw/dialog_data.html @@ -3,14 +3,67 @@ <head> <link id="page_style" rel="stylesheet" type="text/css" href="css/default.css"> </head> - <body class="dialog_body"> + <style> +/* width */ +::-webkit-scrollbar { + width: 5px; +} + +/* Track */ +::-webkit-scrollbar-track { + background: rgba(0,0,0,0); +} + +/* Handle */ +::-webkit-scrollbar-thumb { + background: rgba(0, 0, 0, 0.267); +} + +/* Handle on hover */ +::-webkit-scrollbar-thumb:hover { + background: #888; +} + +input[type=checkbox] { + margin: 2px 0px 8px 0px; +} + +input[type="text"] { + margin-bottom: 3px; +} + +label { + margin-left: 0px; + margin-bottom: 1px; + +} + </style> + <body class="dialog_body" style="overflow: hidden;"> <div class="container"> + <table id="titlebar"> + <tr> + <td style="width: 100%;"> + <div id="titlebar_title">Data Object Properties</div> + </td> + <td id="titlebar_buttons_td"> + <div class="titlebar_buttons"> + <div id="titlebar_close_button" onclick="cancel(false);">×</div> + </div> + </td> + </tr> + </table> <form> - <fieldset id="data_container"> - <legend id="legend"></legend> + <fieldset id="data_container" style="height: 267px;"> + <legend id="legend"></legend> + <div id="scrollable_data" style="overflow: auto; height: 250px;"> + <table id="pairs" style="margin-right: 5px;"> + </table> </fieldset> - <div class="submit_buttons"> + <div class="submit_buttons" style=" + text-align: center; + padding: 8px 0px 8px 0px;" + > <button type="button" onClick="ok()" data-i18n="[title]iem.prop.ok_tt"> <span data-i18n="iem.prop.ok"></span> </button> @@ -27,6 +80,8 @@ var gui = require("nw.gui"); var pdgui = require("./pdgui.js"); +//gui.Window.get().setResizable(false); + // For translations var l = pdgui.get_local_string; @@ -146,12 +201,15 @@ function add_textarea_input(first_row) { textarea = document.createElement("textarea"), check_label = document.createElement("label"), check = document.createElement("input"), - outer_container = document.getElementById("data_container"), + outer_container = document.getElementById("pairs"), inner_container = document.createElement("div"), br = document.createElement("br"); label.textContent = "vector fields"; + inner_container.style.setProperty("display", "inline-block"); + inner_container.style.setProperty("width", "100%"); + label.style.setProperty("display", "block"); label.style.setProperty("text-align", "left"); textarea.style.setProperty("display", "block"); @@ -159,7 +217,8 @@ function add_textarea_input(first_row) { textarea.setAttribute("id", "vector_textarea"); textarea.setAttribute("rows", "4"); textarea.setAttribute("col", "5"); - textarea.style.setProperty("width", "11.3em"); + textarea.style.setProperty("width", "97.5%"); + textarea.style.setProperty("resize", "none"); textarea.disabled = true; check.type = "checkbox"; @@ -181,7 +240,7 @@ function add_textarea_input(first_row) { function add_text_input(field, left_column, first_row) { var label = document.createElement("label"), text_input = document.createElement("input"), - outer_container = document.getElementById("data_container"), + outer_container = document.getElementById("pairs"), inner_container = document.createElement("div"), br; inner_container.style.setProperty("float", "left"); @@ -190,6 +249,9 @@ function add_text_input(field, left_column, first_row) { if (left_column && field.type !== "symbol") { inner_container.style.setProperty("margin-right", "1em"); } + if (!left_column) { + inner_container.style.setProperty("float", "right"); + } label.textContent = field["var"]; text_input.type = "text"; text_input.classList.add("scalar_value"); @@ -204,7 +266,7 @@ function add_text_input(field, left_column, first_row) { text_input.style.setProperty("display", "block"); // Also in opposition to iemgui dialogs text_input.style.setProperty("width", - field.type === "float" ? "5em" : "11.3em"); + field.type === "float" ? "5em" : "97.5%"); // Some bottom margin inner_container.style.setProperty("margin-bottom", "8px"); @@ -301,6 +363,7 @@ function register_window_id(gfxstub, data_string) { var head, tail, templates, data, data_separator; pd_object_callback = gfxstub; add_events(gfxstub); + pdgui.gui_check_for_dialog_appearance_inconsistencies(gfxstub); // slice off the head of the message. This is where the templates // for the data-- plus any templates for (nested) arrays-- are kept. // We will keep the head intact for sending back to Pd since the user diff --git a/pd/nw/dialog_dropdown.html b/pd/nw/dialog_dropdown.html new file mode 100644 index 0000000000000000000000000000000000000000..a06e7da2c9e80adf07d6d256b8b5a96c54c8d436 --- /dev/null +++ b/pd/nw/dialog_dropdown.html @@ -0,0 +1,403 @@ +<!DOCTYPE html> +<html> + <head> + <link id="page_style" rel="stylesheet" type="text/css" href="css/default.css"> + </head> + <body class="dialog_body"> + <div class="container noselect"> + <table id="titlebar"> + <tr> + <td style="width: 100%;"> + <div id="titlebar_title">Dropdown Properties</div> + </td> + <td> + <div class="titlebar_buttons"> + <div id="titlebar_close_button" onclick="cancel(false);">×</div> + </div> + </td> + </tr> + </table> + <form> + <fieldset> + <legend id="dialog_header"></legend> + + <table class="pairs"> + <tr class="width prop"> + <td> + <label data-i18n="[title]gatom.prop.width_tt"> + <span data-i18n="gatom.prop.width"></span> + </label> + </td> + <td data-i18n="[title]gatom.prop.width_tt"> + <input type="text" id="width" name="width" + onchange="update_attr(this)"> + </td> + <td> + </td> + <td> + </td> + </tr> + <tr class="draglo prop pair"> + <td> + <label data-i18n="[title]iem.prop.minimum_tt"> + <span data-i18n="iem.prop.minimum"></span> + </label> + </td> + <td data-i18n="[title]iem.prop.minimum_tt"> + <input type="text" id="draglo" name="draglo" + onchange="update_attr(this)"> + </td> + <td> + <label data-i18n="[title]iem.prop.maximum_tt"> + <span data-i18n="iem.prop.maximum"></span> + </label> + </td> + <td data-i18n="[title]iem.prop.maximum_tt"> + <input type="text" id="draghi" name="draghi" + onchange="update_attr(this)"> + </td> + </tr> + + <tr class="outtype prop"> + <td> + <label data-i18n="[title]gatom.prop.dropdown_outtype_tt"> + <span data-i18n="gatom.prop.dropdown_outtype"></span> + </label> + </td> + <td colspan="3" + data-i18n="[title]gatom.prop.dropdown_outtype_tt"> + <select id="outtype_select" + onchange="update_dropdown_outtype(this);"> + <option>index</option> + <option>value</option> + </select> + </td> + </tr> + <tr> + <td> + <label data-i18n="[title]iem.prop.send_tt"> + <span data-i18n="iem.prop.send"></span> + </label> + </td> + <td colspan="3" + data-i18n="[title]iem.prop.send_tt"> + <input type="text" id="send_symbol" name="send_symbol" + onchange="update_attr(this);"> + </td> + </tr> + <tr> + <td> + <label data-i18n="[title]iem.prop.receive_tt"> + <span data-i18n="iem.prop.receive"></span> + </label> + </td> + <td colspan="3" + data-i18n="[title]iem.prop.receive_tt"> + <input type="text" id="receive_symbol" name="receive_symbol" + onchange="update_attr(this);"> + </td> + </tr> + <tr> + <td> + <label data-i18n="[title]gatom.prop.label_tt"> + <span data-i18n="gatom.prop.label"></span> + </label> + </td> + <td colspan="3" + data-i18n="[title]gatom.prop.label_tt"> + <input type="text" id="label" name="label" + onchange="update_attr(this)"> + </td> + </tr> + <tr> + <td> + <label data-i18n="[title]gatom.prop.labelpos_tt"> + <span data-i18n="gatom.prop.labelpos"></span> + </label> + </td> + <td colspan="3"> + <label class="points" + data-i18n="[title]gatom.prop.labelpos_tt"> + + <input class="label-pos" + type="radio" + id="labelpos_top" + value="2" + name="labelpos" + style="margin-left: 27px;" + onchange="update_attr(this)"> + <span data-i18n="gatom.prop.label_top"></span> + + <br/> + + <input class="label-pos" + type="radio" + id="labelpos_left" + value="0" + name="labelpos" + onchange="update_attr(this)"> + <span data-i18n="gatom.prop.label_left"></span> + + <input class="label-pos" + type="radio" + id="labelpos_right" + value="1" + name="labelpos" + onchange="update_attr(this)"> + <span data-i18n="gatom.prop.label_right"></span> + + <br/> + + <input class="label-pos" + type="radio" + id="labelpos_bottom" + value="3" + name="labelpos" + style="margin-left: 27px;" + onchange="update_attr(this)"> + <span data-i18n="gatom.prop.label_bottom"></span> + + </label> + + </table> + + </fieldset> + + <div class="submit_buttons"> + <button type="button" onClick="ok()" data-i18n="[title]iem.prop.ok_tt"> + <span data-i18n="iem.prop.ok"></span> + </button> + <button type="button" onClick="apply()" data-i18n="[title]iem.prop.apply_tt"> + <span data-i18n="iem.prop.apply"></span> + </button> + <button type="button" onClick="cancel(true)" data-i18n="[title]iem.prop.cancel_tt"> + <span data-i18n="iem.prop.cancel"></span> + </button> + </div> + + </form> + </div> + + <script> +"use strict"; +var gui = require("nw.gui"); +var pdgui = require("./pdgui.js"); + +// For translations +var l = pdgui.get_local_string; + +pdgui.skin.apply(window); + +var pd_object_callback, + old_attrs = {}, // original state. Used if we cancel the dialog + new_attrs = {}; // changed state. Used if we apply or click "Ok" + +function substitute_space(arg) { + var fake_space = String.fromCharCode(11); + return arg.split(" ").join(fake_space); +} + +function strip_problem_chars(arg) { + var problem_chars = [";", ",", "\\"]; + var ret = arg; + for(var i = 0; i < problem_chars.length; i++) { + ret = ret.split(problem_chars[i]).join(""); + } + return ret; +} + +function gatom_escape(str) { + var ret; + if (str.length === 0) { + ret = "-"; + } else if (str.slice(0,1) === "-") { + ret = "-" + str; + } else { + var arr = str.split(""); + for (var i = 0; i < arr.length; i++) { + if (arr[i] === "$" && i+1 < arr.length && + arr[i+1] >= "0" && arr[i+1] <= "9") { + arr[i] = "#"; + } + } + ret = arr.join(""); + } + return strip_problem_chars(ret); +} + +function gatom_unescape(str) { + if (str.slice(0,1) === "-") { + str = str.slice(1); + } else { + var arr = str.split(""); + for (var i = 0; i < arr.length; i++) { + if (arr[i] === "#" && i+1 < arr.length && + arr[i+1] >= "0" && arr[i+1] <= "9") { + arr[i] = "$"; + } + } + str = arr.join(""); + } + return str; +} + +function update_attr(elem) { + new_attrs[elem.name] = elem.value; +} + +function update_dropdown_outtype(elem) { + new_attrs.outtype = elem.selectedIndex; +} + +function send_params(attrs, create_undo_point) { + //pdgui.post("we're applying gatom changes!"); + var gatom = attrs.name === "atom"; + pdgui.pdsend(pd_object_callback, "param", + +attrs.width, + gatom ? +attrs.draglo : +attrs.outtype, + gatom ? +attrs.draghi : 0, + gatom_escape(attrs.label), + +attrs.labelpos, + gatom_escape(attrs.receive_symbol), + gatom_escape(attrs.send_symbol), + create_undo_point ? 1 : 0 + ); +} + +function cancel(revert_changes) { + var dirty = false, attr; + //window.close(true); + if (revert_changes) { + for (attr in old_attrs) { + if (old_attrs[attr] !== new_attrs[attr]) { + dirty = true; + } + } + if (dirty) { + send_params(old_attrs, false); + } + } + pdgui.pdsend(pd_object_callback, "cancel"); +} + +function apply() { + send_params(new_attrs, false); +} + +function ok() { + // Steal focus from any active input to make sure it triggers an + // onchange event + document.querySelector("button").focus(); + // send the old attrs first so we can set an undo point on them + send_params(old_attrs, false); + send_params(new_attrs, true); + cancel(false); +} + +// This gets called from the nw_create_window function in index.html +// It provides us with our window id from the C side. Once we have it +// we can create the menu and register event callbacks +function register_window_id(gfxstub, attributes) { + var attr; + pd_object_callback = gfxstub; + add_events(gfxstub); + + // before translating, set the header based on class name: + document.querySelector("#dialog_header") + .setAttribute("data-i18n", "gatom.prop." + + (attributes.name === "dropdown" ? "dropdown" : "gatom")); + + translate_form(); + populate_form(attributes); + + // hide outtype select for "dropdown", or draglo/hi for "gatom" + document.querySelector(attributes.name === "atom" ? ".outtype" : ".draglo") + .style.setProperty("display", "none"); + + + // Hack... change incoming "-" to empty string + if (attributes.label === "-") { attributes.label = ""; } + if (attributes.send_symbol === "-") { attributes.send_symbol= ""; } + if (attributes.receive_symbol === "-") { attributes.receive_symbol = ""; } + + // Initialize the new_attrs to the current ones + for (attr in attributes) { + if (attributes.hasOwnProperty(attr)) { + new_attrs[attr] = attributes[attr]; + } + } + + old_attrs = attributes; + // We don't turn on rendering of the "container" div until + // We've finished displaying all the spans and populating the + // labels and form elements. That makes it more efficient and + // snappier, at least on older machines. + document.getElementsByClassName("container")[0] + .style.setProperty("display", "inline"); + pdgui.resize_window(pd_object_callback); +} + +function tr_text(id) { + var elem = document.getElementById("iem.prop." + id); + elem.textContent = l("iem.prop." + id); +} + +// Stop-gap translator +function translate_form() { + var i + var elements = document.querySelectorAll("[data-i18n]"); + for (i = 0; i < elements.length; i++) { + var data = elements[i].dataset.i18n; + if (data.slice(0,7) === "[title]") { + elements[i].title = l(data.slice(7)); + } else { + elements[i].textContent = l(data); + } + } +} + +function get_attr(name, attrs) { + return attrs[attrs.indexOf(name)+1]; +} + +function get_elem(name) { + return document.getElementById(name); +} + +function populate_form(attributes) { + var label, snd, rcv, labelpos, i, radios; + get_elem("width").value = attributes.width; + if (attributes.name === "atom") { + get_elem("draglo").value = attributes.draglo; + get_elem("draghi").value = attributes.draghi; + } else { + get_elem("outtype_select").selectedIndex = attributes.outtype; + } + label = attributes.label; + get_elem("label").value = gatom_unescape(label); + snd = attributes.send_symbol; + get_elem("send_symbol").value = gatom_unescape(snd); + rcv = attributes.receive_symbol; + get_elem("receive_symbol").value = gatom_unescape(rcv); + + labelpos = attributes.labelpos; + radios = document.getElementsByName("labelpos"); + for (i = 0; i < radios.length; i++) { + if (+radios[i].value === labelpos) { + radios[i].checked = true; + } + } +} + +function add_events(name) { + // closing the Window + gui.Window.get().on("close", function() { + // this needs to do whatever the "cancel" button does + cancel(false); + }); + pdgui.dialog_bindings(name); +} + + </script> + </body> +</html> diff --git a/pd/nw/dialog_external.html b/pd/nw/dialog_external.html index 63b31d643d8e713b56802b9a5f53548e48f4c92c..a0305f715ce6de93a52f5336dd25fe47b4b3aa84 100644 --- a/pd/nw/dialog_external.html +++ b/pd/nw/dialog_external.html @@ -3,13 +3,66 @@ <head> <link id="page_style" rel="stylesheet" type="text/css" href="css/default.css"> </head> - <body class="dialog_body"> + <style> +/* width */ +::-webkit-scrollbar { + width: 5px; +} + +/* Track */ +::-webkit-scrollbar-track { + background: rgba(0,0,0,0); +} + +/* Handle */ +::-webkit-scrollbar-thumb { + background: rgba(0, 0, 0, 0.267); +} + +/* Handle on hover */ +::-webkit-scrollbar-thumb:hover { + background: #888; +} + +input[type=checkbox] { + margin: 2px 0px 8px 0px; +} + +input[type="text"] { + margin-bottom: 3px; +} + +label { + margin-left: 5px; +} + </style> + <body class="dialog_body" style="overflow: hidden;"> <div class="container"> + <table id="titlebar"> + <tr> + <td style="width: 100%; margin: 7px;"> + <div id="titlebar_title">External Object Properties</div> + </td> + <td id="titlebar_buttons_td"> + <div class="titlebar_buttons"> + <div id="titlebar_close_button" onclick="cancel(false);">×</div> + </div> + </td> + </tr> + </table> + <form> - <fieldset> - <legend></legend> + <fieldset id="data_container" style="height: 267px;"> + <legend></legend> + <div id="scrollable_data" style="overflow: auto; height: 250px;"> + <table id="pairs"> + </table> + </div> </fieldset> - <div class="submit_buttons"> + <div class="submit_buttons" style=" + text-align: center; + padding: 8px 0px 8px 0px;" + > <button type="button" onClick="ok();" id="ok_button" @@ -35,6 +88,8 @@ var gui = require("nw.gui"); var pdgui = require("./pdgui.js"); +//gui.Window.get().setResizable(false); + // For translations var l = pdgui.get_local_string; @@ -94,7 +149,8 @@ function parse_attrs(attrs) { if (token.length > 1) { elem.type = token[token.length - 1]; if (elem.type !== "symbol" && - elem.type !== "toggle") { + elem.type !== "toggle" && + elem.type !== "hidden") { // no suffix defaults to "number" elem.type = "number"; } else { @@ -122,6 +178,7 @@ function register_window_id(gfxstub, args) { var external_name = args.name, array_of_objects; pd_object_callback = gfxstub; + pdgui.gui_check_for_dialog_appearance_inconsistencies(gfxstub); array_of_objects = parse_attrs(args.attributes); // Store our array for later use new_properties = array_of_objects; @@ -162,11 +219,12 @@ function get_input_type(t) { return t === "symbol" ? "text" : t === "number" ? "text" : t === "toggle" ? "checkbox": + t === "hidden" ? "hidden": "text"; } function build_form(external_name, array_of_objects) { - var fieldset = document.querySelector("fieldset"); + var fieldset = document.getElementById("pairs"); document.querySelector("legend").textContent = external_name; array_of_objects.forEach(function(elem) { var input_elem = document.createElement("input"), @@ -184,11 +242,15 @@ function build_form(external_name, array_of_objects) { } } label.textContent = elem.label; - label.appendChild(input_elem); - fieldset.appendChild(label); + fieldset.appendChild(input_elem); + fieldset.appendChild(label); // stop-gap until we make this prettier through css: insert a break fieldset.appendChild(document.createElement("br")); }); + // update scrollbars + var parent_fieldset = document.getElementById("data_container"); + fieldset.style.setProperty("height", (parseInt(parent_fieldset.style.getPropertyValue("height")) - 10) + "px"); + } function add_events(name) { diff --git a/pd/nw/dialog_font.html b/pd/nw/dialog_font.html index 2b162ced19386b58393531b64a8c00983da0aa57..ae3de3ce19cd8d0d6d11dd9cca7b0e14c1fdb53b 100644 --- a/pd/nw/dialog_font.html +++ b/pd/nw/dialog_font.html @@ -3,8 +3,20 @@ <head> <link id="page_style" rel="stylesheet" type="text/css" href="css/default.css"> </head> - <body class="dialog_body"> + <body class="dialog_body" style="overflow: hidden;"> <div class="container"> + <table id="titlebar"> + <tr> + <td style="width: 100%;"> + <div id="titlebar_title">Font Size</div> + </td> + <td> + <div class="titlebar_buttons"> + <div id="titlebar_close_button" onclick="cancel(false);">×</div> + </div> + </td> + </tr> + </table> <form> <fieldset> <legend data-i18n="font.prop.size"></legend> diff --git a/pd/nw/dialog_gatom.html b/pd/nw/dialog_gatom.html index 5d0e9fba4c197f45f6fd282d1e4ae39fb2a54e2c..fd6a1d8de424cd2e3f6d82215e5afdba8f911b79 100644 --- a/pd/nw/dialog_gatom.html +++ b/pd/nw/dialog_gatom.html @@ -3,13 +3,25 @@ <head> <link id="page_style" rel="stylesheet" type="text/css" href="css/default.css"> </head> - <body class="dialog_body"> - <div class="container"> + <body class="dialog_body" style="overflow: hidden;"> + <div class="container noselect"> + <table id="titlebar"> + <tr> + <td style="width: 100%;"> + <div id="titlebar_title">Atom Properties</div> + </td> + <td id="titlebar_buttons_td"> + <div class="titlebar_buttons"> + <div id="titlebar_close_button" onclick="cancel(false);">×</div> + </div> + </td> + </tr> + </table> <form> - <fieldset> + <fieldset style="display: inline-block; margin-right: 4px;"> <legend id="dialog_header"></legend> - <table class="pairs"> + <table class="pairs" style="display: inline-block; width: 232px;"> <tr class="width prop"> <td> <label data-i18n="[title]gatom.prop.width_tt"> @@ -109,15 +121,16 @@ <input class="label-pos" type="radio" - id="labelpos_left" + id="labelpos_top" value="2" name="labelpos" + style="margin-left: 27px;" onchange="update_attr(this)"> <span data-i18n="gatom.prop.label_top"></span> <br/> - <input class="array-style" + <input class="label-pos" type="radio" id="labelpos_left" value="0" @@ -125,7 +138,7 @@ onchange="update_attr(this)"> <span data-i18n="gatom.prop.label_left"></span> - <input class="array-style" + <input class="label-pos" type="radio" id="labelpos_right" value="1" @@ -135,11 +148,12 @@ <br/> - <input class="array-style" + <input class="label-pos" type="radio" id="labelpos_bottom" value="3" name="labelpos" + style="margin-left: 27px;" onchange="update_attr(this)"> <span data-i18n="gatom.prop.label_bottom"></span> @@ -287,6 +301,7 @@ function register_window_id(gfxstub, attributes) { var attr; pd_object_callback = gfxstub; add_events(gfxstub); + pdgui.gui_check_for_dialog_appearance_inconsistencies(gfxstub); // before translating, set the header based on class name: document.querySelector("#dialog_header") diff --git a/pd/nw/dialog_iemgui.html b/pd/nw/dialog_iemgui.html index cd39e492a573f96af0cc09bfca8e87ee0b73e7b3..4a8e2861f357e61a4a284b7322f11857e372bd6f 100644 --- a/pd/nw/dialog_iemgui.html +++ b/pd/nw/dialog_iemgui.html @@ -4,8 +4,20 @@ <link id="page_style" rel="stylesheet" type="text/css" href="css/default.css"> </head> - <body class="dialog_body"> + <body class="dialog_body" style="overflow: hidden;"> <div class="container"> + <table id="titlebar"> + <tr> + <td style="width: 100%;"> + <div id="titlebar_title">Iemgui Properties</div> + </td> + <td id="titlebar_buttons_td"> + <div class="titlebar_buttons"> + <div id="titlebar_close_button" onclick="cancel(false);">×</div> + </div> + </td> + </tr> + </table> <form> <fieldset> <legend data-i18n="iem.prop.heading.size"></legend> @@ -24,7 +36,7 @@ </tr> <tr class="selection_size prop hidden"> <td> - <label data-i18n="[title]iem.select_size_tt"> + <label data-i18n="[title]iem.prop.select_size_tt"> <span data-i18n="iem.prop.select_size"></span> </label> </td> @@ -86,7 +98,7 @@ onchange="update_attr(this);"> </td> <td> - <label data-i18n="iem.prop.visible_height"> + <label data-i18n="[title]iem.prop.visible_height_tt"> <span data-i18n="iem.prop.visible_height"></span> </label> </td> @@ -198,7 +210,8 @@ </td> <td data-i18n="[title]iem.prop.send_tt"> <input type="text" name="send_symbol" - onchange="update_attr(this, true);"> + onchange="update_attr(this, true);" + style="width: 12em;"> </td> <td> <tr class="receive_symbol prop hidden"> @@ -209,7 +222,8 @@ </td> <td data-i18n="[title]iem.prop.receive_tt"> <input type="text" name="receive_symbol" - onchange="update_attr(this, true);"> + onchange="update_attr(this, true);" + style="width: 12em;"> </td> <td> </tr> @@ -228,7 +242,8 @@ </td> <td data-i18n="[title]iem.prop.label_tt"> <input type="text" name="label" - onchange="update_attr(this, true);"> + onchange="update_attr(this, true);" + style="width: 131px;"> </td> <td> <label data-i18n="[title]iem.prop.xoffset_tt"> @@ -276,6 +291,27 @@ <fieldset> <legend data-i18n="iem.prop.heading.colors"></legend> + <table class="draw_style prop hidden" style="margin-bottom: 7px;"> + <tr> + <td> + <label data-i18n="[title]iem.prop.drawstyle_tt"> + <span data-i18n="iem.prop.drawstyle" + style="margin-right: 6px;"></span> + </label> + </td> + <td data-i18n="[title]iem.prop.drawstyle_tt"> + <select name="draw_style" + onchange="update_attr(this, true);" + style="width: 14em;"> + <option value="0">draw everything (default)</option> + <option value="1">draw frame only</option> + <option value="2">draw triangle only</option> + <option value="3">draw number only</option> + </select> + </td> + <td> + </table> + <div class="background_color prop hidden"> <label data-i18n="[title]iem.prop.bgcolor_tt"> <input type="color" name="background_color" @@ -497,6 +533,8 @@ function send_params(attrs, create_undo_point) { var slot18 = attrs.steady_on_click ? +attrs.steady_on_click : 0; + var draw_style = attrs.draw_style ? +attrs.draw_style : 0; + pdgui.pdsend(pd_object_callback, "dialog", width, height, slot3, // bng: flash_interrupt @@ -517,7 +555,7 @@ function send_params(attrs, create_undo_point) { background_color, foreground_color, label_color, slot18, // steady on click - 0, // not sure what this is doing here + draw_style, // numbox draw style create_undo_point ? 1 : 0 // whether we set an undo point ); } @@ -577,8 +615,10 @@ function register_window_id(gfxstub, attr_object) { new_attrs[attr] = old_attrs[attr]; } } - console.log("attr object is " + attr_object.toString()); + console.log("attr object is " + attr_object.toString() + + " and its type is " + attr_object.type); add_events(gfxstub); + pdgui.gui_check_for_dialog_appearance_inconsistencies(gfxstub); // Special case for [moonlib/mknob] which leverages the iemgui dialog-- // change the label for "height" to "steps" @@ -586,6 +626,11 @@ function register_window_id(gfxstub, attr_object) { change_width_and_height_labels(); } + // ico@vt.edu TODO: translate the window title + // for the timebeing we just give it english version + document.getElementById("titlebar_title").textContent = "[" + + attr_object.type + "] Iemgui Properties"; + translate_form(); populate_form(attr_object); // We don't turn on rendering of the "container" div until diff --git a/pd/nw/dialog_prefs.html b/pd/nw/dialog_prefs.html index 63b18f48859fe1e8cecccd50d62ce24b1ce859e8..07a857749594c6722cde64de2092bf787ecd773b 100644 --- a/pd/nw/dialog_prefs.html +++ b/pd/nw/dialog_prefs.html @@ -3,8 +3,41 @@ <head> <link id="page_style" rel="stylesheet" type="text/css" href="css/default.css"> </head> - <body class="dialog_body prefs_body"> + <style> +td { + padding-right: 0px; +} + +select { + height: 1.6em; +} + +#in1, #in2, #in3, #in4, #out1, #out2, #out3, #out4 { + width: 100%; +} + +#inchans1, #inchans2, #inchans3, #inchans4, #outchans1, #outchans2, #outchans3, #outchans4 { + margin-left: 3px; +} + +#midilabel { + vertical-align: bottom; +} + </style> + <body class="dialog_body prefs_body" style="overflow: hidden;"> <div class="container noselect prefs_container"> + <table id="titlebar"> + <tr> + <td style="width: 100%;"> + <div id="titlebar_title">Pd-L2Ork Properties</div> + </td> + <td id="titlebar_buttons_td"> + <div class="titlebar_buttons"> + <div id="titlebar_close_button" onclick="cancel(false);">×</div> + </div> + </td> + </tr> + </table> <div class="prefs_tab_group"> <input type="radio" name="prefs_radio_group" @@ -116,7 +149,7 @@ </td> </tr> <tr> - <td> + <td style="width: 80%"> <select id="in1" onchange="dev_change(this);"></select> </td> <td> @@ -129,7 +162,7 @@ </td> </tr> <tr> - <td> + <td style="width: 80%"> <select id="in2" onchange="dev_change(this);"></select> </td> <td> @@ -142,7 +175,7 @@ </td> </tr> <tr> - <td> + <td style="width: 80%"> <select id="in3" onchange="dev_change(this);"></select> </td> <td> @@ -155,7 +188,7 @@ </td> </tr> <tr> - <td> + <td style="width: 80%"> <select id="in4" onchange="dev_change(this);"></select> </td> <td> @@ -168,15 +201,15 @@ </td> </tr> <tr> - <td data-i18n="[title]prefs.audio.output_title_tt"> + <td data-i18n="[title]prefs.audio.output_title_tt" style="padding-top: 10px;"> <span data-i18n="prefs.audio.output_title"></span> </td> - <td> + <td style="padding-top: 10px;"> <span data-i18n="prefs.audio.channels"></span> </td> </tr> <tr> - <td> + <td style="width: 80%"> <select id="out1" onchange="dev_change(this);"></select> </td> <td> @@ -189,7 +222,7 @@ </td> </tr> <tr> - <td> + <td style="width: 80%"> <select id="out2" onchange="dev_change(this);"></select> </td> <td> @@ -202,7 +235,7 @@ </td> </tr> <tr> - <td> + <td style="width: 80%"> <select id="out3" onchange="dev_change(this);"></select> </td> <td> @@ -215,7 +248,7 @@ </td> </tr> <tr> - <td> + <td style="width: 80%"> <select id="out4" onchange="dev_change(this);"></select> </td> <td> @@ -259,44 +292,44 @@ <span data-i18n="[title]prefs.midi.input_title_tt"> <span data-i18n="prefs.midi.input_title"></span> </span> - <table class="tab_settings"> + <table class="tab_settings" style="width: 100%;"> <tr> - <td>1</td><td> + <td id="midilabel">1</td><td> <select id="midi_in1" onchange="dev_change(this);"></select> </td> - <td align="right">6</td><td> + <td align="right" id="midilabel">6</td><td> <select id="midi_in6" onchange="dev_change(this);"></select> </td> </tr> <tr> - <td>2</td><td> + <td id="midilabel">2</td><td> <select id="midi_in2" onchange="dev_change(this);"></select> </td> - <td align="right">7</td><td> + <td align="right" id="midilabel">7</td><td> <select id="midi_in7" onchange="dev_change(this);"></select> </td> </tr> <tr> - <td>3</td><td> + <td id="midilabel">3</td><td> <select id="midi_in3" onchange="dev_change(this);"></select> </td> - <td align="right">8</td><td> + <td align="right" id="midilabel">8</td><td> <select id="midi_in8" onchange="dev_change(this);"></select> </td> </tr> <tr> - <td>4</td><td> + <td id="midilabel">4</td><td> <select id="midi_in4" onchange="dev_change(this);"></select> </td> - <td align="right">9</td><td> + <td align="right" id="midilabel">9</td><td> <select id="midi_in9" onchange="dev_change(this);"></select> </td> </tr> <tr> - <td>5</td><td> + <td id="midilabel">5</td><td> <select id="midi_in5" onchange="dev_change(this);"></select> </td> - <td align="right">10</td><td> + <td align="right" id="midilabel">10</td><td> <select id="midi_in10" onchange="dev_change(this);"></select> </td> </tr> @@ -307,42 +340,42 @@ </span> <table class="tab_settings"> <tr> - <td>1</td><td> + <td id="midilabel">1</td><td> <select id="midi_out1" onchange="dev_change(this);"></select> </td> - <td align="right">6</td><td> + <td align="right" id="midilabel">6</td><td> <select id="midi_out6" onchange="dev_change(this);"></select> </td> </tr> <tr> - <td>2</td><td> + <td id="midilabel">2</td><td> <select id="midi_out2" onchange="dev_change(this);"></select> </td> - <td align="right">7</td><td> + <td align="right" id="midilabel">7</td><td> <select id="midi_out7" onchange="dev_change(this);"></select> </td> </tr> <tr> - <td>3</td><td> + <td id="midilabel">3</td><td> <select id="midi_out3" onchange="dev_change(this);"></select> </td> - <td align="right">8</td><td> + <td align="right" id="midilabel">8</td><td> <select id="midi_out8" onchange="dev_change(this);"></select> </td> </tr> <tr> - <td>4</td><td> + <td id="midilabel">4</td><td> <select id="midi_out4" onchange="dev_change(this);"></select> </td> - <td align="right">9</td><td> + <td align="right" id="midilabel">9</td><td> <select id="midi_out9" onchange="dev_change(this);"></select> </td> </tr> <tr> - <td>5</td><td> + <td id="midilabel">5</td><td> <select id="midi_out5" onchange="dev_change(this);"></select> </td> - <td align="right">10</td><td> + <td align="right" id="midilabel">10</td><td> <select id="midi_out10" onchange="dev_change(this);"></select> </td> </tr> @@ -381,6 +414,11 @@ </option> </select> <br/> + <label data-i18n="[title]prefs.gui.grid.show_grid_tt"> + <input type="checkbox" id="show_grid" name="show_grid"> + <span data-i18n="prefs.gui.grid.show_grid"></span> + </label> + <br/> <label data-i18n="[title]prefs.gui.zoom.save_zoom_tt"> <input type="checkbox" id="save_zoom" name="save_zoom"> <span data-i18n="prefs.gui.zoom.save_zoom"></span> @@ -421,11 +459,12 @@ <label data-i18n="[title]prefs.startup.paths_tt"> <span data-i18n="prefs.startup.paths"></span> </label> - <div style="height:24vh; width:89vw; background:white; border: 1px solid #bbb; overflow-y:auto; overflow-x:auto; padding:0px;"> + <div style="height:24vh; background:white; border: 1px solid #bbb; width: 96.5vw; + overflow-y:auto; overflow-x:auto; padding:0px;"> <table id="startup_paths" style="width:100%; background:white;"> </table> </div> - <div class="submit_buttons"> + <div class="submit_buttons" style="width: 93%;"> <button type="button" onClick="startup_path_new()" data-i18n="[title]prefs.startup.new_tt"> <span data-i18n="prefs.startup.new"></span> </button> @@ -439,11 +478,12 @@ <label data-i18n="[title]prefs.startup.libs_tt"> <span data-i18n="prefs.startup.libs"></span> </label> - <div style="height:24vh; width:89vw; background:white; border: 1px solid #bbb; overflow-y:auto; overflow-x:auto; padding:0px;"> + <div style="height:24vh; background:white; border: 1px solid #bbb; width: 96.5vw; + overflow-y:auto; overflow-x:auto; padding:0px;"> <table id="startup_libs" style="width:100%; background:white;"> </table> </div> - <div class="submit_buttons"> + <div class="submit_buttons" style="width: 93%;"> <button type="button" onClick="startup_lib_new()" data-i18n="[title]prefs.startup.new_tt"> <span data-i18n="prefs.startup.new"></span> </button> @@ -460,7 +500,7 @@ <input type="text" id="startup_flags" name="startup_flags" - style="width:89vw"> + style="width: 96%"> </label> </div> </div> @@ -738,16 +778,25 @@ function apply(save_prefs) { ); // Send the gui prefs (currently just the name of the gui preset, the - // status of the save-zoom toggle and various options related to the help - // browser) to Pd + // status of the show_grid and save_zoom toggles and various options + // related to the help browser) to Pd pdgui.pdsend("pd gui-prefs", get_gui_preset(), + get_bool_elem("show_grid"), get_bool_elem("save_zoom"), get_bool_elem("browser_doc"), get_bool_elem("browser_path"), get_bool_elem("browser_init"), get_autopatch_yoffset() ); + // Also send the browser config to the GUI, so that it will update the + // help browser accordingly. + pdgui.update_browser( + get_bool_elem("browser_doc"), + get_bool_elem("browser_path") + ); + // Update the grid on all open windows. + pdgui.update_grid(get_bool_elem("show_grid")); // Send the startup config data to Pd pdgui.pdsend.apply(null, ["pd path-dialog", startup_use_stdpath, startup_verbose].concat(get_path_array())); @@ -991,16 +1040,37 @@ function autopatch_yoffset_toggle(checked) { document.getElementById("autopatch_yoffset").checked = checked; } -function gui_prefs_callback(name, save_zoom, browser_doc, browser_path, +function gui_prefs_callback(name, show_grid, save_zoom, browser_doc, browser_path, browser_init, autopatch_yoffset) { - var s = document.getElementById("gui_preset"), - i; - for (i = 0; i < s.options.length; i++) { + var s = document.getElementById("gui_preset"); + + // ag: scan the css subdir for user-defined styles + var predefined = // built-in styles + [ "c64.css", "default.css", "dejavu.css", "extended.css", + "footgun.css", "inverted.css", "solarized.css", + "solarized_inverted.css", "strongbad.css", "subdued.css", + "vanilla.css", "vanilla_inverted.css"]; + var fs = require('fs'); + var base = process.platform === "darwin" ? pdgui.get_lib_dir() : "."; + var files = fs.readdirSync(base + "/css/"); + files.forEach(file => { + var pos = file.lastIndexOf('.'); + var ext = file.substr(pos); + if (ext === ".css" && predefined.indexOf(file) === -1) { + var base = file.substr(0, pos); + var option = document.createElement("option"); + option.text = base; + s.add(option); + } + }); + + for (var i = 0; i < s.options.length; i++) { if (s.options[i].value.toLowerCase() === name.toLowerCase()) { s.selectedIndex = i; break; } } + document.getElementById("show_grid").checked = !!show_grid; document.getElementById("save_zoom").checked = !!save_zoom; document.getElementById("browser_doc").checked = !!browser_doc; document.getElementById("browser_path").checked = !!browser_path; @@ -1240,6 +1310,7 @@ function startup_path_delete() { function register_window_id(gfxstub, attr_arrays) { pd_object_callback = gfxstub; add_events(gfxstub); + pdgui.gui_check_for_dialog_appearance_inconsistencies(gfxstub); translate_form(); // We don't turn on rendering of the "container" div until diff --git a/pd/nw/dialog_search.html b/pd/nw/dialog_search.html index 282bb2610dae14910b0d97b1e65b0ac9139b63fc..c882574b61da563435bc255c2a93365b73bf625e 100644 --- a/pd/nw/dialog_search.html +++ b/pd/nw/dialog_search.html @@ -135,6 +135,172 @@ var toc = [ }, ]; +// ag: Some functions to add bookmarks to the toc, and save them in the user's +// personal config file. + +function toc_add_bookmarks() +{ + toc[toc.length] = { + title: "Bookmarks", + }; +} + +function toc_bookmarks() +{ + for (var i = 0, len = toc.length; i < len; i++) { + if (!toc[i].id && !toc[i].description && + toc[i].title == "Bookmarks") { + return i; + } + } + return -1; +} + +function expand_tilde(filepath) { + if (filepath[0] === '~') { + var home = pdgui.check_os("win32") ? process.env.HOMEPATH : + process.env.HOME; + return path.join(home, filepath.slice(1)); + } + return filepath; +} + +const toc_config = expand_tilde( + pdgui.check_os("win32") + ? "~/AppData/Roaming/Purr-Data/bookmarks.json" + : "~/.purr-data/bookmarks.json" +); + +function toc_save() +{ + var i = toc_bookmarks(); + if (i >= 0) { + // the actual bookmarks start at index i+1, i is the section title + var data = JSON.stringify(toc.slice(i+1), null, 2); + fs.writeFileSync(toc_config, data); + } else { + // no bookmarks, get rid of the bookmarks file if present + try { + fs.unlinkSync(toc_config); + } catch (err) { + // ignore + } + } +} + +// this should be executed just once, when the browser is first shown +function toc_load() +{ + function toc_valid(doc) { + // validate the bookmark entries + if (doc.id && doc.title) { + try { + fs.accessSync(check_dir(doc.id), fs.F_OK); + return true; + } catch (e) { + return false; + } + } else { + return false; + } + }; + var bookmarks; + try { + bookmarks = fs.readFileSync(toc_config); + try { + bookmarks = JSON.parse(bookmarks); + } catch (err) { + // might be a syntax error, if the user edited the file manually, + // so lets provide some (hopefully useful) diagnostic in the + // console + pdgui.post("error reading bookmarks: "+toc_config, "error"); + pdgui.post(err); + return; + } + } catch (err) { + // no bookmarks, just bail out + return; + } + try { + // this might still fail if the JSON we read is some (syntactically + // correct) random garbage, in this case give some diagnostic below + bookmarks = bookmarks.filter(toc_valid); + if (bookmarks && bookmarks.length > 0) { + toc_add_bookmarks(); + toc = toc.concat(bookmarks); + // this message would be shown each time the browser is opened, + // which would create a lot of noise; commented, but we leave it + // in here since it might be useful for debugging purposes + //pdgui.post("loaded bookmarks: "+toc_config); + } + } catch (err) { + pdgui.post("error reading bookmarks: "+toc_config, "error"); + pdgui.post("format error (expected an array, got " + + (typeof bookmarks === "object" ? "an " : + typeof bookmarks === "undefined" ? "" : "a ") + + typeof bookmarks + ")"); + } +} + +function toc_add_bookmark(id, title, descr) +{ + if (toc_bookmarks() < 0) { + toc_add_bookmarks(); + } + toc[toc.length] = descr ? { + id: id, + title: title, + description: descr + } : { + id: id, + title: title + }; + pdgui.post("add bookmark: "+title+" ("+id+")"); + toc_save(); +} + +function toc_delete_bookmark(id, title) +{ + var i = toc_bookmarks(); + if (i >= 0) { + var l = toc.length; + while (i < l && + (toc[i].id !== id || toc[i].title !== title)) { + i++; + } + if (i < l) { + toc.splice(i, 1); + pdgui.post("delete bookmark: "+title+" ("+id+")"); + } else { + // not found, we're done + return; + } + } else { + // no bookmarks, we're done + return; + } + if (toc_bookmarks() == toc.length-1) { + // empty bookmark section, remove the section title + toc.pop(); + } + toc_save(); +} + +function toc_is_bookmarked(id) +{ + var i = toc_bookmarks(); + if (i >= 0) { + var l = toc.length; + while (i < l && toc[i].id !== id) { + i++; + } + return i<l; + } else { + // no bookmarks + return false; + } +} + // Stop-gap translator function translate_form() { var elements = document.querySelectorAll("[data-i18n]"), @@ -157,6 +323,45 @@ function click_toc(dir) { var current_dir; +function canonical_path(dir) +{ + // normalize + dir = path.normalize(dir); + // get rid of Windows' '\', '/' works just as well and is more portable + return pdgui.defunkify_windows_path(dir); +} + +function check_dir(dirname) +{ + var absname = dirname; + if (!path.isAbsolute(dirname)) { + // A relative path is taken relative to libdir, so that, e.g., doc/* + // and extra/* can be used to access documentation in the doc and + // extra hierarchies. + absname = path.join(pdgui.get_lib_dir(), dirname); + } + try { + if (fs.lstatSync(absname).isDirectory()) + return canonical_path(absname); + } catch (err) { + } + return null; +} + +function toc_bookmark_update(dir) +{ + var bookmark = document.getElementById("bookmark_indicator"); + var rel = canonical_path(path.relative(pdgui.get_lib_dir(), dir)); + dir = canonical_path(dir); + var id = dir.length <= rel.length ? dir : rel; + bookmark.src = toc_is_bookmarked(id) ? "bookmark2.svg" : "bookmark.svg"; +} + +function toc_bookmark_status(enabled) { + document.getElementById("bookmark_indicator").style. + setProperty("opacity", enabled?"1.0":"0.5"); +} + function display_toc() { var results_elem = document.getElementById("results"), div, @@ -165,13 +370,16 @@ function display_toc() { text_node; // reset current_dir to doc current_dir = path.join(pdgui.get_lib_dir(), "doc"); + toc_bookmark_update(current_dir); + toc_bookmark_status(false); + div = document.createElement("div"); toc.forEach(function(doc, i, a) { - div = document.createElement("div"); if (doc.id) { try { - fs.accessSync(path.join(pdgui.get_lib_dir(), doc.id), fs.F_OK); + fs.accessSync(check_dir(doc.id), fs.F_OK); a = document.createElement("a"); - a.href = "javascript: click_toc('" + doc.id + "');"; + // We need to properly stringify click_toc's argument here. + a.href = "javascript: click_toc(" + JSON.stringify(doc.id) + ");"; a.textContent = doc.title; // set title to path for tooltip a.title = doc.id; @@ -202,6 +410,7 @@ function finish_build(idx) { index = idx; document.getElementById("search_text").disabled = false; clear_results(); + toc_load(); display_toc(); } @@ -230,8 +439,11 @@ function display_directory_callback(err, files) { function display_directory(dir) { current_dir = dir; + var is_doc = current_dir === path.join(pdgui.get_lib_dir(), "doc"); clear_results(); fs.readdir(dir, display_directory_callback); + toc_bookmark_update(dir); + toc_bookmark_status(!is_doc); } function file_browser_click() { @@ -242,12 +454,23 @@ function file_browser_click() { document.getElementById("file_browser").click(); } +function bookmark_indicator_click() { + toggle_bookmark(current_dir); +} + function file_browser_callback(elem) { var doc = elem.value; if (doc !== "") { - pdgui.doc_open(pdgui.defunkify_windows_path(path.dirname(doc)), - pdgui.defunkify_windows_path(path.basename(doc))); - display_directory(pdgui.defunkify_windows_path(path.dirname(doc))); + var defunkify = pdgui.defunkify_windows_path; + var dir = path.dirname(doc); + pdgui.doc_open(defunkify(dir), defunkify(path.basename(doc))); + display_directory(defunkify(dir)); + // update the search field accordingly; use a relative path if that + // makes sense, and canonicalize + var rel = canonical_path(path.relative(pdgui.get_lib_dir(), dir)); + dir = canonical_path(dir); + dir = dir.length <= rel.length ? dir : rel; + document.getElementById("search_text").value = dir; } } @@ -277,7 +500,7 @@ function console_find_text(elem, evt, callback) { } else { window.findAndReplaceDOMText(console_text, { //preset: "prose", - find: elem.value.toLowerCase(), + find: elem.value, wrap: wrap_tag }); // The searchAndReplace API is so bad you can't even know how @@ -383,14 +606,28 @@ function find_bar_shortcut(evt) { return (evt.keyCode === 70 && evt[modifier]) // <ctrl-f> } +function window_close_shortcut(evt) { + var osx = process.platform === "darwin", + modifier = osx ? "metaKey" : "ctrlKey"; + return (evt.keyCode === 87 && evt[modifier]) // <ctrl-w> +} + +function bookmark_shortcut(evt) { + var osx = process.platform === "darwin", + modifier = osx ? "metaKey" : "ctrlKey"; + return (evt.keyCode === 68 && evt[modifier]) // <ctrl-d> adds, <ctrl-shift-d> deletes a bookmark +} + function toggle_find_bar() { // this is copied from index.js m.edit.find... var find_div = document.getElementById("console_find"), find_bar_text = document.getElementById("console_find_text"), state = find_div.style.getPropertyValue("display"); if (state !== "inline") { - find_div.style.setProperty("height", "1.4em"); + find_div.style.setProperty("height", "1.2em"); find_div.style.setProperty("display", "inline"); + find_div.style.setProperty("padding-left", "3px"); + find_div.style.setProperty("padding-bottom", "9px"); window.setTimeout(function() { find_bar_text.focus(); find_bar_text.select(); @@ -404,6 +641,74 @@ function toggle_find_bar() { } } +// Adds (or deletes, if del is true) a bookmark to the toc. +function do_bookmark(dirname, del) +{ + if (current_dir === path.join(pdgui.get_lib_dir(), "doc")) { + /* We don't want to bookmark the doc directory. There's nothing + interesting to see there anyway, and, since the toc also lives + there, just bailing out at this point we prevent an interesting + race condition which arises if we try to update the toc while we're + displaying it. */ + return; + } + /* id (dirname) for the bookmark. We take this relative to the libdir if + the relative designation is shorter than the absolute path, which gives + prettier ids for documents in the doc and extra hierarchies and + siblings. Note that these ids only ever appear in the toc, never in + documents in the search database. */ + var relname = canonical_path(path.relative(pdgui.get_lib_dir(), dirname)); + dirname = canonical_path(dirname); + var id = dirname.length <= relname.length ? dirname : relname; + // Default name for the bookmark. + var name = path.basename(dirname); + // Let's check whether the directory contains a meta file from which we + // may get name and description of the external. + var meta = path.join(dirname, name+"-meta.pd"); + var meta_name, meta_descr; + try { + var data = fs.readFileSync(meta, 'utf8').replace("\n", " "); + meta_name = data.match + (/#X text \-?[0-9]+ \-?[0-9]+ NAME ([\s\S]*?);/i); + meta_descr = data.match + (/#X text \-?[0-9]+ \-?[0-9]+ DESCRIPTION ([\s\S]*?);/i); + meta_name = meta_name && meta_name.length > 1 ? + meta_name[1].trim() : null; + meta_descr = meta_descr && meta_descr.length > 1 ? + meta_descr[1].trim() : null; + // Remove the Pd escapes for commas + meta_descr = meta_descr ? + meta_descr.replace(" \\,", ",") : null; + } catch (err) { + // ignore + } + name = meta_name ? meta_name : name; + if (del) + toc_delete_bookmark(id, name); + else + toc_add_bookmark(id, name, meta_descr); + toc_bookmark_update(dirname); +} + +// Toggle bookmark for the given directory. This is invoked by clicking on +// the bookmark indicator to the right of the search field. +function toggle_bookmark(dir) +{ + var rel = canonical_path(path.relative(pdgui.get_lib_dir(), dir)); + dir = canonical_path(dir); + var id = dir.length <= rel.length ? dir : rel; + do_bookmark(dir, toc_is_bookmarked(id)); +} + +function is_special_key(key) +{ + // determine all special keys which should be handled on the spot and + // *not* be forwarded to the search text field + return key === 9 // tab key + || (key >= 16 && key <= 18) // modifier (shift, ctrl, alt) + || (key >= 33 && key <= 40); // cursor keys +} + function add_events() { // closing the Window nw.Window.get().on("close", function() { @@ -419,6 +724,10 @@ function add_events() { if (find_bar_shortcut(evt)) { toggle_find_bar(); evt.stopPropagation(); + } else if (window_close_shortcut(evt)) { + evt.stopPropagation(); + pdgui.remove_dialogwin("search"); + nw.Window.get().close(true); } else { evt.stopPropagation(); return console_find_keydown(this, evt); @@ -438,20 +747,42 @@ function add_events() { } }); + document.getElementById("bookmark_indicator").addEventListener("click", + function(evt) { + if (evt.currentTarget === document.activeElement) { + bookmark_indicator_click(); + } + }); + // Keydown in the document document.body.addEventListener("keydown", function(evt) { var input_elem = document.getElementById("search_text"), - button_elem = document.getElementById("file_browser_button"); + button_elem = document.getElementById("file_browser_button"), + button_elem2 = document.getElementById("bookmark_indicator"); if (find_bar_shortcut(evt)) { toggle_find_bar(); - } else if (evt.target === button_elem && + } else if ((evt.target === button_elem || + evt.target === button_elem2) && evt.keyCode === 10 || evt.keyCode === 13) { + } else if (is_special_key(evt.keyCode)) { } else if (evt.target !== input_elem) { input_elem.focus(); + } else if (bookmark_shortcut(evt)) { + // We assume here that current_dir is set and points to the + // directory to be bookmarked. + if (current_dir) { + evt.stopPropagation(); + do_bookmark(current_dir, evt.shiftKey); + } + } else if (window_close_shortcut(evt)) { + evt.stopPropagation(); + pdgui.remove_dialogwin("search"); + nw.Window.get().close(true); } else { // If we want to trigger a search on each keystroke we can do it // here. } + }); document.getElementById("search_text").addEventListener("search", function() { @@ -477,6 +808,7 @@ function register_window_id(id, attrs) { function display_no_results() { document.getElementById("results").textContent = l("search.no_results"); + toc_bookmark_update(current_dir); } function display_doc(doc) { @@ -499,6 +831,7 @@ function display_doc(doc) { div.appendChild(text_node); } results_elem.appendChild(div); + toc_bookmark_update(current_dir); } function doc_search() { @@ -515,16 +848,16 @@ function doc_search() { display_toc(); return; } - // if the search term is doc/* or extra/* then short circuit + // if the search term is a directory then short circuit // the search and just list the docs in that directory - if ((search_text.slice(0, 4) === "doc/" || - search_text.slice(0, 6) === "extra/") && - search_text.indexOf(" ") === -1) { - display_directory(path.join(pdgui.get_lib_dir(), search_text)); + var dirname = check_dir(search_text); + if (dirname) { + display_directory(dirname); return; } clear_results(); text_elem.blur(); + toc_bookmark_status(false); results = index.search(search_text); for (i = 0; i < results.length; i++) { doc = index.documentStore.getDoc(results[i].ref); @@ -556,11 +889,15 @@ function doc_search() { name="search_text" id="search_text" data-i18n="[title]search.search"> - <input type="image" + <input type="image" style="vertical-align:middle;" src="folder.svg" id="file_browser_button" data-i18n="[title]search.browse"> - </form> + <input type="image" style="vertical-align:middle;" + src="bookmark.svg" + id="bookmark_indicator" + data-i18n="[title]search.bookmark"> + </form> <div id="results"> </div> <div id = "console_find" style="display:none;"> @@ -571,11 +908,12 @@ function doc_search() { defaultValue="Search in Console" style="width:10em;"/> </label> - <label>Highlight All + <label style="margin-left: 7px;">Highlight All <input type="checkbox" id="console_find_highlight" name="console_find_highlight" - onchange="console_find_highlight_all(this);"/> + onchange="console_find_highlight_all(this);" + style="left: -3px;"/> </label> </div> </div> diff --git a/pd/nw/dialog_text.html b/pd/nw/dialog_text.html index 500e76badbcc685fea650d7f68ecf63eafda3aee..71e5feaa70c1716e153ea48702bf984f92fd3724 100644 --- a/pd/nw/dialog_text.html +++ b/pd/nw/dialog_text.html @@ -3,12 +3,13 @@ <head> <link id="page_style" rel="stylesheet" type="text/css" href="css/default.css"> </head> - <body class="dialog_body"> + <body class="dialog_body" onload="resize_textarea();" onresize="resize_textarea();" + style="overflow: hidden;"> <div class="container"> - <textarea id="text" style="width: 100%; box-sizing: border-box; height: 85vh; resize: none;"> + <textarea id="text" style="margin: 5px 5px 4px 5px; box-sizing: border-box; resize: none;"> </textarea> </div> - <div class="submit_buttons"> + <div class="submit_buttons" style="padding: 0px;"> <button type="button" onClick="ok()" data-i18n="[title]iem.prop.ok_tt"> <span data-i18n="iem.prop.ok"></span> </button> @@ -54,6 +55,8 @@ pdgui.skin.apply(window); var pd_object_callback; var dirty = false; +gui.Window.get().setMinimumSize(260, 70); + function apply() { var text_array = document.getElementById("text").value.split("\n"); // clear out Pd's binbuf for our text object @@ -132,7 +135,7 @@ function register_window_id(gfxstub, attr) { // nwjs window, so you'll see a flicker to the title set here if it's // not "text". We need to change this so that the title can be different // from the dialog type in nw_create_window. - document.title = attr.title; + document.title = "[" + attr.title + "] Text Editor"; } // Stop-gap translator @@ -185,6 +188,14 @@ function add_events(name) { // We leave off those bindings since Enter starts a new line in the textarea //pdgui.dialog_bindings(name); } + +function resize_textarea() { + var text = document.getElementById("text"); + var textwidth = (window.innerWidth - 10 > 200 ? (window.innerWidth - 10) : 200); + var textheight = (window.innerHeight - 40 > 21 ? (window.innerHeight - 40) : 21); + text.style.setProperty("width", textwidth + "px"); + text.style.setProperty("height", textheight + "px"); +} </script> </body> </html> diff --git a/pd/nw/folder.svg b/pd/nw/folder.svg index 6d9ea6e9f4feaf79f5bbb42ae2b8377a37e6f25c..337ef4b71e45ea78255edfd64ce02901e4c4df6d 100644 --- a/pd/nw/folder.svg +++ b/pd/nw/folder.svg @@ -1 +1,13 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20" viewBox="0 0 32 32"><defs><clipPath><path d="m69.63 12.145h-.052c-22.727-.292-46.47 4.077-46.709 4.122-2.424.451-4.946 2.974-5.397 5.397-.044.237-4.414 23.983-4.122 46.71-.292 22.777 4.078 46.523 4.122 46.761.451 2.423 2.974 4.945 5.398 5.398.237.044 23.982 4.413 46.709 4.121 22.779.292 46.524-4.077 46.761-4.121 2.423-.452 4.946-2.976 5.398-5.399.044-.236 4.413-23.981 4.121-46.709.292-22.777-4.077-46.523-4.121-46.761-.453-2.423-2.976-4.946-5.398-5.397-.238-.045-23.984-4.414-46.71-4.122"/></clipPath><linearGradient gradientUnits="userSpaceOnUse" y2="352.98" x2="-601.15" y1="663.95" x1="-591.02" id="2"><stop stop-color="#a0a0a0"/><stop offset="1" stop-color="#aaa"/></linearGradient><linearGradient gradientUnits="userSpaceOnUse" y2="354.29" x2="-704.05" y1="647.77" x1="-701.19" id="1"><stop stop-color="#acabab"/><stop offset="1" stop-color="#d4d4d4"/></linearGradient><linearGradient id="0" x1="59.12" y1="-19.888" x2="59.15" y2="-37.783" gradientUnits="userSpaceOnUse" gradientTransform="matrix(4.17478 0 0 4.16765-1069.7 447.73)"><stop stop-color="#a0a0a0"/><stop offset="1" stop-color="#bdbdbd"/></linearGradient></defs><g transform="matrix(.07089 0 0 .07017 23.295-40.67)" fill="#60aae5"><path transform="matrix(.7872 0 0 .79524 415.34 430.11)" d="m-884.1 294.78c-4.626 0-8.349 3.718-8.349 8.335v161.41l468.19 1v-121.2c0-4.618-3.724-8.335-8.35-8.335h-272.65c-8.51.751-9.607-.377-13.812-5.981-5.964-7.968-14.969-21.443-20.84-29.21-4.712-6.805-5.477-6.02-13.292-6.02z" fill="url(#0)" color="#000"/><rect transform="matrix(.7872 0 0 .79524 415.34 430.11)" y="356.85" x="-890.28" height="295.13" width="463.85" fill="url(#1)" stroke="url(#1)" stroke-width="2.378" rx="9.63"/><rect width="463.85" height="295.13" x="-890.28" y="356.85" transform="matrix(.7872 0 0 .79524 415.34 430.11)" fill="none" stroke="url(#2)" stroke-linejoin="round" stroke-linecap="round" stroke-width="5.376" rx="9.63"/></g></svg> +<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20" viewBox="0 0 16 16"> + <defs id="defs3051"> + <style type="text/css" id="current-color-scheme"> + .ColorScheme-Text { + color:#4d4d4d; + } + </style> + </defs> + <path style="fill:currentColor;fill-opacity:1;stroke:none" + d="M 2 2 L 2 3 L 2 6 L 2 7 L 2 13 L 2 14 L 14 14 L 14 13 L 14 6 L 14 5 L 14 4 L 9.0078125 4 L 7.0078125 2 L 7 2.0078125 L 7 2 L 3 2 L 2 2 z M 3 3 L 6.5917969 3 L 7.59375 4 L 7 4 L 7 4.0078125 L 6.9921875 4 L 4.9921875 6 L 3 6 L 3 3 z M 3 7 L 13 7 L 13 13 L 3 13 L 3 7 z " + class="ColorScheme-Text" + /> +</svg> diff --git a/pd/nw/index.html b/pd/nw/index.html index 32da532bc10216281b13124ef8e17e571715f6b8..7b8b9c7b14947f688236d817340e4828389505f3 100644 --- a/pd/nw/index.html +++ b/pd/nw/index.html @@ -30,20 +30,19 @@ </div> </div> <div id="console_find" style="display:none;"> - <div> - <label><input type="text" - id="console_find_text" - name="console_find_text" - defaultValue="Search in Console" - style="width:10em;"/> - </label> - <label>Highlight All - <input type="checkbox" - id="console_find_highlight" - name="console_find_highlight" - onchange="console_find_highlight_all(this);"/> - </label> - </div> + <label><input type="text" + id="console_find_text" + name="console_find_text" + defaultValue="Search in Console" + style="width:10em"/> + </label> + <label style="margin-left: 7px;">Highlight All + <input type="checkbox" + id="console_find_highlight" + name="console_find_highlight" + onchange="console_find_highlight_all(this);" + style="position: relative; top: 2px; margin-right: 5px; left: -3px;"/> + </label> </div> <script src="./console_search.js"></script> <script type="text/javascript" src="index.js"></script> diff --git a/pd/nw/index.js b/pd/nw/index.js index 65f299c3bb97ecf328c5257950b283beba3ec541..6163aae2c87f442b0f0c8dd52bc86da1c1d284cd 100644 --- a/pd/nw/index.js +++ b/pd/nw/index.js @@ -381,39 +381,36 @@ function nw_close_window(window) { window.close(true); } -function check_nwjs_version(version) { - // aggraef: check that process.versions["nw"] is at least the given version - // NOTE: We assume that "0.x.y" > "0.x", and just ignore any -beta - // suffixes if present. - var nwjs_array = process.versions["nw"].split("-")[0]. - split(".").map(Number); - var vers_array = version.split("-")[0]. - split(".").map(Number); - // lexicographic comparison - for (var i = 0; i < vers_array.length; ++i) { - if (nwjs_array.length <= i || vers_array[i] > nwjs_array[i]) - return false; - else if (vers_array[i] < nwjs_array[i]) - return true; - } - return vers_array.length <= nwjs_array.length; -} - // 0.46+ seems to be required for "null" to work. TODO: Bisect to get the // actual minimum required version for this. -var null_pos = check_nwjs_version("0.46") ? "null" : "center"; +var null_pos = pdgui.check_nw_version("0.46") ? "null" : "center"; function nw_create_window(cid, type, width, height, xpos, ypos, attr_array) { - // todo: make a separate way to format the title for OSX + // todo: make a separate way to format the title for OSX var my_title; + var win_frame = true; + var win_transparent = false; if (type === "pd_canvas") { my_title = pdgui.format_window_title( attr_array.name, attr_array.dirty, attr_array.args, attr_array.dir); + + // ico@vt.edu 2020-08-13: + // why does Windows have different innerWidth and innerHeight from other OSs? + // See pdgui.js' canvas_params for the explanation... + // ico@vt.edu 2020-08-21: this should only apply to patch windows + // 2020-10-01: this is not needed anymore since it was a bug specific to 0.14.7 + // and Windows is now using 0.24.4 + //width -= 16 * pdgui.nw_os_is_windows; + //height -= 8 * pdgui.nw_os_is_windows; } else { my_title = type; + if (type !== "search" && type !== "text") { + win_frame = false; + win_transparent = true; + } } var my_file = type === "pd_canvas" ? "pd_canvas.html" : "dialog_" + type + ".html"; @@ -427,7 +424,32 @@ function nw_create_window(cid, type, width, height, xpos, ypos, attr_array) { pos = "center"; } else { pos = null_pos; + //pdgui.post("check_os=" + pdgui.check_os("win32")); + if (pdgui.nw_os_is_linux == 1) { + ypos = ypos - pdgui.nw_menu_offset - 3; + } } + + //pdgui.post("nw_create_window w=" + width + " h=" + height); + + /* + // ico@vt.edu: instantiate default options for the window behavior + // the first two vars (transparent is currently disabled) are options + // to be passed to the window at creation time, while second two are + // activated via a function call after the window has been created + var frame_val = true, + //transparent_val = true, + resize_val = true, + topmost_val = false, + menu_val = true; + + if (frame_option !== undefined) { + pdgui.post("window_options have content"); + process_window_options(window_options, + frame_val, transparent_val, + resize_val, topmost_val); + // TODO: do stuff here + }*/ gui.Window.open(my_file, { title: my_title, // ico@vt.edu: position in 0.46.2 overrides x and y below @@ -439,9 +461,11 @@ function nw_create_window(cid, type, width, height, xpos, ypos, attr_array) { // altogether to simplify things. But we'd have to add some kind of // widget for the "Put" menu. // ico@vt.edu: on 0.46.2 this is now 25, go figure... - height: height + 25, + height: height + (pdgui.nw_menu_offset * !pdgui.nw_os_is_osx), x: xpos, - y: ypos + y: ypos, + frame: win_frame, + transparent: win_transparent }, function (new_win) { if (type === "pd_canvas") { pdgui.set_patchwin(cid, new_win); @@ -602,6 +626,7 @@ function nw_create_pd_window_menus(gui, w) { minit(m.edit.reselect, { enabled: false }); } if (osx) { + minit(m.edit.encapsulate, { enabled: false }); minit(m.edit.tidyup, { enabled: false }); minit(m.edit.font, { enabled: false }); minit(m.edit.cordinspector, { enabled: false }); @@ -615,7 +640,7 @@ function nw_create_pd_window_menus(gui, w) { if (state === "none") { text_container.style.setProperty("bottom", "1.6em"); find_bar.style.setProperty("display", "inline"); - find_bar.style.setProperty("height", "1.2em"); + //find_bar.style.setProperty("height", "1.2em"); // Don't do the following in logical time so that the // console_find keypress event won't receive this shortcut key window.setTimeout(function() { diff --git a/pd/nw/locales/de/translation.json b/pd/nw/locales/de/translation.json index 28cf2507fb0428820d6798961a9edc98d61f2fa3..73ccfc8b2cad4fb9d7911edb1f2ac4d748a75394 100644 --- a/pd/nw/locales/de/translation.json +++ b/pd/nw/locales/de/translation.json @@ -1,12 +1,11 @@ { - "hello": "world", "iem": { "prop": { "heading": { "size": "Größe und Verhalten", "messages": "Nachrichten", "label": "Etikett", - "colors": "Farben" + "colors": "Erscheinungsbild" }, "size_tt": "Größe des iemgui-Elements", "size": "Größe", @@ -42,6 +41,8 @@ "log_height_tt": "the framus intersects with the ramistan approximately at the podernoster", "steady": "stabil beim Klicken", "steady_tt": "verschiebe den Schieberegler nicht beim Klicken. Verschiebe ihn nur beim Ziehen der Maus", + "drawstyle": "Rahmen-Stil", + "drawstyle_tt": "Rahmen-Stil durch Auswahl der Elemente anpassen", "send": "Sende-Symbol", "send_tt": "Symbol zum Senden drahtloser Nachrichten an andere iemgui-Elemente oder Objekte", "receive": "Empfangs-Symbol", @@ -145,6 +146,8 @@ "reselect_tt": "Stellt die vorhergehende Selektion wieder her", "find": "Finde", "find_tt": "Finde Text in Konsole-Ausgabe", + "encapsulate": "Zusammenfassen", + "encapsulate_tt": "Fasse die aktuelle Auswahl automatisch in einem Subpatch zusammen", "tidyup": "Aufräumen", "tidyup_tt": "Richte die selektierten Objekte in geraden Zeilen und Spalten aus", "clear_console": "Konsole löschen", @@ -236,6 +239,8 @@ "visible_ancestor_tt": "Zeige den nächsten aktuell sichtbaren Vorgänger des aktuellen Fensters", "pdwin": "Pd-Fenster", "pdwin_tt": "Zeige das Pd-Hauptfenster", + "abstractions": "Abstraktionen", + "abstractions_tt": "Abstraktionen abfragen und verwalten", "media": "Medien", @@ -271,7 +276,8 @@ }, "pd_window": { "find": { - "placeholder": "Suche in der Konsole" + "placeholder": "Suche in der Konsole", + "highlight": "Alle hervorheben" } }, "canvas": { @@ -285,6 +291,20 @@ "cancel": "Abbrechen", "cancel_tt": "Kein Speichern der Änderungen und kein Schließen des Patches" }, + "abstract_dialog": { + "prompt": "Möchten Sie identische Subpatches in Abstraktionen ändern?\nKandidaten in der Subpatch-Hierarchie, ausgehend vom Stammpatch: ", + "note": "Hinweis: diese Änderungen können nicht auf einmal rückgängig gemacht werden – Änderungen in einem Subpatch können in diesem Subpatch rückgängig gemacht werden", + "single": "Nur dieser Subpatch", + "single_tt": "Ersetze den gerade gespeicherten Subpatch mit der entsprechenden Abstraktion", + "all": "Alle Kandidaten", + "all_tt": "Ersetze alle Subpatches in der Subpatch-Hierarchie, die mit dem gerade gespeicherten Subpatch identisch sind", + "none": "Keinen", + "none_tt": "Ersetze keinen der Subpatches" + }, + "warning": { + "unsaved_tt": "Es gibt ein ungesichertes Exemplar dieser Abstraktion", + "multipleunsaved_tt": "Es gibt ein weiteres ungesichertes Exemplar dieser Abstraktion" + }, "find": { "placeholder": "Suche im Patch", "search": "Suche", @@ -294,6 +314,7 @@ "menu": { "props": "Einstellungen", "open": "Öffnen", + "saveas": "Speichern unter", "help": "Hilfe", "front": "Nach vorne", "back": "Nach hinten" @@ -308,6 +329,8 @@ }, "no_scroll": "Rollbalken verbergen (experimentell)", "no_scroll_tt": "Rollbalken verbergen (experimentell)", + "no_menu": "Fenstermenü verbergen (experimentell)", + "no_menu_tt": "Fenstermenü verbergen (experimentell)", "gop": "Anzeige im übergeordneten Patch", "gop_tt": "Zeige den Inhalt dieses Patches in einem Rechteck im übergeordneten Patch", "hide_name": "Namen und Argumente verbergen", @@ -408,6 +431,10 @@ "c64": "C64", "footgun": "Fusspistole" }, + "grid": { + "show_grid": "Gitter-Hintergrund im Edit-Modus", + "show_grid_tt": "Gitter-Hintergrund im Edit-Modus anzeigen" + }, "zoom": { "save_zoom": "Speichern/Laden der Vergrößerung im Patch", "save_zoom_tt": "Speichere die aktuelle Vergrößerung mit dem Patch und stelle diese beim Laden des Patches wieder her" @@ -476,9 +503,22 @@ }, "search": { "browse": "Durchsuche die Dokumentation", + "bookmark": "Lesezeichen hinzufügen oder entfernen", "search": "Suche", "building_index": "Erstelle Index...", "no_results": "Keine Resultate gefunden.", "search_placeholder": "Suche Pd-Doku" + }, + "abstractions": { + "filebased": "Datei-basierte Abstraktionen", + "private": "Private Abstraktionen", + "global": "Globaler Geltungsbereich", + "local": "Lokaler Geltungsbereich", + "selectall": "Alles auswählen", + "selectall_tt": "Wähle alle uninstanziierten Definitionen aus", + "delete": "Löschen", + "delete_tt": "Löscht alle ausgewählten Definitionen", + "close": "Schließen", + "close_tt": "Schließt das Dialog-Fenster" } } diff --git a/pd/nw/locales/en/translation.json b/pd/nw/locales/en/translation.json index e7a8510191e040baa874336b085caaf65711450b..ee65f1aa393cb47133587fdb9a875daddab2284d 100644 --- a/pd/nw/locales/en/translation.json +++ b/pd/nw/locales/en/translation.json @@ -3,9 +3,9 @@ "prop": { "heading": { "size": "size and behavior", - "messages": "messages", + "messages": "messaging", "label": "label", - "colors": "colors" + "colors": "appearance" }, "size_tt": "size of the iemgui", "size": "size", @@ -41,6 +41,8 @@ "log_height_tt": "the framus intersects with the ramistan approximately at the podernoster", "steady": "steady on click", "steady_tt": "don't move the slider when clicked. Only move it when dragging the mouse", + "drawstyle": "frame style", + "drawstyle_tt": "adjust number frame style by toggling its elements", "send": "send symbol", "send_tt": "symbol to send wireless messages to other iemguis or objects", "receive": "receive symbol", @@ -144,6 +146,8 @@ "reselect_tt": "Restore the previous selection", "find": "Find", "find_tt": "Find text in the console output", + "encapsulate": "Encapsulate", + "encapsulate_tt": "Encapsulate automatically the current selection into a subpatch", "tidyup": "Tidy Up", "tidyup_tt": "Line up the selected objects in straight rows and columns", "clear_console": "Clear Console", @@ -152,8 +156,8 @@ "tofront_tt": "Bring the selected object visually in front of all other objects", "toback": "Send to Back", "toback_tt": "Send the selected object visually behind all other objects", - "font": "Font", - "font_tt": "Font settings for this patch", + "font": "Font Size", + "font_tt": "Font size settings for this patch", "cordinspector": "Cord Inspector", "cordinspector_tt": "Move the mouse over cords to inspect the data moving between objects", "find": "Find", @@ -235,6 +239,8 @@ "visible_ancestor_tt": "give focus to the closest ancestor of this window that is currently visible", "pdwin": "Pd Window", "pdwin_tt": "Give focus to the main Pd window", + "abstractions": "Abstractions", + "abstractions_tt": "Query and manage abstractions", "media": "Media", @@ -270,7 +276,8 @@ }, "pd_window": { "find": { - "placeholder": "Search in Console" + "placeholder": "Search in Console", + "highlight": "Highlight All" } }, "canvas": { @@ -284,6 +291,20 @@ "cancel": "Cancel", "cancel_tt": "Don't save any changes, and don't close the patch" }, + "abstract_dialog": { + "prompt": "Would you like to turn the identical subpatches into abstractions?\nCandidates found in the subpatch tree, from root canvas: ", + "note": "Note: this can't be undone all at once – any changes made in subpatches can be undone from that subpatch", + "single": "Only this one", + "single_tt": "Replace the subpatch you just saved with the corresponding abstraction", + "all": "All candidates", + "all_tt": "Replace all subpatches in the subpatch tree identical to the one you just saved with the corresponding abstraction", + "none": "None", + "none_tt": "Do not replace any subpatch" + }, + "warning": { + "unsaved_tt": "There is an unsaved edited instance of this abstraction", + "multipleunsaved_tt": "There is another unsaved edited instance of this abstraction" + }, "find": { "placeholder": "Search in Canvas", "search": "Search", @@ -293,6 +314,7 @@ "menu": { "props": "Properties", "open": "Open", + "saveas": "Save as", "help": "Help", "front": "Bring to Front", "back": "Send to Back" @@ -305,9 +327,9 @@ "viewbox_offsets": "viewbox offsets", "arrays": "array options" }, - "no_scroll": "hide scrollbars (experimental)", + "no_scroll": "hide scrollbars", "no_scroll_tt": "hide window scrollbars", - "no_menu": "hide menu (experimental)", + "no_menu": "hide menu", "no_menu_tt": "hide window menu", "gop": "graph on parent", "gop_tt": "show the inner contents of this canvas in a rectangle on the containing canvas", @@ -409,6 +431,10 @@ "c64": "C64", "footgun": "Footgun" }, + "grid": { + "show_grid": "grid background in edit mode", + "show_grid_tt": "Show the grid background in edit mode" + }, "zoom": { "save_zoom": "save/load zoom level with patch", "save_zoom_tt": "Save the current zoom level with the patch and restore it when reloading the patch" @@ -477,9 +503,22 @@ }, "search": { "browse": "browse the documentation", + "bookmark": "add or remove a bookmark", "search": "search", "building_index": "Building index...", "no_results": "No results found.", "search_placeholder": "Search Pd Docs" + }, + "abstractions": { + "filebased": "File-based abstractions", + "private": "Private abstractions", + "global": "Global scope", + "local": "Local scope", + "selectall": "Select all", + "selectall_tt": "Select all definitions with zero instances", + "delete": "Delete", + "delete_tt": "Delete all selected definitions", + "close": "Close", + "close_tt": "Close the dialog window" } } diff --git a/pd/nw/locales/fr/translation.json b/pd/nw/locales/fr/translation.json index 05bdfaf7726ec4f2375ee045eb7ed19cbae41771..ccdc3bc4b7524cabb3a5cd4a4a2b8ac2f9b74667 100644 --- a/pd/nw/locales/fr/translation.json +++ b/pd/nw/locales/fr/translation.json @@ -1,12 +1,11 @@ { - "hello": "world", "iem": { "prop": { "heading": { "size": "Taille et comportement", "messages": "Messages", "label": "Label", - "colors": "Couleurs" + "colors": "Apparence" }, "size": "Taille", "size_tt": "Taille de l'objet IemGui", @@ -42,6 +41,8 @@ "log_height_tt": "Le framus se croise avec le ramistan approximativement au paternoster !", "steady": "Fixe au clic", "steady_tt": "Ne bouge pas le curseur quand cliqué. Bouge seulement quand on le fait glisser avec la souris", + "drawstyle": "Style du cadre", + "drawstyle_tt": "Ajuster le style du cadre en choisissant ses éléments", "send": "Envoyer au symbole", "send_tt": "Messages sans-fil à envoyer à travers le Symbole vers d'autres IemGui ou Objets", "receive": "Recevoir du symbole", @@ -145,6 +146,8 @@ "reselect_tt": "Rétablir la sélection précédente", "find": "Rechercher", "find_tt": "Rechercher un texte dans la sortie de la console", + "encapsulate": "Encapsuler", + "encapsulate_tt": "Encapsuler automatiquement la sélection actuelle dans un sous-patch", "tidyup": "Arranger", "tidyup_tt": "Aligner la sélection d'objets en lignes et colonnes strictes", "clear_console": "Effacer la Console", @@ -236,6 +239,8 @@ "visible_ancestor_tt": "Donner le focus à l'ancêtre le plus proche de cette fenêtre qui est actuellement visible", "pdwin": "Fenêtre Console Pd", "pdwin_tt": "Donner le focus à la fenêtre principale de Pd", + "abstractions": "Abstractions", + "abstractions_tt": "Interroger et gérer les abstractions", "media": "Média", @@ -271,13 +276,14 @@ }, "pd_window": { "find": { - "placeholder": "Chercher dans la Console" + "placeholder": "Chercher dans la Console", + "highlight": "Surligner toutes les occurrences" } }, "canvas": { "paste_clipboard_prompt": "Attention: vous êtes sur le point de coller du 'code Pd' provenant de l'extérieur de Pd. Voulez-vous continuer ?", "save_dialog": { - "prompt": "Voulez-vous enregistrer les modifications apportées à ce patch ?", + "prompt": "Voulez-vous enregistrer les modifications apportées à ", "yes": "Oui", "yes_tt": "Enregistrer les modifications dans le fichier avant de fermer le patch ?", "no": "Non", @@ -285,6 +291,20 @@ "cancel": "Annuler", "cancel_tt": "N'enregistrer aucune modification et ne pas fermer le patch" }, + "abstract_dialog": { + "prompt": "Voudriez-vous transformer tous les sous-patchs identiques en abstractions ?\nCandidats trouvés dans l'arborescence des sous-patchs, depuis le canevas racine : ", + "note": "Note : Cela ne peut pas être défait d'un seul coup - Toutes les modifications apportées aux sous-patchs peuvent être annulées à partir de ce sous-patch", + "single": "Seulement celui-ci", + "single_tt": "Remplacer le sous-patch que vous venez de sauvegarder par l'abstraction correspondante", + "all": "Tous les candidats", + "all_tt": "Remplacer tous les sous-patchs de l'arborescence des sous-patchs identiques à celui que vous venez d'enregistrer par l'abstraction correspondante", + "none": "Aucun", + "none_tt": "Ne remplacer aucun sous-patch" + }, + "warning": { + "unsaved_tt": "Il existe une instance modifiée non enregistrée de cette abstraction", + "multipleunsaved_tt": "Il existe une autre instance modifiée non enregistrée de cette abstraction" + }, "find": { "placeholder": "Chercher dans le Canevas", "search": "Chercher", @@ -294,6 +314,7 @@ "menu": { "props": "Propriétés", "open": "Ouvrir", + "saveas": "Sauvegarder comme", "help": "Aide", "front": "Envoyer au Premier plan", "back": "Envoyer à l'Arrière plan" @@ -410,6 +431,10 @@ "c64": "C64", "footgun": "Footgun" }, + "grid": { + "show_grid": "Fond de grille en mode Édition", + "show_grid_tt": "Afficher l'arrière-plan de la grille en mode Édition" + }, "zoom": { "save_zoom": "Sauver/Charger niveau zoom avec patch", "save_zoom_tt": "Enregistrer le niveau de zoom actuel avec le patch et le restaurer lors du chargement du patch" @@ -478,9 +503,22 @@ }, "search": { "browse": "Parcourir la documentation", + "bookmark": "Ajouter ou enlever un favori", "search": "Chercher", "building_index": "Construction de l'index...", "no_results": "Aucun résultat trouvé !", "search_placeholder": "Chercher dans les Docs Pd" + }, + "abstractions": { + "filebased": "Abstractions basées sur des fichiers", + "private": "Abstractions privées", + "global": "Portée globale", + "local": "Portée locale", + "selectall": "Tout sélectionner", + "selectall_tt": "Sélectionner toutes les définitions avec zéro instance", + "delete": "Supprimer", + "delete_tt": "Supprimer toutes les définitions sélectionnées", + "close": "Fermer", + "close_tt": "Fermer la fenêtre de dialogue" } } diff --git a/pd/nw/pd_canvas.html b/pd/nw/pd_canvas.html index cd95e36555fd8078a6025e9faf3d7648768262e2..d04950e96f1ecf1e27559a98cadda8b79b3aaa51 100644 --- a/pd/nw/pd_canvas.html +++ b/pd/nw/pd_canvas.html @@ -78,8 +78,35 @@ </button> </div> </dialog> - <div id="hscroll" style="background-color: rgba(0, 0, 0, 0.267); position: fixed; left: 2px; bottom: 2px; border-radius: 0px; width: 10px; height: 5px; visibility: hidden;"></div> - <div id="vscroll" style="background-color: rgba(0, 0, 0, 0.267); position: fixed; right: 2px; top: 2px; border-radius: 0px; width: 5px; height: 10px; visibility: hidden;"></div> + <dialog id="abstract_dialog"> + <h4><span style="white-space: pre-line" + data-i18n="canvas.abstract_dialog.prompt"></span> + <span id="abstract_dialog_candidates"></span> + </h4> + <h5> <span data-i18n="canvas.abstract_dialog.note"></span> </h5> + <div class="abstract_submit_buttons"> + <button type="button" + id="abstract_single_button" + data-i18n="[title]canvas.abstract_dialog.single_tt"> + <span data-i18n="canvas.abstract_dialog.single"></span> + </button> + <button type="button" + id="abstract_all_button" + data-i18n="[title]canvas.abstract_dialog.all_tt"> + <span data-i18n="canvas.abstract_dialog.all"></span> + </button> + <button type="button" + id="abstract_none_button" + data-i18n="[title]canvas.abstract_dialog.none_tt"> + <span data-i18n="canvas.abstract_dialog.none"></span> + </button> + </div> + </dialog> + <div style="position: fixed; right: 2%; top: 2%; "> + <strong id="canvas_warning" style="display: none; text-align: right; -webkit-user-select: none; cursor: pointer;">!</strong> + </div> + <div id="hscroll" style="position: fixed; left: 0px; bottom: 0px; border-radius: 0px; width: 10px; height: 5px; visibility: hidden;"></div> + <div id="vscroll" style="position: fixed; right: 0px; top: 0px; border-radius: 0px; width: 5px; height: 10px; visibility: hidden;"></div> <script type="text/javascript" src="./pd_canvas.js"></script> </body> </html> diff --git a/pd/nw/pd_canvas.js b/pd/nw/pd_canvas.js index e7bc1ae692329ec6c02e0550b80cdee0ed6baf10..a67240a1af63dc632464c50db75f2930480bbad4 100644 --- a/pd/nw/pd_canvas.js +++ b/pd/nw/pd_canvas.js @@ -99,6 +99,22 @@ var canvas_events = (function() { return 0; } }, + target_is_canvasobj = function(evt) { + function is_canvas_obj(target) { + return target.classList.contains("obj") && + target.classList.contains("canvasobj"); + }; + // ag: A bit of (maybe over-)defensive programming here: depending + // on where exactly the user clicked, the actual object may be the + // parent or the grandparent of the clicked target. + if (evt.target.classList.contains("border") || + evt.target.classList.contains("box_text")) + return is_canvas_obj(evt.target.parentNode); + else if (evt.target.parentNode.classList.contains("box_text")) + return is_canvas_obj(evt.target.parentNode.parentNode); + else + return is_canvas_obj(evt.target); + }, text_to_normalized_svg_path = function(text) { text = text.slice(4).trim() // draw .slice(4).trim() // path @@ -383,6 +399,11 @@ var canvas_events = (function() { (pointer_y + svg_view.y), b, mod ); + // If Alt is pressed on a box_text, fake a keyup to prevent + // dangling temp runmode in case the click opens a subpatch. + if (evt.altKey && target_is_canvasobj(evt)) { + pdgui.canvas_sendkey(name, 0, evt, "Alt", 0); + } //evt.stopPropagation(); //evt.preventDefault(); }, @@ -411,10 +432,9 @@ var canvas_events = (function() { }, keydown: function(evt) { pdgui.keydown(name, evt); - // prevent the default behavior of scrolling - // on arrow keys in editmode + // prevent the default behavior of scrolling using arrow keys if (document.querySelector("#patchsvg")) { - if ([32, 37, 38, 39, 40].indexOf(evt.keyCode) > -1) { + if ([37, 38, 39, 40].indexOf(evt.keyCode) > -1) { evt.preventDefault(); } } @@ -456,6 +476,9 @@ var canvas_events = (function() { }, text_keydown: function(evt) { evt.stopPropagation(); + setTimeout(function() { + pdgui.gui_message_update_textarea_border(textbox(), 0); + }, 0); //evt.preventDefault(); return false; }, @@ -615,6 +638,8 @@ var canvas_events = (function() { canvas_events[canvas_events.get_previous_state()](); }, hscroll_mouseup: function(evt) { + document.getElementById("hscroll").style.setProperty("background-color", "rgba(0, 0, 0, 0.267)"); + document.getElementById("patchsvg").style.cursor = "default"; canvas_events[canvas_events.get_previous_state()](); }, hscroll_mousemove: function(evt) { @@ -644,6 +669,8 @@ var canvas_events = (function() { } }, vscroll_mouseup: function(evt) { + document.getElementById("vscroll").style.setProperty("background-color", "rgba(0, 0, 0, 0.267)"); + document.getElementById("patchsvg").style.cursor = "default"; canvas_events[canvas_events.get_previous_state()](); }, vscroll_mousemove: function(evt) { @@ -916,11 +943,15 @@ var canvas_events = (function() { }, hscroll_drag: function() { canvas_events.none(); + document.getElementById("hscroll").style.cssText += "background-color: rgba(0, 0, 0, 0.5) !important"; + document.getElementById("patchsvg").style.cursor = "-webkit-grabbing"; document.addEventListener("mouseup", events.hscroll_mouseup, false); document.addEventListener("mousemove", events.hscroll_mousemove, false); }, vscroll_drag: function() { canvas_events.none(); + document.getElementById("vscroll").style.cssText += "background-color: rgba(0, 0, 0, 0.5) !important"; + document.getElementById("patchsvg").style.cursor = "-webkit-grabbing"; document.addEventListener("mouseup", events.vscroll_mouseup, false); document.addEventListener("mousemove", events.vscroll_mousemove, false); }, @@ -1316,7 +1347,7 @@ function register_window_id(cid, attr_array) { // Initialize the zoom level to the value retrieved from the patch, if any. nw.Window.get().zoomLevel = attr_array.zoom; pdgui.canvas_map(cid); // side-effect: triggers gui_canvas_get_scroll - pdgui.canvas_set_editmode(cid, attr_array.editmode); + pdgui.canvas_query_editmode(cid); // For now, there is no way for the cord inspector to be turned on by // default. But if this changes we need to set its menu item checkbox // accordingly here @@ -1329,6 +1360,9 @@ function register_window_id(cid, attr_array) { // we check the title_queue to see if our title now contains an asterisk // (which is the visual cue for "dirty") + // Enable/disable the warning for multiple dirty instances + pdgui.gui_canvas_warning(cid, attr_array.warid); + // Two possibilities for handling this better: // have a representation of canvas attys in pdgui.js (editmode, dirty, etc.) // or @@ -1338,6 +1372,7 @@ function register_window_id(cid, attr_array) { nw.Window.get().title = kludge_title; } pdgui.free_title_queue(cid); + document.body.addEventListener("load", update_menu_items(cid), false); } function create_popup_menu(name) { @@ -1357,6 +1392,12 @@ function create_popup_menu(name) { pdgui.popup_action(name, 1); } })); + popup_menu.append(new gui.MenuItem({ + label: l("canvas.menu.saveas"), + click: function() { + pdgui.popup_action(name, 5); + } + })); popup_menu.append(new gui.MenuItem({ label: l("canvas.menu.help"), click: function() { @@ -1438,6 +1479,11 @@ function set_edit_menu_modals(state) { canvas_menu.edit.copy.enabled = state; canvas_menu.edit.paste.enabled = state; canvas_menu.edit.selectall.enabled = state; + canvas_menu.edit.font.enabled = state; +} + +function get_editmode_checkbox() { + return canvas_menu.edit.editmode.checked; } function set_editmode_checkbox(state) { @@ -1472,9 +1518,12 @@ function minit(menu_item, options) { } } +// used, so that we can reference menu later +var m = null; + function nw_create_patch_window_menus(gui, w, name) { // if we're on GNU/Linux or Windows, create the menus: - var m = canvas_menu = pd_menus.create_menu(gui); + m = canvas_menu = pd_menus.create_menu(gui); // File sub-entries // We explicitly enable these menu items because on OSX @@ -1626,13 +1675,89 @@ function nw_create_patch_window_menus(gui, w, name) { pdgui.pdsend(name, "reselect"); } }); + minit(m.edit.encapsulate, { + enabled: true, + click: function() { pdgui.pdsend(name, "encapsulate"); } + }); minit(m.edit.tidyup, { enabled: true, click: function() { pdgui.pdsend(name, "tidy"); } }); minit(m.edit.font, { enabled: true, - click: function () { pdgui.pdsend(name, "menufont"); } + /*click: function () { pdgui.pdsend(name, "menufont"); } */ + }); + minit(m.font.s8, { + enabled: true, + click: function () { + m.font.s8.checked = true; + m.font.s10.checked = false; + m.font.s12.checked = false; + m.font.s16.checked = false; + m.font.s24.checked = false; + m.font.s36.checked = false; + pdgui.gui_menu_font_change_size(name, 8); + } + }); + minit(m.font.s10, { + enabled: true, + click: function () { + m.font.s8.checked = false; + m.font.s10.checked = true; + m.font.s12.checked = false; + m.font.s16.checked = false; + m.font.s24.checked = false; + m.font.s36.checked = false; + pdgui.gui_menu_font_change_size(name, 10); + } + }); + minit(m.font.s12, { + enabled: true, + click: function () { + m.font.s8.checked = false; + m.font.s10.checked = false; + m.font.s12.checked = true; + m.font.s16.checked = false; + m.font.s24.checked = false; + m.font.s36.checked = false; + pdgui.gui_menu_font_change_size(name, 12); + } + }); + minit(m.font.s16, { + enabled: true, + click: function () { + m.font.s8.checked = false; + m.font.s10.checked = false; + m.font.s12.checked = false; + m.font.s16.checked = true; + m.font.s24.checked = false; + m.font.s36.checked = false; + pdgui.gui_menu_font_change_size(name, 16); + } + }); + minit(m.font.s24, { + enabled: true, + click: function () { + m.font.s8.checked = false; + m.font.s10.checked = false; + m.font.s12.checked = false; + m.font.s16.checked = false; + m.font.s24.checked = false; + m.font.s36.checked = false; + pdgui.gui_menu_font_change_size(name, 24); + } + }); + minit(m.font.s36, { + enabled: true, + click: function () { + m.font.s8.checked = false; + m.font.s10.checked = false; + m.font.s12.checked = false; + m.font.s16.checked = false; + m.font.s24.checked = false; + m.font.s36.checked = true; + pdgui.gui_menu_font_change_size(name, 36); + } }); minit(m.edit.cordinspector, { enabled: true, @@ -1907,6 +2032,12 @@ function nw_create_patch_window_menus(gui, w, name) { pdgui.raise_pd_window(); } }); + minit(m.win.abstractions, { + enabled: true, + click: function () { + pdgui.pdsend(name, "getabstractions"); + } + }); // Media menu minit(m.media.audio_on, { @@ -1975,3 +2106,42 @@ function nw_create_patch_window_menus(gui, w, name) { } }); } + +function init_menu_font_size(size) { + //pdgui.post("init_menu_font_size " + size); + m.font.s8.checked = false; + m.font.s10.checked = false; + m.font.s12.checked = false; + m.font.s16.checked = false; + m.font.s24.checked = false; + m.font.s36.checked = false; + + switch(size) + { + case 8: + m.font.s8.checked = true; + break; + case 10: + m.font.s10.checked = true; + break; + case 12: + m.font.s12.checked = true; + break; + case 16: + m.font.s16.checked = true; + break; + case 24: + m.font.s24.checked = true; + break; + case 36: + m.font.s36.checked = true; + break; + } +} + +// ico@vt.edu 2020-08-24: this is called when the window is finally +// loaded and then asks libpd to tell us what is the font state +// LATER: we can use this to also update the undo state appropriately +function update_menu_items(cid) { + pdgui.pdsend(cid, "updatemenu"); +} diff --git a/pd/nw/pd_menus.js b/pd/nw/pd_menus.js index cfbc48f25c561eb3a760906db1ce9a31eb4e7700..0e3646546aef68d406085f90b7e36a24411df77a 100644 --- a/pd/nw/pd_menus.js +++ b/pd/nw/pd_menus.js @@ -25,7 +25,8 @@ function create_menu(gui, type) { put_menu, winman_menu, media_menu, - help_menu; + help_menu, + font_submenu; // We only maintain a single instance of the recent files submenu which // gets updated in pdgui.js via a callback from the engine. @@ -37,6 +38,41 @@ function create_menu(gui, type) { pdgui.populate_recent_files(recent_files_submenu); } + // File sub-entries + m.font = {}; + font_submenu = new gui.Menu(); + + font_submenu.append(m.font.s8 = new gui.MenuItem({ + label: 8, + tooltip: 8, + type: "checkbox" + })); + font_submenu.append(m.font.s10 = new gui.MenuItem({ + label: 10, + tooltip: 10, + type: "checkbox" + })); + font_submenu.append(m.font.s12 = new gui.MenuItem({ + label: 12, + tooltip: 12, + type: "checkbox" + })); + font_submenu.append(m.font.s16 = new gui.MenuItem({ + label: 16, + tooltip: 16, + type: "checkbox" + })); + font_submenu.append(m.font.s24 = new gui.MenuItem({ + label: 24, + tooltip: 24, + type: "checkbox" + })); + font_submenu.append(m.font.s36 = new gui.MenuItem({ + label: 36, + tooltip: 36, + type: "checkbox" + })); + // OSX just spawns a single canvas menu and then enables/disables // the various menu items as needed. canvas_menu = osx || (type !== "console"); @@ -278,16 +314,26 @@ function create_menu(gui, type) { })); edit_menu.append(new gui.MenuItem({ type: "separator" })); if (canvas_menu) { + edit_menu.append(m.edit.encapsulate = new gui.MenuItem({ + label: l("menu.encapsulate"), + key: shortcuts.menu.encapsulate.key, + modifiers: shortcuts.menu.encapsulate.modifiers, + tooltip: l("menu.encapsulate_tt") + })); edit_menu.append(m.edit.tidyup = new gui.MenuItem({ label: l("menu.tidyup"), key: shortcuts.menu.tidyup.key, modifiers: shortcuts.menu.tidyup.modifiers, tooltip: l("menu.tidyup_tt") })); + edit_menu.append(m.edit.font = new gui.MenuItem({ label: l("menu.font"), - tooltip: l("menu.font_tt") + tooltip: l("menu.font_tt"), + submenu: font_submenu })); + + edit_menu.append(m.edit.cordinspector = new gui.MenuItem({ type: "checkbox", label: l("menu.cordinspector"), @@ -533,6 +579,11 @@ function create_menu(gui, type) { key: shortcuts.menu.pdwin.key, modifiers: shortcuts.menu.pdwin.modifiers })); + winman_menu.append(new gui.MenuItem({ type: "separator" })); + winman_menu.append(m.win.abstractions = new gui.MenuItem({ + label: l("menu.abstractions"), + tooltip: l("menu.abstractions_tt") + })); } // Media menu diff --git a/pd/nw/pd_shortcuts.js b/pd/nw/pd_shortcuts.js index 4e140856cd55862a785b271757532fbdfa95d13a..a0f2bfd6055a56953769a165fc6a32d11bc6c0a4 100644 --- a/pd/nw/pd_shortcuts.js +++ b/pd/nw/pd_shortcuts.js @@ -24,6 +24,7 @@ exports.menu = { "reselect": { key: String.fromCharCode(10), modifiers: cmd_or_ctrl }, "clear_console": { key: "l", modifiers: cmd_or_ctrl + "+shift" }, + "encapsulate": { key: "e", modifiers: cmd_or_ctrl + "+shift" }, "tidyup": { key: "y", modifiers: cmd_or_ctrl }, "cordinspector": { key: "r", modifiers: cmd_or_ctrl + "+shift" }, "find": { key: "f", modifiers: cmd_or_ctrl }, diff --git a/pd/nw/pdgui.js b/pd/nw/pdgui.js index 9ca168fb4e4e3b1350897c722aa25aa354d7e95f..ed52ab0a6d4f56bea3e3fd466530d613219a63d1 100644 --- a/pd/nw/pdgui.js +++ b/pd/nw/pdgui.js @@ -74,6 +74,29 @@ exports.set_focused_patchwin = function(cid) { last_focused = cid; } +// ico@vt.edu 2020-08-12: check which OS we have since Windows has a different +// windows positioning logic on nw.js 0.14.7 than Linux/OSX. Go figure... +function check_os(name) { + + var os = require('os'); + //post("os=" + os.platform()); + return os.platform() === name ? 1 : 0; +} + +exports.check_os = check_os; + +// ico@vt.edu 2020-08-14: used to speed-up window size consistency and other +// OS-centric operations by avoiding constant calls to string comparisons. +// Most pertinent calls can be found in index.js' nw_create_window and pdgui.js' +// canvas_check_geometry +var nw_os_is_linux = check_os("linux"); +var nw_os_is_osx = check_os("darwin"); +var nw_os_is_windows = check_os("win32"); + +exports.nw_os_is_linux = nw_os_is_linux; +exports.nw_os_is_osx = nw_os_is_osx; +exports.nw_os_is_windows = nw_os_is_windows; + // Keyword index (cf. dialog_search.html) var fs = require("fs"); @@ -81,14 +104,30 @@ var path = require("path"); var dive = require("./dive.js"); // small module to recursively search dirs var elasticlunr = require("./elasticlunr.js"); // lightweight full-text search engine in JavaScript, cf. https://github.com/weixsong/elasticlunr.js/ -var index = elasticlunr(); - -index.addField("title"); -index.addField("keywords"); -index.addField("description"); -//index.addField("body"); -index.addField("path"); -index.setRef("id"); +function init_elasticlunr() +{ + index = elasticlunr(); + index.addField("title"); + index.addField("keywords"); + index.addField("description"); + //index.addField("body"); + index.addField("path"); + index.setRef("id"); + return index; +} + +var index = init_elasticlunr(); +var index_cache = new Array(); +var index_manif = new Set(); + +function index_entry_esc(s) { + if (s) { + var t = s.replace(/\\/g, "\\\\").replace(/:/g, "\\:"); + return t.replace(/(?:\r\n|\r|\n)/g, "\\n"); + } else { + return ""; + } +} function add_doc_to_index(filename, data) { var title = path.basename(filename, ".pd"), @@ -111,6 +150,12 @@ function add_doc_to_index(filename, data) { if (title.slice(-5) === "-help") { title = title.slice(0, -5); } + index_cache[index_cache.length] = [filename, title, keywords, desc] + .map(index_entry_esc).join(":"); + var d = path.dirname(filename); + index_manif.add(d); + // Also add the parent directory to catch additions of siblings. + index_manif.add(path.dirname(d)); index.addDoc({ "id": filename, "title": title, @@ -142,21 +187,82 @@ function read_file(err, filename, stat) { var index_done = false; var index_started = false; +var index_start_time; + +// Filenames for the index cache, relative to the user's homedir. +const cache_basename = nw_os_is_windows + ? "~/AppData/Roaming/Purr-Data/search" + : "~/.purr-data/search"; +const cache_name = cache_basename + ".index"; +const stamps_name = cache_basename + ".stamps"; function finish_index() { index_done = true; - post("finished building help index"); + var have_cache = index_cache.length > 0; + try { + // write the index cache if we have one + if (have_cache) { + var a = new Array(); + index_manif.forEach(function(x) { + var st = fs.statSync(x); + a[a.length] = index_entry_esc(x) + ":" + st.mtimeMs; + }); + a.sort(); + // Make sure that the target dir exists: + try { + fs.mkdirSync(expand_tilde(path.dirname(cache_name))); + } catch (err) { + //console.log(err); + } + fs.writeFileSync(expand_tilde(cache_name), + index_cache.join("\n"), {mode: 0o644}); + // also write a manifest with the timestamps of all directories: + fs.writeFileSync(expand_tilde(stamps_name), + a.join("\n"), {mode: 0o644}); + } + } catch (err) { + console.log(err); + } + var t = new Date().getTime() / 1000; + post("finished " + (have_cache?"building":"loading") + " help index (" + + (t-index_start_time).toFixed(2) + " secs)"); } // AG: pilfered from https://stackoverflow.com/questions/21077670 function expand_tilde(filepath) { if (filepath[0] === '~') { - return path.join(process.env.HOME, filepath.slice(1)); + var home = nw_os_is_windows ? process.env.HOMEPATH : process.env.HOME; + return path.join(home, filepath.slice(1)); } return filepath; } -// AG: This is supposed to be executed only once, after lib_dir has been set. +function check_timestamps(manif) +{ + manif = manif.split('\n'); + for (var j = 0, l = manif.length; j < l; j++) { + if (manif[j]) { + var e = manif[j].replace(/\\:/g, "\x1c").split(':') + .map(x => x + .replace(/\x1c/g, ":") + .replace(/\\n/g, "\n") + .replace(/\\\\/g, "\\")); + var dirname = e[0] ? e[0] : null; + var stamp = e[1] ? parseFloat(e[1]) : 0.0; + try { + var st = fs.statSync(dirname); + if (st.mtimeMs > stamp) { + return false; + } + } catch (err) { + return false; + } + } + } + return true; +} + +// AG: This is normally executed only once, after lib_dir has been set. // Note that dive() traverses lib_dir asynchronously, so we report back in // finish_index() when this is done. function make_index() { @@ -181,9 +287,50 @@ function make_index() { finish_index(); } } + pdsend("pd gui-busy 1"); index_started = true; - post("building help index in " + doc_path); - dive(doc_path, read_file, browser_path?make_index_cont:finish_index); + index_start_time = new Date().getTime() / 1000; + var idx, manif; + try { + // test for index cache and manifest + idx = fs.readFileSync + (expand_tilde(cache_name), 'utf8'); + manif = fs.readFileSync + (expand_tilde(stamps_name), 'utf8'); + } catch (err) { + //console.log(err); + } + if (idx && manif && check_timestamps(manif)) { + // index cache is present and up-to-date, load it + post("loading cached help index from " + cache_name); + idx = idx.split('\n'); + for (var j = 0, l = idx.length; j < l; j++) { + if (idx[j]) { + var e = idx[j].replace(/\\:/g, "\x1c").split(':') + .map(x => x + .replace(/\x1c/g, ":") + .replace(/\\n/g, "\n") + .replace(/\\\\/g, "\\")); + var filename = e[0] ? e[0] : null; + var title = e[1] ? e[1] : null; + var keywords = e[2] ? e[2] : null; + var descr = e[3] ? e[3] : null; + index.addDoc({ + "id": filename, + "title": title, + "keywords": keywords, + "description": descr + }); + } + } + finish_index(); + } else { + // no index cache, or it is out of date, so (re)build it now, and + // save the new cache along the way + post("building help index in " + doc_path); + dive(doc_path, read_file, browser_path?make_index_cont:finish_index); + } + pdsend("pd gui-busy 0"); } // AG: This is called from dialog_search.html with a callback that expects to @@ -206,6 +353,42 @@ function build_index(cb) { exports.build_index = build_index; +// this doesn't actually rebuild the index, it just clears it, so that it +// will be rebuilt the next time the help browser is opened +function rebuild_index() +{ + post("clearing help index (reopen browser to rebuild!)"); + index = init_elasticlunr(); + index_started = index_done = false; + try { + fs.unlink(expand_tilde(cache_name)); + fs.unlink(expand_tilde(stamps_name)); + } catch (err) { + //console.log(err); + } +} + +// this is called from the gui tab of the prefs dialog +function update_browser(doc_flag, path_flag) +{ + var changed = false; + doc_flag = doc_flag?1:0; + path_flag = path_flag?1:0; + if (browser_doc !== doc_flag) { + browser_doc = doc_flag; + changed = true; + } + if (browser_path !== path_flag) { + browser_path = path_flag; + changed = true; + } + if (changed) { + rebuild_index(); + } +} + +exports.update_browser = update_browser; + // Modules var cp = require("child_process"); // for starting core Pd from GUI in OSX @@ -793,13 +976,43 @@ function pd_geo_string(w, h, x, y) { return [w,"x",h,"+",x,"+",y].join(""); } +// ico@vt.edu: we moved this from index.js, so that we can use the versioning +// to also deal with weird offsets between nwjs 0.14/0.24 and 0.46 and upwards +function check_nw_version(version) { + // aggraef: check that process.versions["nw"] is at least the given version + // NOTE: We assume that "0.x.y" > "0.x", and just ignore any -beta + // suffixes if present. + var nwjs_array = process.versions["nw"].split("-")[0]. + split(".").map(Number); + var vers_array = version.split("-")[0]. + split(".").map(Number); + // lexicographic comparison + for (var i = 0; i < vers_array.length; ++i) { + if (nwjs_array.length <= i || vers_array[i] > nwjs_array[i]) + return false; + else if (vers_array[i] < nwjs_array[i]) + return true; + } + return vers_array.length <= nwjs_array.length; +} + +exports.check_nw_version = check_nw_version; + +// ico@vt.edu 2020-08-11: this appears to have to be 25 at all times +// we will leave this here for later if we encounter issues with inconsistencies +// across different nw.js versions... +var nw_menu_offset = check_nw_version("0.46") ? 25 : 25; + +exports.nw_menu_offset = nw_menu_offset; + // quick hack so that we can paste pd code from clipboard and // have it affect an empty canvas' geometry // requires nw.js API function gui_canvas_change_geometry(cid, w, h, x, y) { gui(cid).get_nw_window(function(nw_win) { nw_win.width = w; - nw_win.height = h + 23; // 23 is a kludge to account for menubar + // nw_menu_offset is a kludge to account for menubar + nw_win.height = h + nw_menu_offset; nw_win.x = x; nw_win.y = y; }); @@ -816,21 +1029,32 @@ function canvas_check_geometry(cid) { // in nw_create_window of index.js // ico@vt.edu in 0.46.2 this is now 25 pixels, so I guess // it is now officially kludge^2 - win_h = patchwin[cid].height - 25, + win_h = patchwin[cid].height - + (nw_menu_offset * !nw_os_is_osx), win_x = patchwin[cid].x, win_y = patchwin[cid].y, cnv_width = patchwin[cid].window.innerWidth, - cnv_height = patchwin[cid].window.innerHeight - 25; + cnv_height = patchwin[cid].window.innerHeight; + //post("canvas_check_geometry w=" + win_w + " h=" + win_h + + // " x=" + win_x + " y=" + win_y + "cnv_w=" + cnw_width + " cnv_h=" + cnv_height); + + // ico@vt.edu 2020-08-31: + // why does Windows have different innerWidth and innerHeight from other OSs? + // See canvas_params for the explanation... + // 2020-10-01: this was a bug in 0.14.7 but is no longer needed + //win_w += 16 * nw_os_is_windows; + //win_h += 8 * nw_os_is_windows; + // We're reusing win_x and win_y below, as it // shouldn't make a difference to the bounds - // algorithm in Pd (ico@vt.edu: this is not true anymore) + // algorithm in Pd (ico@vt.edu: this is not true anymore for nw 0.46+) //post("relocate " + pd_geo_string(cnv_width, cnv_height, win_x, win_y) + " " + // pd_geo_string(cnv_width, cnv_height, win_x, win_y)); - // ico@vt.edu: replaced first pd_geo_string's first two args (originally - // win_x and win_y with cnv_width and cnv_height + 25 to ensure the window - // reopens exactly how it was saved) + // IMPORTANT! ico@vt.edu: for nw 0.46+ we will need to replace first pd_geo_string's + // first two args (win_w and win_h with cnv_width and cnv_height + nw_menu_offset + // to ensure the window reopens exactly how it was saved) pdsend(cid, "relocate", - pd_geo_string(cnv_width, cnv_height + 25, win_x, win_y), + pd_geo_string(win_w, win_h, win_x, win_y), pd_geo_string(cnv_width, cnv_height, win_x, win_y) ); } @@ -896,7 +1120,7 @@ function gui_canvas_saveas(name, initfile, initdir, close_flag) { type: "file", id: "saveDialog", // using an absolute path here, see comment above - nwsaveas: path.join(initdir, initfile), + nwsaveas: check_nw_version("0.46") ? initfile : path.join(initdir, initfile), nwworkingdir: initdir, accept: ".pd" }); @@ -938,52 +1162,17 @@ function menu_saveas(name) { exports.menu_saveas = menu_saveas; function gui_canvas_print(name, initfile, initdir) { - // AG: This works mostly like gui_canvas_saveas above, except that we - // create a pdf file and use a different input element and callback. - var input, chooser, - span = patchwin[name].window.document.querySelector("#printDialogSpan"); - if (!fs.existsSync(initdir)) { - initdir = pwd; - } - // If we don't have a ".pd" file extension (e.g., "Untitled-1", add one) - if (initfile.slice(-3) !== ".pd") { - initfile += ".pd"; - } - // Adding an "f" now gives .pdf which is what we want. - initfile += "f"; - input = build_file_dialog_string({ - style: "display: none;", - type: "file", - id: "printDialog", - nwsaveas: path.join(initdir, initfile), - nwworkingdir: initdir, - accept: ".pdf" - }); - span.innerHTML = input; - chooser = patchwin[name].window.document.querySelector("#printDialog"); - chooser.onchange = function() { - print_callback(name, this.value); - // reset value so that we can open the same file twice - this.value = null; - console.log("tried to print something"); - } - chooser.click(); -} - -function print_callback(cid, file) { - var filename = defunkify_windows_path(file); - // It probably isn't possible to arrive at the callback with an - // empty string. But I've only tested on Debian so far... - if (filename === null) { - return; - } - // Let nw.js do the rest (requires nw.js 0.14.6+) - patchwin[cid].print({ pdf_path: filename, headerFooterEnabled: false }); - post("printed to: " + filename); + // AG: The print dialog presents its own file picker anyway if PDF + // output is chosen, and just ignores the settings for pdf_path. So + // initfile and initdir are only used here to provide a useful default + // for the header and footer information -- otherwise the print() method + // uses some random internal document URL which isn't helpful. + pdsend("pd gui-busy 1"); + patchwin[name].print({ autoprint: false, headerString: initfile, footerString: path.join(initdir, initfile) }); + pdsend("pd gui-busy 0"); + post("printed "+initfile); } -exports.print_callback = print_callback; - function menu_print(name) { pdsend(name + " menuprint"); } @@ -1122,6 +1311,48 @@ function gui_canvas_menuclose(cid_for_dialog, cid, force) { }, 450); } +function canvas_abstract_callback(cid_for_dialog, cid, matches) { + var nw = patchwin[cid_for_dialog], + w = nw.window, + doc = w.document, + dialog = doc.getElementById("abstract_dialog"), + dialog_candidates = doc.getElementById("abstract_dialog_candidates"), + single_button = doc.getElementById("abstract_single_button"), + all_button = doc.getElementById("abstract_all_button"), + none_button = doc.getElementById("abstract_none_button"); + + dialog_candidates.textContent = matches.toString(); + dialog_candidates.title = matches.toString() + all_button.disabled = (matches === 1); + + single_button.onclick = function() { + dialog.close(); + w.canvas_events[w.canvas_events.get_previous_state()](); + pdsend(cid, "dialog", 0); + }; + all_button.onclick = function() { + dialog.close(); + w.canvas_events[w.canvas_events.get_previous_state()](); + pdsend(cid, "dialog", 1); + }; + none_button.onclick = function() { + dialog.close(); + w.canvas_events[w.canvas_events.get_previous_state()](); + } + + w.canvas_events.none(); + + w.setTimeout(function() { + dialog.showModal(); + }, 150); +} + +function gui_canvas_abstract(cid_for_dialog, cid, matches) { + setTimeout(function() { + canvas_abstract_callback(cid_for_dialog, cid, matches); + }, 450); +} + function gui_quit_dialog() { gui_raise_pd_window(); var reply = pd_window.window.confirm("Really quit?"); @@ -1134,21 +1365,61 @@ function gui_quit_dialog() { function menu_send(name) { var message, win = name ? patchwin[name] : pd_window; + pdsend("pd gui-busy 1"); message = win.window.prompt("Type a message to send to Pd", name); + pdsend("pd gui-busy 0"); if (message != undefined && message.length) { post("Sending message to Pd: " + message + ";"); pdsend(message); } } +/* +ico@vt.edu 20200907: added svg tiled background to reflect edit mode and +integrated it into the canvas_set_editmode below. + +LATER: consider adding an interim version that reflects only the ctrl button press +*/ +var gui_editmode_svg_background = "url(\"data:image/svg+xml,%3Csvg " + + "xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 " + + " 100 100'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%239C92AC' fill-opacity" + + "='0.4'%3E%3Cpath opacity='.5' d='M96 95h4v1h-4v4h-1v-4h-9v4h-1v-4h-9v4h-1" + + "v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4H0v-" + + "1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9" + + "H0v-1h15v-9H0v-1h15V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9" + + "V0h1v15h9V0h1v15h9V0h1v15h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v" + + "1h-4v9h4v1h-4v9h4v1h-4v9zm-1 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h" + + "9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-1" + + "0 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9" + + "h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-" + + "10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9" + + "h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9" + + "v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h" + + "9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h" + + "9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-1" + + "0 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-" + + "9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm1" + + "0 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9" + + "h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9" + + "h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0" + + "h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9z'/%3E%3Cpath d" + + "='M6 5V0H5v5H0v1h5v94h1V6h94V5H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E\")"; + // requires nw.js API (Menuitem) function canvas_set_editmode(cid, state) { gui(cid).get_elem("patchsvg", function(patchsvg, w) { w.set_editmode_checkbox(state !== 0 ? true : false); if (state !== 0) { patchsvg.classList.add("editmode"); + if (showgrid[cid]) { + //post("editmode:" + gui_editmode_svg_background); + patchwin[cid].window.document.body.style.setProperty + ("background-image", gui_editmode_svg_background); + } } else { patchsvg.classList.remove("editmode"); + patchwin[cid].window.document.body.style.setProperty("background-image", + "none"); } }); } @@ -1159,6 +1430,32 @@ function gui_canvas_set_editmode(cid, state) { canvas_set_editmode(cid, state); } +// ask the engine about the current edit mode +function canvas_query_editmode(cid) { + pdsend(cid, "query-editmode"); +} + +exports.canvas_query_editmode = canvas_query_editmode; + +function update_grid(grid) { + // Update the grid background of all canvas windows when the corresponding + // option in the gui prefs changes. + var bg = grid != 0 ? gui_editmode_svg_background : "none"; + for (var cid in patchwin) { + gui(cid).get_elem("patchsvg", function(patchsvg, w) { + var editmode = patchsvg.classList.contains("editmode"); + if (editmode) { + patchwin[cid].window.document.body.style.setProperty + ("background-image", bg); + } + }); + } + // Also update the showgrid flags. + set_showgrid(grid); +} + +exports.update_grid = update_grid; + // requires nw.js API (Menuitem) function gui_canvas_set_cordinspector(cid, state) { patchwin[cid].window.set_cord_inspector_checkbox(state !== 0 ? true : false); @@ -1415,6 +1712,7 @@ var scroll = {}, redo = {}, font = {}, doscroll = {}, + showgrid = {}, last_loaded, // last loaded canvas last_focused, // last focused canvas (doesn't include Pd window or dialogs) loading = {}, @@ -1425,6 +1723,12 @@ var scroll = {}, var patchwin = {}; // object filled with cid: [Window object] pairs var dialogwin = {}; // object filled with did: [Window object] pairs +var set_showgrid = function(grid) { + for (var cid in showgrid) { + showgrid[cid] = grid; + } +} + exports.get_patchwin = function(name) { return patchwin[name]; } @@ -1523,6 +1827,8 @@ function gui_canvas_cursor(cid, pd_event_type) { function canvas_sendkey(cid, state, evt, char_code, repeat) { var shift = evt.shiftKey ? 1 : 0, repeat_number = repeat ? 1 : 0; + //post("canvas_sendkey state=" + state + " evt=" + evt + + // " char_code=<" + char_code + "> repeat=" + repeat); pdsend(cid, "key", state, char_code, shift, 1, repeat_number); } @@ -1582,7 +1888,7 @@ function create_window(cid, type, width, height, xpos, ypos, attr_array) { } // create a new canvas -function gui_canvas_new(cid, width, height, geometry, zoom, editmode, name, dir, dirty_flag, hide_scroll, hide_menu, has_toplevel_scalars, cargs) { +function gui_canvas_new(cid, width, height, geometry, grid, zoom, editmode, name, dir, dirty_flag, warid, hide_scroll, hide_menu, has_toplevel_scalars, cargs) { // hack for buggy tcl popups... should go away for node-webkit //reset_ctrl_on_popup_window @@ -1609,6 +1915,7 @@ function gui_canvas_new(cid, width, height, geometry, zoom, editmode, name, dir, redo[cid] = false; font[cid] = 10; doscroll[cid] = 0; + showgrid[cid] = grid != 0; toplevel_scalars[cid] = has_toplevel_scalars; // geometry is just the x/y screen offset "+xoff+yoff" geometry = geometry.slice(1); // remove the leading "+" @@ -1627,6 +1934,8 @@ function gui_canvas_new(cid, width, height, geometry, zoom, editmode, name, dir, last_loaded = cid; // Not sure why resize and topmost are here-- but we'll pass them on for // the time being... + // ico@vt.edu 2020-08-24: this is because in 1.x we can change these window + // properties via scripting. We should add this to 2.x soon... create_window(cid, "pd_canvas", width, height, xpos, ypos, { menu_flag: menu_flag, @@ -1636,6 +1945,7 @@ function gui_canvas_new(cid, width, height, geometry, zoom, editmode, name, dir, name: name, dir: dir, dirty: dirty_flag, + warid: warid, args: cargs, zoom: zoom, editmode: editmode, @@ -2133,7 +2443,7 @@ exports.gui = gui; // In the future, it might make sense to combine the scalar and object // creation, in which case a flag to toggle the offset would be appropriate. -function gui_gobj_new(cid, tag, type, xpos, ypos, is_toplevel) { +function gui_gobj_new(cid, tag, type, xpos, ypos, is_toplevel, is_canvas_obj) { var g; xpos += 0.5, ypos += 0.5, @@ -2142,7 +2452,7 @@ function gui_gobj_new(cid, tag, type, xpos, ypos, is_toplevel) { g = create_item(cid, "g", { id: tag + "gobj", transform: transform_string, - class: type + (is_toplevel !== 0 ? "" : " gop") + class: type + (is_toplevel !== 0 ? "" : " gop") + (is_canvas_obj === 0 ? "" : " canvasobj") }); add_gobj_to_svg(svg_elem, g); }); @@ -2263,6 +2573,36 @@ function message_border_points(width, height) { .join(" "); } +// called from pd_canvas.js text events to deal with +// the drawing of the msg box +function gui_message_update_textarea_border(elem, init_width) { + if (elem.classList.contains("msg")) { + if (init_width) { + var i, ncols = 0, + text = elem.innerHTML, + textByLine = text.split(/\r*\n/); + for (i = 0; i < textByLine.length; i++) { + if (textByLine[i].length > ncols) { + ncols = textByLine[i].length; + } + } + configure_item(elem, { + cols: ncols + }); + gui_gobj_erase_io(elem.getAttribute("cid"), elem.getAttribute("tag")); + } + + gui_message_redraw_border( + elem.getAttribute("cid"), + elem.getAttribute("tag"), + parseInt(elem.offsetWidth / elem.getAttribute("font_width")) * elem.getAttribute("font_width") + 4, + parseInt(elem.offsetHeight / elem.getAttribute("font_height")) * elem.getAttribute("font_height") + 4 + ); + } +} + +exports.gui_message_update_textarea_border = gui_message_update_textarea_border; + function gui_message_draw_border(cid, tag, width, height) { gui(cid).get_gobj(tag) .append(function(frag) { @@ -2361,7 +2701,9 @@ function gui_atom_redraw_border(cid, tag, type, width, height) { } // draw a patch cord -function gui_canvas_line(cid,tag,type,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10) { +// ico@vt.edu: p11 added to provide different color for when the cord is +// being created vs when it is being finished +function gui_canvas_line(cid,tag,type,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11) { gui(cid).get_elem("patchsvg") .append(function(frag) { var svg = get_item(cid, "patchsvg"), @@ -2379,12 +2721,14 @@ function gui_canvas_line(cid,tag,type,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10) { d: d_array.join(" "), fill: "none", //"shape-rendering": "optimizeSpeed", - id: tag, - "class": "cord " + type + id: tag, + "class": "cord " + type + (p11 == 1 ? " new" : "") }); frag.appendChild(path); return frag; }); + // ico@vt.edu 2020-08-12: update scroll when cord is drawn + gui_canvas_get_scroll(cid); } function gui_canvas_select_line(cid, tag) { @@ -2404,6 +2748,8 @@ function gui_canvas_delete_line(cid, tag) { gui(cid).get_elem(tag, function(e) { e.parentNode.removeChild(e); }); + // ico@vt.edu 2020-08-12: update scroll when cord is deleted + gui_canvas_get_scroll(cid); } function gui_canvas_update_line(cid, tag, x1, y1, x2, y2, yoff) { @@ -2539,7 +2885,20 @@ function gobj_font_y_kludge(fontsize) { function gui_text_new(cid, tag, type, isselected, left_margin, font_height, text, font) { //ico@vt.edu: different text spacing for GOPs + //post("gui_text_new type=" + type + " tag=" + tag); var xoff = 0.5; // Default value for normal objects, GOP uses -0.5 + /* ico@vt.edu 20200907: the following id_suffix is used for gatom objects. + When activated, they tend to highlight both the label and the gatom contents + since prior to this there was no differentiation between the two in terms of + their tags. However, g_rtext.c instantiates gatom contents with type "atom" + whereas the label inside g_text.c is instantiated as "gatom". We use this + difference here to provide the two with different tag names, so that we can + prevent the label from being also "activated" (e.g. when user clicks on the + gatom to edit its contents in non-edit mode). */ + var classname = "box_text"; + if (type === "atom") { + classname = "box_text data"; + } gui(cid).get_gobj(tag, function(e) { xoff = e.classList.contains("graph") ? -0.5 : 0.5; }); @@ -2571,7 +2930,7 @@ function gui_text_new(cid, tag, type, isselected, left_margin, font_height, text "font-size": pd_fontsize_to_gui_fontsize(font) + "px", "font-weight": "normal", id: tag + "text", - "class": "box_text" + "class": classname }); // trim off any extraneous leading/trailing whitespace. Because of // the way binbuf_gettext works we almost always have a trailing @@ -2603,6 +2962,22 @@ function gui_text_set (cid, tag, text) { }); } +function gui_text_set_mynumbox (cid, tag, text, active) { + gui(cid).get_elem(tag + "text", function(e) { + //post("gui_text_set_mynumbox " + tag + " " + text + " " + active); + text = text.trim(); + e.textContent = ""; + text_to_tspans(cid, e, text); + if (active === 2) { + e.classList.remove("activated"); + } else if (active === 1) { + e.classList.add("activated"); + } else { + e.classList.remove("activated"); + } + }); +} + function gui_text_redraw_border(cid, tag, width, height) { // Hm, need to figure out how to refactor to get rid of // configure_item call... @@ -2634,6 +3009,81 @@ function gui_gobj_deselect(cid, tag) { }); } +function gui_gobj_dirty(cid, tag, state) { + gui(cid).get_gobj(tag, function(e) { + var border = e.querySelector(".border"); + border.classList.remove("dirty"); + border.classList.remove("subdirty"); + if(state === 1) border.classList.add("dirty"); + else if(state === 2) border.classList.add("subdirty"); + }); +} + +function gui_canvas_warning(cid, warid) { + var warning = get_item(cid, "canvas_warning"); + switch(warid) + { + case 0: + warning.style.setProperty("display", "none"); + break; + case 1: + warning.title = lang.get_local_string("canvas.warning.unsaved_tt"); + warning.onclick = function(){ pdsend(cid, "showdirty"); } + warning.style.setProperty("color", "coral"); + warning.style.setProperty("font-size", "x-large"); + warning.style.setProperty("display", "inline"); + break; + case 2: + warning.title = lang.get_local_string("canvas.warning.multipleunsaved_tt"); + warning.onclick = function(){ pdsend(cid, "showdirty"); } + warning.style.setProperty("color", "red"); + warning.style.setProperty("font-size", "xx-large"); + warning.style.setProperty("display", "inline"); + break; + + default: + break; + } +} + +exports.gui_canvas_warning = gui_canvas_warning; + +function gui_canvas_emphasize(cid) { + gui(cid).get_elem("patchsvg", function(e) { + // raise the window + gui_raise_window(cid); + // animate the background, except for Windows and old OSX versions. + // We *really* have to update all platforms to the same most recent + // stable version. Otherwise the entire codebase is going to become + // conditional branches... + if (check_nw_version("0.15")) { + e.animate([ + {"backgroundColor": "white"}, + {"backgroundColor": "#ff9999"}, + {"backgroundColor": "white"} + ], { duration: 900, easing: "ease-in-out", iterations: 1 }); + } + }); +} + +// bring a gobj into the viewport, plus do an animation to catch the +// user's attention +function gui_gobj_emphasize(cid, tag) { + gui(cid).get_gobj(tag, function(e) { + var border = e.querySelector(".border"); + e.scrollIntoView(); + // quick and dirty, plus another check because Windows and old OSX + // versions of nwjs are ancient and don't include web animations API... + if (border && check_nw_version("0.15")) { + border.animate([ + {fill: "white"}, + {fill: "#ff9999"}, + {fill: "white"} + ], { duration: 300, easing: "ease-in-out", iterations: 3}); + } + }); +} + // This adds a 0.5 offset to align to pixel grid, so it should // only be used to move gobjs to a new position. (Should probably // be renamed to gobj_move to make this more obvious.) @@ -2822,13 +3272,18 @@ function gui_toggle_update(cid, tag, state, color) { }) } -function numbox_data_string(w, h) { +function numbox_data_string_frame(w, h) { return ["M", 0, 0, "L", w - 4, 0, w, 4, w, h, 0, h, - "z", + "z"] + .join(" "); +} + +function numbox_data_string_triangle(w, h) { + return ["M", 0, 0, "L", 0, 0, (h / 2)|0, (h / 2)|0, // |0 to force int 0, h] @@ -2836,27 +3291,38 @@ function numbox_data_string(w, h) { } // Todo: send fewer parameters from c -function gui_numbox_new(cid, tag, color, x, y, w, h, is_toplevel) { +function gui_numbox_new(cid, tag, color, x, y, w, h, drawstyle, is_toplevel) { // numbox doesn't have a standard iemgui border, // so we must create its gobj manually gui(cid).get_elem("patchsvg", function() { var g = gui_gobj_new(cid, tag, "iemgui", x, y, is_toplevel); - var data = numbox_data_string(w, h); var border = create_item(cid, "path", { - d: data, + d: numbox_data_string_frame(w, h), fill: color, stroke: "black", - "stroke-width": 1, + "stroke-width": (drawstyle < 2 ? 1 : 0), id: (tag + "border"), "class": "border" }); g.appendChild(border); + var triangle = create_item(cid, "path", { + d: numbox_data_string_triangle(w, h), + fill: color, + stroke: "black", + "stroke-width": (drawstyle == 0 || drawstyle == 2 ? 1 : 0), + id: (tag + "triangle"), + "class": "border" + }); + g.appendChild(triangle); }); } function gui_numbox_coords(cid, tag, w, h) { gui(cid).get_elem(tag + "border", { - d: numbox_data_string(w, h) + d: numbox_data_string_frame(w, h) + }); + gui(cid).get_elem(tag + "triangle", { + d: numbox_data_string_triangle(w, h) }); } @@ -2865,6 +3331,8 @@ function gui_numbox_draw_text(cid,tag,text,font_size,color,xpos,ypos,basex,basey // below. But it works for most font sizes. gui(cid).get_gobj(tag) .append(function(frag, w) { + //post("ypos=" + ypos + " int=" + Math.floor(ypos)); + //ypos = Math.floor(ypos); var svg_text = create_item(cid, "text", { transform: "translate(" + (xpos - basex) + "," + @@ -2880,14 +3348,14 @@ function gui_numbox_draw_text(cid,tag,text,font_size,color,xpos,ypos,basex,basey }); } -function gui_numbox_update(cid, tag, fcolor, bgcolor, font_name, font_size, font_weight) { +function gui_numbox_update(cid, tag, fcolor, bgcolor, num_font_size, font_name, font_size, font_weight) { gui(cid) .get_elem(tag + "border", { fill: bgcolor }) .get_elem(tag + "text", { fill: fcolor, - "font-size": font_size + "font-size": num_font_size }) // label may or may not exist, but that's covered by the API .get_elem(tag + "label", function() { @@ -3534,7 +4002,7 @@ function gui_scalar_new(cid, tag, isselected, t1, t2, t3, t4, t5, t6, //matrix = [t1,t2,t3,t4+1,t5+0.5,t6+0.5]; matrix = 0; transform_string = "translate(" + (t5+(t1 < 1 ? 0.5 : 1.5)) + - "," + (t6+1) + ") scale(" + t1 + "," + t4 + ")"; + "," + (t6+1.5) + ") scale(" + t1 + "," + t4 + ")"; //post("transform_string = " + transform_string); break; default: @@ -3938,9 +4406,11 @@ function img_size_setter(cid, svg_image_tag, type, data, tk_anchor) { img.onload = function() { w = this.width, h = this.height; + // ico@vt.edu here we subtract one from the svg interpretation + // of the anchor to keep it 1.x and K12 mode compatible configure_item(get_item(cid, svg_image_tag), { - width: w, - height: h, + width: w + 1, + height: h + 1, x: tk_anchor === "center" ? 0 - w/2 : 0, y: tk_anchor === "center" ? 0 - h/2 : 0 }); @@ -4088,31 +4558,38 @@ function gui_image_size_callback(cid, key, callback) { ";base64," + pd_cache.get(key).data; } -function gui_image_draw_border(cid, tag, x, y, w, h) { - gui(cid).get_gobj(tag) - .append(function(frag) { - var b = create_item(cid, "path", { - "stroke-width": "1", - fill: "none", - d: ["m", x, y, w, 0, - "m", 0, 0, 0, h, - "m", 0, 0, -w, 0, - "m", 0, 0, 0, -h - ].join(" "), - visibility: "hidden", - class: "border" +function gui_image_toggle_border(cid, tag, x, y, w, h, onoff) { + if (onoff == 0) { + gui(cid).get_gobj(tag) + .q("path", function(border) { + border.parentNode.removeChild(border); }); - frag.appendChild(b); - return frag; - }); + } else { + gui(cid).get_gobj(tag) + .append(function(frag) { + var b = create_item(cid, "path", { + "stroke-width": "1", + fill: "none", + d: ["m", x, y, w, 0, + "m", 0, 0, 0, h, + "m", 0, 0, -w, 0, + "m", 0, 0, 0, -h + ].join(" "), + visibility: "visible", + class: "border" + }); + frag.appendChild(b); + return frag; + }); + } } -function gui_image_toggle_border(cid, tag, state) { +/*function gui_image_toggle_border(cid, tag, state) { gui(cid).get_gobj(tag) .q(".border", { visibility: state === 0 ? "hidden" : "visible" }); -} +}*/ // Switch the data for an existing svg image function gui_image_configure(cid, tag, image_key, tk_anchor) { @@ -4782,7 +5259,7 @@ function zoom_kludge(zoom_level) { return zfactor; } -function gui_canvas_popup(cid, xpos, ypos, canprop, canopen, isobject) { +function gui_canvas_popup(cid, xpos, ypos, canprop, canopen, cansaveas, isobject) { // Get page coords for top of window, in case we're scrolled gui(cid).get_nw_window(function(nw_win) { // ico@vt.edu updated win_left and win_top for the 0.46.2 @@ -4805,6 +5282,7 @@ function gui_canvas_popup(cid, xpos, ypos, canprop, canopen, isobject) { //popup_coords[1] = ypos; popup_menu[cid].items[0].enabled = canprop; popup_menu[cid].items[1].enabled = canopen; + popup_menu[cid].items[2].enabled = cansaveas; // We'll use "isobject" to enable/disable "To Front" and "To Back" //isobject; @@ -5206,6 +5684,9 @@ function file_dialog(cid, type, target, start_path) { // it just doesn't work. So this requires us to have the parent <span> // around the <input>. Then when we change the innerHTML of the span the // new value for nwworkingdir magically works. + if(nw_os_is_windows) { + start_path = start_path.replace(/\//g, '\\'); + } dialog_options = { style: "display: none;", type: "file", @@ -5264,12 +5745,13 @@ function attr_array_to_object(attr_array) { } function gui_gatom_dialog(did, attr_array) { - dialogwin[did] = create_window(did, "gatom", 265, 300, + dialogwin[did] = create_window(did, "gatom", 259, 278-5, popup_coords[2], popup_coords[3], attr_array_to_object(attr_array)); } function gui_gatom_activate(cid, tag, state) { + //post("gui_gatom_activate tag=" + tag + " state=" + state); gui(cid).get_gobj(tag, function(e) { if (state !== 0) { e.classList.add("activated"); @@ -5280,10 +5762,14 @@ function gui_gatom_activate(cid, tag, state) { } function gui_dropdown_dialog(did, attr_array) { - // Just reuse the "gatom" dialog - dialogwin[did] = create_window(did, "gatom", 265, 300, + // Just reuse the "gatom" dialog (this is not true anymore, see below) + // ico@vt.edu 2020-08-21: made this into a separate dialog due to inability to easily retitle + // the window + dialogwin[did] = create_window(did, "dropdown", 228, 268-5, popup_coords[2], popup_coords[3], attr_array_to_object(attr_array)); + // ico@vt.edu 2020-08-21: the following does not work because the window is not created yet? + //dialogwin[did].window.document.getElementById("titlebar_title").innerHTML = "dropdown properties"; } function dropdown_populate(w, label_array, current_index) { @@ -5376,8 +5862,12 @@ function gui_iemgui_dialog(did, attr_array) { //for (var i = 0; i < attr_array.length; i++) { // attr_array[i] = '"' + attr_array[i] + '"'; //} - create_window(did, "iemgui", 265, 450, - popup_coords[2], popup_coords[3], + // ico@vt.edu: updated window size to match actual, thereby minimizing the flicker + // We are subtracting 25 for the menu + // ico@vt.edu: since adding frameless window, we use top 20px for draggable titlebar, + // so now we subtract only 5 (25-20) + create_window(did, "iemgui", 298, 414-5, + popup_coords[2] + 10, popup_coords[3] + 60, attr_array_to_object(attr_array)); } @@ -5398,6 +5888,28 @@ function gui_font_dialog_change_size(did, font_size) { } } +function gui_menu_font_change_size(canvas, newsize) { + pdsend(canvas, "menufont", newsize); + // ico@vt.edu 2020-08-24: changed to use submenu + // this was the following + /*+document.querySelector('input[name="font_size"]:checked').value, + current_size, + 100, + 0 // "$noundo" from pd.tk-- not sure what it does*/ +} + +exports.gui_menu_font_change_size = gui_menu_font_change_size; + +function gui_menu_font_set_initial_size(cid, size) { + //post("gui_menu_font_set_initial_size " + cid + " " + size); + gui(cid).get_nw_window(function(nw_win) { + if (cid !== "nobody") { + nw_win.window.init_menu_font_size(size); + //post("this should work"); + } + }); +} + function gui_array_new(did, count) { var attr_array = [{ array_gfxstub: did, @@ -5408,11 +5920,13 @@ function gui_array_new(did, count) { array_outline: "black", array_in_existing_graph: 0 }]; - dialogwin[did] = create_window(did, "canvas", 265, 340, 20, 20, + dialogwin[did] = create_window(did, "canvas", + 240 + (5 * nw_os_is_linux) - (30 * nw_os_is_osx), 268-25, 20, 20, attr_array); } function gui_canvas_dialog(did, attr_arrays) { + //post("gui_canvas_dialog"); var i, j, inner_array, prop; // Convert array of arrays to an array of objects for (i = 0; i < attr_arrays.length; i++) { @@ -5423,13 +5937,26 @@ function gui_canvas_dialog(did, attr_arrays) { } } } - dialogwin[did] = create_window(did, "canvas", 300, 100, + var has_array = (attr_arrays.length > 1 ? 1 : 0); + /* + post("array.length=" + attr_arrays.length + " has_array=" + has_array +" width=" + + (230 - (8 * has_array)) + " height=" + + (attr_arrays.length > 1 ? 494-25+(attr_arrays.length > 2 ? 38 : 0) : 392-25)); + */ + dialogwin[did] = create_window(did, "canvas", + // ico@vt.edu: property dialog size is larger when one has + // arrays inside the canvas. + // 1 for regular canvas and 2 for a canvas with 1 array, + // 3 for canvas with 2 arrays, etc. + // We also substract here 5 for the smaller top bar... + 238 + (8 * has_array), + (attr_arrays.length > 1 ? 535-25 : 392-25), popup_coords[2], popup_coords[3], attr_arrays); } function gui_data_dialog(did, data_string) { - dialogwin[did] = create_window(did, "data", 250, 300, + dialogwin[did] = create_window(did, "data", 195, 323 + (22 * nw_os_is_osx), popup_coords[2], popup_coords[3], data_string); } @@ -5485,14 +6012,16 @@ function gui_remove_gfxstub(did) { } } -function gui_font_dialog(cid, gfxstub, font_size) { - var attrs = { canvas: cid, font_size: font_size }; - dialogwin[gfxstub] = create_window(gfxstub, "font", 265, 200, 0, 0, - attrs); +function gui_font_dialog(cid, font_size) { + //var attrs = { canvas: cid, font_size: font_size }; + //dialogwin[gfxstub] = create_window(gfxstub, "font", 136, 187, 0, 0, + // attrs); + // ico@vt.edu: 2020-08-24: we don't need this anymore since everything + // is now inside the menu } function gui_external_dialog(did, external_name, attr_array) { - create_window(did, "external", 265, 450, + create_window(did, "external", 202, 323 + (22 * nw_os_is_osx), popup_coords[2], popup_coords[3], { name: external_name, @@ -5500,6 +6029,13 @@ function gui_external_dialog(did, external_name, attr_array) { }); } +function gui_abstractions_dialog(cid, gfxstub, filebased_abs, private_abs) { + var attrs = { canvas: cid, filebased_abs: filebased_abs, + private_abs: private_abs }; + dialogwin[gfxstub] = create_window(gfxstub, "abstractions", 300, + Math.min(600, (private_abs.length*10 + 190+(nw_os_is_osx?20:0))), 0, 0, attrs); +} + // Global settings function gui_pd_dsp(state) { @@ -5510,7 +6046,7 @@ function gui_pd_dsp(state) { function open_prefs() { if (!dialogwin["prefs"]) { - create_window("prefs", "prefs", 370, 470, 0, 0, null); + create_window("prefs", "prefs", 486, 532, 0, 0, null); } else { dialog_raise("prefs"); } @@ -5526,7 +6062,7 @@ function open_search() { } } -exports.open_search= open_search; +exports.open_search = open_search; // This is the same for all windows (initialization is in pd_menus.js). var recent_files_submenu = null; @@ -5623,10 +6159,10 @@ function gui_midi_properties(gfxstub, sys_indevs, sys_outdevs, } } -function gui_gui_properties(dummy, name, save_zoom, browser_doc, browser_path, +function gui_gui_properties(dummy, name, show_grid, save_zoom, browser_doc, browser_path, browser_init, autopatch_yoffset) { if (dialogwin["prefs"] !== null) { - dialogwin["prefs"].window.gui_prefs_callback(name, save_zoom, + dialogwin["prefs"].window.gui_prefs_callback(name, show_grid, save_zoom, browser_doc, browser_path, browser_init, autopatch_yoffset); } } @@ -5658,7 +6194,12 @@ var skin = exports.skin = (function () { return dir + preset + ".css"; }, set: function (name) { - preset = name; + // ag: if the preset doesn't exist (e.g., user preset that + // has disappeared), just stick to the default + var base = process.platform === "darwin" ? (lib_dir + "/") : ""; + if (fs.existsSync(base + dir + name + ".css")) { + preset = name; + } for (id in patchwin) { if (patchwin.hasOwnProperty(id) && patchwin[id]) { set_css(patchwin[id].window); @@ -5674,15 +6215,25 @@ var skin = exports.skin = (function () { }; }()); -function select_text(cid, elem) { +function select_text(cid, elem, sel_start, sel_end) { var range, win = patchwin[cid].window; if (win.document.selection) { range = win.document.body.createTextRange(); range.moveToElementText(elem); + var len = elem.textContent.length, + ms = Math.max(Math.min(sel_start, len), 0), + me = Math.max(Math.min(sel_end, len), ms); + if(sel_start != -1) range.moveStart("character", ms); + if(sel_end != -1) range.moveEnd("character", me-len); range.select(); } else if (win.getSelection) { range = win.document.createRange(); range.selectNodeContents(elem); + var len = elem.textContent.length, + ms = Math.max(Math.min(sel_start, len), 0), + me = Math.max(Math.min(sel_end, len), ms); + if(sel_start != -1) range.setStart(elem.firstChild, ms); + if(sel_end != -1) range.setEnd(elem.firstChild, me); win.getSelection().removeAllRanges(); win.getSelection().addRange(range); } @@ -5721,57 +6272,72 @@ function get_style_by_selector(w, selector) { // for debugging purposes exports.get_style_by_selector = get_style_by_selector; -// Big, stupid, ugly SVG data url to shove into CSS when -// the user clicks a box in edit mode. One set of points for -// the "head", or main box, and the other for the "tail", or -// message flag at the right. -function generate_msg_box_bg_data(type, stroke) { - return 'url(\"data:image/svg+xml;utf8,' + - '<svg ' + - "xmlns:svg='http://www.w3.org/2000/svg' " + - "xmlns='http://www.w3.org/2000/svg' " + - "xmlns:xlink='http://www.w3.org/1999/xlink' " + - "version='1.0' " + - "viewBox='0 0 10 10' " + - "preserveAspectRatio='none'" + - ">" + - "<polyline vector-effect='non-scaling-stroke' " + - "id='bubbles' " + - "fill='none' " + - "stroke=' " + - stroke + // Here's our stroke color - "' " + - "stroke-width='1' " + - (type === "head" ? - "points='10 0 0 0 0 10 10 10' " : // box - "points='0 0 10 0 0 2 0 8 10 10 0 10' ") + // flag - "/>" + - "</svg>" + - '")'; -} - -// Big problem here-- CSS fails miserably at something as simple as the -// message box flag. We use a backgroundImage svg to address this, but -// for security reasons HTML5 doesn't provide access to svg image styles. -// As a workaround we just seek out the relevant CSS rules and shove the -// whole svg data url into them. We do this each time the user -// clicks a box to edit. -// Also, notice that both CSS and SVG _still_ fail miserably at drawing a -// message box flag that expands in the middle while retaining the same angles -// at the edges. As the message spans more and more lines the ugliness becomes -// more and more apparent. -// Anyhow, this enormous workaround makes it possible to just specify the -// edit box color in CSS for the presets. -function shove_svg_background_data_into_css(w) { - var head_style = get_style_by_selector(w, "#new_object_textentry.msg"), - tail_style = get_style_by_selector(w, "p.msg::after"), - stroke = head_style.outlineColor; - head_style.backgroundImage = generate_msg_box_bg_data("head", stroke); - tail_style.backgroundImage = generate_msg_box_bg_data("tail", stroke); +// 2020-10-06 ico@vt.edu: the following deals with nw.js' discrepancy between +// positioning svg text, versus html paragraph (editable) text +var textarea_font_height_array_kludge = [ +// zoom levels -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 +/* font size 8 */ [ 40, 48, 70, 90,116,140,150,133,133,136,133,135,136,133,135], +/* font size 10 */ [ 50, 70, 90,116,132,133,133,133,134,133,134,133,132,131,130], +/* font size 12 */ [ 80, 90,100,134,148,140,140,140,144,140,140,140,140,140,140], +/* font size 16 */ [ 90,100,120,120,120,120,120,120,120,115,115,115,115,115,115], +/* font size 24 */ [128,128,128,128,128,128,128,128,128,128,128,126,126,126,125], +/* font size 36 */ [127,124,124,122,122,122,122,122,122,122,121,121,120,121,121] +]; + +var textarea_y_offset_array_kludge = [ +// zoom levels -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 +/* font size 8 */ [1.5,1.5,1.5,1.5,1.5,0. ,-2.,1.5,1.5,1.0,1.0,1.0,0.2,0.5,0.5], +/* font size 10 */ [0.5,0.5,0.5,1.5,0.5,1.5,0. ,0.5,0.7,0.8,0.8,1.0,0.5,0.5,0.8], +/* font size 12 */ [1.5,1.5,1.5,2.0,1.5,1.5,1.5,1.5,1.5,1.5,1.5,2.0,1.5,1.5,1.5], +/* font size 16 */ [1.5,1.5,-1.,1.5,1.0,1.5,0.0,1.5,1.5,1.5,1.2,1.5,1.0,0.7,1.2], +/* font size 24 */ [1.5,2.5,2.5,3.0,1.5,2.5,2.5,1.5,2.5,2.5,1.5,2.0,1.5,1.5,2.2], +/* font size 36 */ [1.5,1.5,1.5,3.0,1.5,1.5,1.5,2.5,2.5,1.5,2.0,2.5,1.7,1.6,1.9] +]; + +// helper function to get the right index inside the aforesaid kludge arrays +// used by functions below +function textarea_font_size_to_index(font_size) { + switch(font_size) { + case 8: return 0; + case 10: return 1; + case 12: return 2; + case 16: return 3; + case 24: return 4; + case 36: return 5; + } +} + +function textarea_line_height_kludge(font_size, zoom) { + return textarea_font_height_array_kludge + [textarea_font_size_to_index(font_size)][zoom+7]+"%"; +} + +function textarea_y_offset_kludge(font_size, zoom) { + return textarea_y_offset_array_kludge + [textarea_font_size_to_index(font_size)][zoom+7]; +} + +function textarea_x_offset_kludge(font_size, zoom) { + if (font_size === 36) { + return -2; + } else { + return -0.5; + } +} + +function textarea_msg_y_offset_kludge(zoom) { + if (zoom == 0) { + return -1; + } else if (zoom > 0) { + return -0.5; + } else { + //default + return 0; + } } function gui_textarea(cid, tag, type, x, y, width_spec, height_spec, text, - font_size, is_gop, state) { + font_size, font_width, font_height, is_gop, state, sel_start, sel_end) { var range, svg_view, p, gobj = get_gobj(cid, tag), zoom; gui(cid).get_nw_window(function(nw_win) { @@ -5790,16 +6356,38 @@ function gui_textarea(cid, tag, type, x, y, width_spec, height_spec, text, // (We can probably solve this problem by throwing in yet another // gui_canvas_get_scroll, but this seems like the right way to go // anyway.) - configure_item(gobj, { visibility: "hidden" }); + + // Hide elements: + // all text objects except for the message box hide everything, + // while the message box has a new approach that retains the svg + // shape below it. LATER: we may want to: + // 1) extend this to support nlets (currently we hide them); + // 2) extend this to adjust patch cords as things are being edited, and + // 3) extend this to all text objects. + if (type === "msg") { + // Message approach + var i, nlets = patchwin[cid].window.document + .getElementById(tag+"gobj").querySelectorAll(".xlet_control"); + for (i = 0; i < nlets.length; i++) { + nlets[i].style.setProperty("visibility", "hidden"); + } + gui(cid).get_gobj(tag).q(".box_text", { visibility: "hidden" }); + } else { + // Anything else but message + configure_item(gobj, { visibility: "hidden" }); + } + p = patchwin[cid].window.document.createElement("p"); configure_item(p, { - id: "new_object_textentry" + id: "new_object_textentry", + cid: cid, + tag: tag, + font_width: font_width, + font_height: font_height }); svg_view = patchwin[cid].window.document.getElementById("patchsvg") .viewBox.baseVal; p.classList.add(type); - // ico@vt.edu: is there a better way to monitor vars inside nw? - // p.classList.add("zoom=" + zoom); p.contentEditable = "true"; if (is_gop == 0) { @@ -5820,32 +6408,59 @@ function gui_textarea(cid, tag, type, x, y, width_spec, height_spec, text, */ } - p.style.setProperty("left", (x - svg_view.x) + "px"); - p.style.setProperty("top", (y - svg_view.y) + "px"); + p.style.setProperty("left", (x - svg_view.x + textarea_x_offset_kludge(font_size, zoom)) + "px"); + p.style.setProperty("top", (y - svg_view.y + textarea_y_offset_kludge(font_size, zoom)) + "px"); p.style.setProperty("font-size", pd_fontsize_to_gui_fontsize(font_size) + "px"); p.style.setProperty("line-height", - pd_fontsize_to_gui_fontsize(font_size) + 1 + "px"); + textarea_line_height_kludge(font_size, zoom)); + //pd_fontsize_to_gui_fontsize(font_size) + 1 + "px"); p.style.setProperty("transform", "translate(0px, " + (zoom > 0 ? 0.5 : 0) + "px)"); p.style.setProperty("max-width", - width_spec !== 0 ? width_spec + "ch" : "60ch"); + width_spec > 0 ? width_spec + "ch" : "60ch"); + //p.style.setProperty("width", -width_spec - 2 + "px"); + p.style.setProperty("-webkit-padding-after", "1px"); p.style.setProperty("min-width", - width_spec <= 0 ? "3ch" : - (is_gop == 1 ? (width_spec - 5) + "px" : - width_spec + "ch")); - - // set backgroundimage for message box - if (type === "msg") { - shove_svg_background_data_into_css(patchwin[cid].window); + width_spec == 0 ? "3ch" : + (is_gop == 1 ? width_spec - 3 + "px" : + (width_spec < 0 ? (-width_spec) - 2 + "px" : width_spec + "ch"))); + + if (is_gop == 1) { + p.style.setProperty("min-height", height_spec - 4 + "px"); } // remove leading/trailing whitespace text = text.trim(); p.textContent = text; // append to doc body patchwin[cid].window.document.body.appendChild(p); + if (type === "msg") + { + // ico@vt.edu 2020-09-30: New approach to drawing + // messages that utilizes the original svg border + p.style.setProperty("-webkit-padding-before", "2px"); + p.style.setProperty("-webkit-padding-after", "3px"); + p.style.setProperty("-webkit-padding-start", "0px"); + p.style.setProperty("-webkit-padding-end", "0px"); + p.style.setProperty("margin-left", "2.5px"); + p.style.setProperty("transform", "translate(0px, " + + textarea_msg_y_offset_kludge(zoom) + "px)"); + p.style.setProperty("background-color", ""); + //post("line-height="+ parseInt(p.style.lineHeight) / 100 * font_size); + //shove_svg_background_data_into_css(patchwin[cid].window, + // parseInt(get_gobj(cid, tag).getBoundingClientRect().height / + // (parseInt(p.style.lineHeight) / 100 * font_size))); + gui_message_update_textarea_border(p,1); + } p.focus(); - select_text(cid, p); + select_text(cid, p, sel_start, sel_end); + if (font_size === 36) { + if (is_gop) { + p.style.setProperty("padding", "2px 0px 2px 2.5px"); + } else { + p.style.setProperty("padding", "2px 0px 2px 1.5px"); + } + } if (state === 1) { patchwin[cid].window.canvas_events.text(); } else { @@ -5857,6 +6472,15 @@ function gui_textarea(cid, tag, type, x, y, width_spec, height_spec, text, if (p !== null) { p.parentNode.removeChild(p); } + + // MSG approach + var i, nlets = patchwin[cid].window.document + .getElementById(tag+"gobj").querySelectorAll(".xlet_control"); + for (i = 0; i < nlets.length; i++) { + nlets[i].style.setProperty("visibility", "visible"); + } + gui(cid).get_gobj(tag).q(".box_text", { visibility: "visible" }); + if (patchwin[cid].window.canvas_events.get_previous_state() === "search") { patchwin[cid].window.canvas_events.search(); @@ -5940,27 +6564,38 @@ function canvas_params(nw_win) var bbox, width, height, min_width, min_height, x, y, svg_elem; svg_elem = nw_win.window.document.getElementById("patchsvg"); bbox = svg_elem.getBBox(); + //post("canvas_params calculated bbox: " + bbox.width + " " + bbox.height); // We try to do Pd-extended style canvas origins. That is, coord (0, 0) // should be in the top-left corner unless there are objects with a // negative x or y. // To implement the Pd-l2ork behavior, the top-left of the canvas should // always be the topmost, leftmost object. width = bbox.x > 0 ? bbox.x + bbox.width : bbox.width; - height = bbox.y > 0 ? bbox.y + bbox.height : bbox.height; + // ico@vt.edu 2020-08-12: we add 1 due to an unknown nw.js discrapancy, + // perhaps because of rounding taking place further below? + height = bbox.y > 0 ? bbox.y + bbox.height + 1 : bbox.height + 1; x = bbox.x > 0 ? 0 : bbox.x, y = bbox.y > 0 ? 0 : bbox.y; // ico@vt.edu: adjust body width and height to match patchsvg to ensure // scrollbars only come up when we are indeed inside svg and not before // with extra margins around. This is accurate to a pixel on nw 0.47.0. - // This is also needed when maximizing and restoring the window in order - // to trigger resizing of scrollbars. + // This is needed when maximizing and restoring the window in order + // to trigger resizing of scrollbars. This value reflects the pre-zoom + // size but this is good enough for detecting window resizing changes. + + // ico @vt.edu 2020-08-13 UPDATE: I tracked down the inconsistency in + // measuring window size between Windows and OSX/Linux and it boils down + // to innerWidth and innerHeight for some reason giving out inconsistent + // values. For this reason, I have added the checks in the index.js' + // nw_create_window, and the pdgui.js' canvas_check_geometry. min_width = nw_win.window.innerWidth; min_height = nw_win.window.innerHeight; var body_elem = nw_win.window.document.body; body_elem.style.width = min_width + "px"; body_elem.style.height = min_height + "px"; + //post("canvas_params min_w=" + min_width + " min_h=" + min_height); // Since we don't do any transformations on the patchsvg, // let's try just using ints for the height/width/viewBox @@ -5986,14 +6621,21 @@ function canvas_params(nw_win) // yScrollSize reflects the amount of the patch we currently see, // so if it drops below 1, that means we need our scrollbars if (yScrollSize < 1) { - var yHeight = Math.floor(yScrollSize * (min_height + 3)); - vscroll.style.setProperty("height", (yHeight - 6) + "px"); - vscroll.style.setProperty("top", (yScrollTopOffset + 2) + "px"); + var yHeight = Math.floor(yScrollSize * (min_height + 3 + nw_version_bbox_offset)); + vscroll.style.setProperty("height", (yHeight - 1 + nw_version_bbox_offset) + "px"); + // was (yScrollTopOffset + 2) to make it peel away from the edge + vscroll.style.setProperty("top", (yScrollTopOffset + 0) + "px"); vscroll.style.setProperty("-webkit-clip-path", - "polygon(0px 0px, 5px 0px, 5px " + (yHeight - 6) + - "px, 0px " + (yHeight - 11) + "px, 0px 5px)"); - vscroll.style.setProperty("width", (5 * zoom) + "px"); - vscroll.style.setProperty("right", (2 * zoom) + "px"); + "polygon(0px 0px, 5px 0px, 5px " + (yHeight - 1 + nw_version_bbox_offset) + + "px, 0px " + (yHeight - 6 + nw_version_bbox_offset) + "px, 0px 5px)"); + // ico@vt.edu: this could go either way. We can zoom here to compensate for + // the zoom and keep the scrollbars the same size, or, as is the case with + // this new commit, we enlarge them together with the patch since one of the + // possible rationales is that zooming is there to improve visibility. If + // we decide to reenable this, we may want to fine-tune scrollbar height to + // ensure its size is accurate. + //vscroll.style.setProperty("width", (5 * zoom) + "px"); + //vscroll.style.setProperty("right", (2 * zoom) + "px"); vscroll.style.setProperty("visibility", "visible"); } else { vscroll.style.setProperty("visibility", "hidden"); @@ -6006,19 +6648,28 @@ function canvas_params(nw_win) if (xScrollSize < 1) { var xWidth = Math.floor(xScrollSize * (min_width + 3)); - hscroll.style.setProperty("width", (xWidth - 6) + "px"); - hscroll.style.setProperty("left", (xScrollLeftOffset + 2) + "px"); + hscroll.style.setProperty("width", (xWidth - 1) + "px"); + // was (xScrollTopOffset + 2) to make it peel away from the edge + hscroll.style.setProperty("left", (xScrollLeftOffset + 0) + "px"); hscroll.style.setProperty("-webkit-clip-path", - "polygon(0px 0px, " + (xWidth - 11) + "px 0px, " + - (xWidth - 6) + "px 5px, 0px 5px)"); - hscroll.style.setProperty("height", (5 * zoom) + "px"); - hscroll.style.setProperty("bottom", (2 * zoom) + "px"); + "polygon(0px 0px, " + (xWidth - 6) + "px 0px, " + + (xWidth - 1) + "px 5px, 0px 5px)"); + // ico@vt.edu: this could go either way. We can zoom here to compensate for + // the zoom and keep the scrollbars the same size, or, as is the case with + // this new commit, we enlarge them together with the patch since one of the + // possible rationales is that zooming is there to improve visibility. If + // we decide to reenable this, we may want to fine-tune scrollbar width to + // ensure its size is accurate. + //hscroll.style.setProperty("height", (5 * zoom) + "px"); + //hscroll.style.setProperty("bottom", (2 * zoom) + "px"); hscroll.style.setProperty("visibility", "visible"); } else { hscroll.style.setProperty("visibility", "hidden"); } //post("x=" + xScrollSize + " y=" + yScrollSize); + //post("canvas_params final: x=" + x + " y=" + y + "w=" + width + + // " h=" + height + " min_w=" + min_width + " min_h=" + min_height); return { x: x, y: y, w: width, h: height, mw: min_width, mh: min_height }; @@ -6042,6 +6693,10 @@ function pd_do_getscroll(cid) { exports.pd_do_getscroll = pd_do_getscroll;*/ +// ico@vt.edu: we need this because of inconsistent canvas size between +// nw <=0.24 and >=0.46 +var nw_version_bbox_offset = check_nw_version("0.46") ? 0 : -4; + function do_getscroll(cid, checkgeom) { // Since we're throttling these getscroll calls, they can happen after // the patch has been closed. We remove the cid from the patchwin @@ -6059,6 +6714,12 @@ function do_getscroll(cid, checkgeom) { var svg_elem = nw_win.window.document.getElementById("patchsvg"); var { x: x, y: y, w: width, h: height, mw: min_width, mh: min_height } = canvas_params(nw_win); + + //post("nw_version_bbox_offset=" + nw_version_bbox_offset + + // " min_height=" + min_height); + min_height += nw_version_bbox_offset; + //post("post-calc min_height=" + min_height); + if (width < min_width) { width = min_width; } @@ -6142,6 +6803,21 @@ function gui_canvas_get_overriding_scroll(cid) { exports.gui_canvas_get_overriding_scroll = gui_canvas_get_overriding_scroll; +/* ico@vt.edu 20200920: this last variant that executes immediately + is needed for g_text.c when one displaces a text object and it + immediately activates and it falls outside the visible canvas bounds + this can trigger the object to have its activated box at an incorrect + location due to asynchronous behavior of other getscroll calls. Having + it here as a separate call as it may prove useful later in other contexts. +*/ + +function gui_canvas_get_immediate_scroll(cid) { + //post("gui_canvas_get_immediate_scroll"); + do_getscroll(cid, 0); +} + +exports.gui_canvas_get_immediate_scroll = gui_canvas_get_immediate_scroll; + function do_optimalzoom(cid, hflag, vflag) { // determine an optimal zoom level that makes the entire patch fit within // the window @@ -6175,6 +6851,7 @@ function do_optimalzoom(cid, hflag, vflag) { nw_win.zoomLevel = z; pdsend(cid, "zoom", z); } + do_getscroll(cid,1); }); } @@ -6186,7 +6863,7 @@ var optimalzoom_var = {}; // 100 msec are enough for do_optimalzoom to finish. function gui_canvas_optimal_zoom(cid, h, v) { clearTimeout(optimalzoom_var[cid]); - optimalzoom_var[cid] = setTimeout(do_optimalzoom, 10, cid, h, v); + optimalzoom_var[cid] = setTimeout(do_optimalzoom, 50, cid, h, v); } exports.gui_canvas_optimal_zoom = gui_canvas_optimal_zoom; @@ -6283,8 +6960,20 @@ exports.dialog_bindings = function(did) { exports.resize_window = function(did) { var w = dialogwin[did].window.document.body.scrollWidth, h = dialogwin[did].window.document.body.scrollHeight; - dialogwin[did].width = w; - dialogwin[did].height = h; + // ico@vt.edu: the following is a change needed for the nw.js 0.47 + // for the dialog window to be properly resized + //dialogwin[did].width = w; + //dialogwin[did].height = h; + //dialogwin[did].window.document.body.titlebar_close_button.style.setProperty + // ("font-size", (process.platform === "win32" ? "21px" : "15px")); + /*post(did + " body: w=" + dialogwin[did].window.document.body.clientWidth + + " h=" + dialogwin[did].window.document.body.clientHeight + " scroll: w=" + + w + " h=" + h);*/ + dialogwin[did].resizeTo(w,h); + //ico@vt.edu: comment the following line when working on dialog sizes... + dialogwin[did].setResizable(false); + //post("dialog set always on top"); + //dialogwin[did].setAlwaysOnTop(true); } // External GUI classes @@ -6331,11 +7020,11 @@ function gui_update_scrollbars(cid) { if (yScrollSize < 1) { var yHeight = Math.floor(yScrollSize * min_height); - vscroll.style.setProperty("height", (yHeight - 6) + "px"); - vscroll.style.setProperty("top", (yScrollTopOffset + 2) + "px"); + vscroll.style.setProperty("height", (yHeight - 1 + nw_version_bbox_offset) + "px"); + vscroll.style.setProperty("top", (yScrollTopOffset + 0) + "px"); vscroll.style.setProperty("-webkit-clip-path", - "polygon(0px 0px, 5px 0px, 5px " + (yHeight - 6) + - "px, 0px " + (yHeight - 11) + "px, 0px 5px)"); + "polygon(0px 0px, 5px 0px, 5px " + (yHeight - 1 + nw_version_bbox_offset) + + "px, 0px " + (yHeight - 6 + nw_version_bbox_offset) + "px, 0px 5px)"); vscroll.style.setProperty("visibility", "visible"); } else { vscroll.style.setProperty("visibility", "hidden"); @@ -6357,11 +7046,11 @@ function gui_update_scrollbars(cid) { if (xScrollSize < 1) { var xWidth = Math.floor(xScrollSize * min_width); - hscroll.style.setProperty("width", (xWidth - 6) + "px"); - hscroll.style.setProperty("left", (xScrollTopOffset + 2) + "px"); + hscroll.style.setProperty("width", (xWidth - 1) + "px"); + hscroll.style.setProperty("left", (xScrollTopOffset + 0) + "px"); hscroll.style.setProperty("-webkit-clip-path", - "polygon(0px 0px, " + (xWidth - 11) + "px 0px, " + - (xWidth - 6) + "px 5px, 0px 5px)"); + "polygon(0px 0px, " + (xWidth - 6) + "px 0px, " + + (xWidth - 1) + "px 5px, 0px 5px)"); hscroll.style.setProperty("visibility", "visible"); } else { hscroll.style.setProperty("visibility", "hidden"); @@ -6375,3 +7064,21 @@ function gui_update_scrollbars(cid) { } exports.gui_update_scrollbars = gui_update_scrollbars; + +// ico@vt.edu 2020-08-29: fine-tune appearance of various +// css elements because, consistency in HTML font rendering +// across different OSs is a joke +function gui_check_for_dialog_appearance_inconsistencies(id) +{ + if (nw_os_is_osx) + gui_osx_dialog_appearance(id); +} + +exports.gui_check_for_dialog_appearance_inconsistencies = gui_check_for_dialog_appearance_inconsistencies; + +function gui_osx_dialog_appearance(id) +{ + var close_button = dialogwin[id].window.document.getElementById("titlebar_close_button"); + close_button.style.setProperty("line-height", "14px"); + close_button.style.setProperty("border-radius", "10px"); +} diff --git a/pd/portmidi/pm_win/pmwinmm.c b/pd/portmidi/pm_win/pmwinmm.c index ab66f80dc1c6b059c015c1aacf1b67058cb6b93c..d76fb7ab04da2f5416424e07f2855d9d6ef06005 100755 --- a/pd/portmidi/pm_win/pmwinmm.c +++ b/pd/portmidi/pm_win/pmwinmm.c @@ -38,11 +38,11 @@ /* callback routines */ static void CALLBACK winmm_in_callback(HMIDIIN hMidiIn, - WORD wMsg, DWORD dwInstance, - DWORD dwParam1, DWORD dwParam2); + WORD wMsg, DWORD_PTR dwInstance, + DWORD_PTR dwParam1, DWORD_PTR dwParam2); static void CALLBACK winmm_streamout_callback(HMIDIOUT hmo, UINT wMsg, - DWORD dwInstance, DWORD dwParam1, - DWORD dwParam2); + DWORD_PTR dwInstance, DWORD_PTR dwParam1, + DWORD_PTR dwParam2); #ifdef USE_SYSEX_BUFFERS static void CALLBACK winmm_out_callback(HMIDIOUT hmo, UINT wMsg, DWORD dwInstance, DWORD dwParam1, @@ -667,9 +667,9 @@ static PmError winmm_in_close(PmInternal *midi) static void FAR PASCAL winmm_in_callback( HMIDIIN hMidiIn, /* midiInput device Handle */ WORD wMsg, /* midi msg */ - DWORD dwInstance, /* application data */ - DWORD dwParam1, /* MIDI data */ - DWORD dwParam2) /* device timestamp (wrt most recent midiInStart) */ + DWORD_PTR dwInstance, /* application data */ + DWORD_PTR dwParam1, /* MIDI data */ + DWORD_PTR dwParam2) /* device timestamp (wrt most recent midiInStart) */ { static int entry = 0; PmInternal *midi = (PmInternal *) dwInstance; @@ -1328,7 +1328,7 @@ static void CALLBACK winmm_out_callback(HMIDIOUT hmo, UINT wMsg, /* winmm_streamout_callback -- unprepare (free) buffer header */ static void CALLBACK winmm_streamout_callback(HMIDIOUT hmo, UINT wMsg, - DWORD dwInstance, DWORD dwParam1, DWORD dwParam2) + DWORD_PTR dwInstance, DWORD_PTR dwParam1, DWORD_PTR dwParam2) { PmInternal *midi = (PmInternal *) dwInstance; midiwinmm_type m = (midiwinmm_type) midi->descriptor; diff --git a/pd/src/config.h.in b/pd/src/config.h.in index db86fe4b145d9c6de69ed825ac2c9319f0d02960..3887a9fd8caa1d44bdf4de86f56e7e7c54af27a5 100644 --- a/pd/src/config.h.in +++ b/pd/src/config.h.in @@ -172,7 +172,10 @@ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the <unistd.h> header file. */ +#ifndef __MINGW64_VERSION_MAJOR +// mingw64 has this, but this isn't complete so we better disable it #undef HAVE_UNISTD_H +#endif /* Define to 1 if you have the `vprintf' function. */ #undef HAVE_VPRINTF diff --git a/pd/src/d_math.c b/pd/src/d_math.c index 59e6d989b80b7064313ba50c102f6a3043a66129..e90984938cc9e4c62fb556bcf6a72aed92998438 100644 --- a/pd/src/d_math.c +++ b/pd/src/d_math.c @@ -660,12 +660,10 @@ t_int *pow_tilde_perform(t_int *w) int n = (int)(w[4]); while (n--) { - t_float f = *in1++; - if (f > 0) - *out = pow(f, *in2); - else *out = 0; - out++; - in2++; + t_sample f1 = *in1++, f2 = *in2++; + *out++ = (f1 == 0 && f2 < 0) || + (f1 < 0 && (f2 - (int)f2) != 0) ? + 0 : pow(f1, f2); } return (w+5); } @@ -678,11 +676,10 @@ t_int *scalarpow_tilde_perform(t_int *w) int n = (int)(w[4]); while (n--) { - t_float f = *in++; - if (f > 0) - *out = pow(f, g); - else *out = 0; - out++; + t_sample f1 = *in++; + *out++ = (f1 == 0 && g < 0) || + (f1 < 0 && (g - (int)g) != 0) ? + 0 : pow(f1, g); } return(w+5); } diff --git a/pd/src/d_osc.c b/pd/src/d_osc.c index 12c28e1cc7eb77a5038fe02eb0ebe4a447cfe6fd..2eeeae266957f01470e77aba213a7c029edab823 100644 --- a/pd/src/d_osc.c +++ b/pd/src/d_osc.c @@ -396,11 +396,19 @@ static void noise_dsp(t_noise *x, t_signal **sp) dsp_add(noise_perform, 3, sp[0]->s_vec, &x->x_val, (t_int)sp[0]->s_n); } +static void noise_float(t_noise *x, t_float f) +{ + /* set the seed */ + x->x_val = (int)f; +} + static void noise_tilde_setup(void) { noise_class = class_new(gensym("noise~"), (t_newmethod)noise_new, 0, sizeof(t_noise), 0, 0); class_addmethod(noise_class, (t_method)noise_dsp, gensym("dsp"), A_CANT, 0); + class_addmethod(noise_class, (t_method)noise_float, + gensym("seed"), A_FLOAT, 0); } /* ----------------------- global setup routine ---------------- */ diff --git a/pd/src/d_ugen.c b/pd/src/d_ugen.c index 459fd2852e527693e61452f0a1ddfedbc2fb8cf9..f2ffc0e22e713f6da4b1e903648a80dd339faa85 100644 --- a/pd/src/d_ugen.c +++ b/pd/src/d_ugen.c @@ -304,14 +304,14 @@ void dsp_add(t_perfroutine f, int n, ...) pd_this->pd_dspchainsize * sizeof (t_int), newsize * sizeof (t_int)); pd_this->pd_dspchain[pd_this->pd_dspchainsize-1] = (t_int)f; if (ugen_loud) - post("add to chain: %lx", + post("add to chain: %zx", pd_this->pd_dspchain[pd_this->pd_dspchainsize-1]); va_start(ap, n); for (i = 0; i < n; i++) { pd_this->pd_dspchain[pd_this->pd_dspchainsize + i] = va_arg(ap, t_int); if (ugen_loud) - post("add to chain: %lx", + post("add to chain: %zx", pd_this->pd_dspchain[pd_this->pd_dspchainsize + i]); } va_end(ap); @@ -402,7 +402,7 @@ void signal_makereusable(t_signal *sig) } } #endif - if (ugen_loud) post("free %lx: %d", sig, sig->s_isborrowed); + if (ugen_loud) post("free %zx: %d", sig, sig->s_isborrowed); if (sig->s_isborrowed) { /* if the signal is borrowed, decrement the borrowed-from signal's @@ -471,7 +471,7 @@ t_signal *signal_new(int n, t_float sr) ret->s_sr = sr; ret->s_refcount = 0; ret->s_borrowedfrom = 0; - if (ugen_loud) post("new %lx: %lx", ret, ret->s_vec); + if (ugen_loud) post("new %zx: %zx", ret, ret->s_vec); return (ret); } @@ -490,7 +490,7 @@ void signal_setborrowed(t_signal *sig, t_signal *sig2) sig->s_vec = sig2->s_vec; sig->s_n = sig2->s_n; sig->s_vecsize = sig2->s_vecsize; - if (ugen_loud) post("set borrowed %lx: %lx", sig, sig->s_vec); + if (ugen_loud) post("set borrowed %zx: %zx", sig, sig->s_vec); } int signal_compatible(t_signal *s1, t_signal *s2) @@ -815,12 +815,12 @@ static void ugen_doit(t_dspcontext *dc, t_ugenbox *u) { if (u->u_nin + u->u_nout == 0) post("put %s %d", class_getname(u->u_obj->ob_pd), ugen_index(dc, u)); - else if (u->u_nin + u->u_nout == 1) post("put %s %d (%lx)", + else if (u->u_nin + u->u_nout == 1) post("put %s %d (%zx)", class_getname(u->u_obj->ob_pd), ugen_index(dc, u), sig[0]); - else if (u->u_nin + u->u_nout == 2) post("put %s %d (%lx %lx)", + else if (u->u_nin + u->u_nout == 2) post("put %s %d (%zx %zx)", class_getname(u->u_obj->ob_pd), ugen_index(dc, u), sig[0], sig[1]); - else post("put %s %d (%lx %lx %lx ...)", + else post("put %s %d (%zx %zx %zx ...)", class_getname(u->u_obj->ob_pd), ugen_index(dc, u), sig[0], sig[1], sig[2]); } @@ -1000,7 +1000,7 @@ void ugen_done_graph(t_dspcontext *dc) signal_new(parent_vecsize, parent_srate)); (*sigp)->s_refcount++; - if (ugen_loud) post("set %lx->%lx", *sigp, + if (ugen_loud) post("set %zx->%zx", *sigp, (*sigp)->s_borrowedfrom); } } @@ -1083,7 +1083,7 @@ void ugen_done_graph(t_dspcontext *dc) (*sigp)->s_refcount++; dsp_add_zero(s3->s_vec, s3->s_n); if (ugen_loud) - post("oops, belatedly set %lx->%lx", *sigp, + post("oops, belatedly set %zx->%zx", *sigp, (*sigp)->s_borrowedfrom); } } @@ -1123,7 +1123,7 @@ void ugen_done_graph(t_dspcontext *dc) if (!dc->dc_parentcontext) for (i = pd_this->pd_dspchainsize, ip = pd_this->pd_dspchain; i--; ip++) - post("chain %lx", *ip); + post("chain %zx", *ip); post("... ugen_done_graph done."); } /* now delete everything. */ diff --git a/pd/src/g_all_guis.c b/pd/src/g_all_guis.c index 1723a986bde9f9b1ce6e3f3dbed473dc3b960c74..1da777dd92a0f981e7cb28a90b31dcc11e0ff111 100644 --- a/pd/src/g_all_guis.c +++ b/pd/src/g_all_guis.c @@ -133,6 +133,45 @@ static void iemgui_init_sym2dollararg(t_iemgui *x, t_symbol **symp, } } +int color_format_warned; +static t_symbol *color2symbol(int col) +{ + const int compat = (pd_compatibilitylevel < 48) ? 1 : 0; + char colname[MAXPDSTRING]; + colname[0] = colname[MAXPDSTRING-1] = 0; + + if (compat) + { + /* compatibility with Pd<=0.47: saves colors as numbers with limited + resolution */ + int col2 = -1 - (((0xfc0000 & col) >> 6) + | ((0xfc00 & col) >> 4) + | ((0xfc & col) >> 2)); + snprintf(colname, MAXPDSTRING-1, "%d", col2); + } + else + { + if (!color_format_warned) + { + post("warning: saving iemgui colors as hex symbol. These colors " + "are readable in Pd Vanilla since 0.47, but they are not " + "readable in Purr Data version 2.12.0 or earlier. " + "If you need to remain compatible with older versions of Purr " + "Data please run in compatibility mode with Vanilla version " + "0.47 like this:"); + post(""); + post("[compatibility 0.47("); + post("|"); + post("[send pd]"); + post(""); + color_format_warned = 1; + } + snprintf(colname, MAXPDSTRING-1, "#%06x", col); + } + return gensym(colname); +} + + /* get the unexpanded versions of the symbols; initialize them if necessary. */ void iemgui_all_sym2dollararg(t_iemgui *x, t_symbol **srlsym) { @@ -144,16 +183,101 @@ void iemgui_all_sym2dollararg(t_iemgui *x, t_symbol **srlsym) srlsym[2] = x->x_lab_unexpanded; } -static int col2save(int col) { - return -1-(((0xfc0000 & col) >> 6)|((0xfc00 & col) >> 4)|((0xfc & col) >> 2)); +void iemgui_all_col2save(t_iemgui *x, t_symbol **bflcol) +{ + bflcol[0] = color2symbol(x->x_bcol); + bflcol[1] = color2symbol(x->x_fcol); + bflcol[2] = color2symbol(x->x_lcol); } -void iemgui_all_col2save(t_iemgui *x, int *bflcol) + +static int iemgui_getcolorarg(t_iemgui *x, int index, int argc, t_atom *argv) { - bflcol[0] = col2save(x->x_bcol); - bflcol[1] = col2save(x->x_fcol); - bflcol[2] = col2save(x->x_lcol); + char *classname; + if (index < 0 || index >= argc || !argc) + return 0; + + if (IS_A_FLOAT(argv, index)) + return atom_getfloatarg(index, argc, argv); + + classname = class_getname(pd_class(&x->x_obj.te_pd)); + if (IS_A_SYMBOL(argv, index)) + { + t_symbol *s = atom_getsymbolarg(index, argc, argv); + if ('#' == s->s_name[0]) + { + char *start = s->s_name + 1, *end; + char expanded[7]; + int len = strlen(start); + if (len == 3) + { + sprintf(expanded, "%c%c%c%c%c%c", + start[0], start[0], + start[1], start[1], + start[2], start[2]); + start = expanded; + len = 6; + } + if (len == 6) + { + int col = (int)strtol(start, &end, 16); + if (end != start) + return col; + } + } + if (s == &s_) + pd_error(x, "%s: empty symbol detected in hex color argument. " + "Falling back to black. (Hit the sack.:)", + classname); + else + pd_error(x, "%s: expected '#fff' or '#ffffff' hex color format " + "but got '%s'. Falling back to black.", + classname, s->s_name); + return 0; + } + pd_error(x, "%s: color method only accepts symbol or float arguments. " + "Falling back to black.", + classname); + return 0; } +static int colfromatomload(t_iemgui *x, t_atom *colatom) +{ + int color; + /* old-fashioned color argument, either a number or symbol + evaluating to an integer */ + if (colatom->a_type == A_FLOAT) + color = atom_getfloat(colatom); + else if (colatom->a_type == A_SYMBOL && + (isdigit(colatom->a_w.w_symbol->s_name[0]) || + colatom->a_w.w_symbol->s_name[0] == '-')) + color = atoi(colatom->a_w.w_symbol->s_name); + + /* symbolic color */ + else return (iemgui_getcolorarg(x, 0, 1, colatom)); + + if (color < 0) + { + color = -1 - color; + color = ((color & 0x3f000) << 6)|((color & 0xfc0) << 4)| + ((color & 0x3f) << 2); + } + else + { + color = iemgui_modulo_color(color); + color = iemgui_color_hex[color]; + } + return (color); +} + +void iemgui_all_loadcolors(t_iemgui *x, t_atom *bcol, t_atom *fcol, + t_atom *lcol) +{ + if (bcol) x->x_bcol = colfromatomload(x, bcol); + if (fcol) x->x_fcol = colfromatomload(x, fcol); + if (lcol) x->x_lcol = colfromatomload(x, lcol); +} + + static int colfromload(int col) { if(col) { @@ -170,13 +294,26 @@ void iemgui_all_colfromload(t_iemgui *x, int *bflcol) x->x_lcol = colfromload(bflcol[2]); } -static int iemgui_compatible_col(int i) +int iemgui_compatible_colorarg(t_iemgui *x, int index, int argc, t_atom* argv) { - if(i >= 0) - return(iemgui_color_hex[(iemgui_modulo_color(i))]); - return((-1-i)&0xffffff); + if (index < 0 || index >= argc || !argc) + return 0; + /* old style, lossy int values */ + if (IS_A_FLOAT(argv, index)) + { + int col = atom_getfloatarg(index, argc, argv); + if (col >= 0) + { + int idx = iemgui_modulo_color(col); + return(iemgui_color_hex[(idx)]); + } + else + return((-1 - col) & 0xffffff); + } + return iemgui_getcolorarg(x, index, argc, argv); } + void iemgui_all_raute2dollar(t_symbol **srlsym) { srlsym[0] = iemgui_raute2dollar(srlsym[0]); @@ -352,8 +489,8 @@ void iemgui_label_getrect(t_iemgui x_gui, t_glist *x, // new interface, but we haven't had a need to do it yet //fprintf(stderr,"%f %d %d\n", width_multiplier, // label_length, x_gui.x_font_style); - //sys_vgui(".x%lx.c delete iemguiDEBUG\n", x); - //sys_vgui(".x%lx.c create rectangle %d %d %d %d " + //sys_vgui(".x%zx.c delete iemguiDEBUG\n", x); + //sys_vgui(".x%zx.c create rectangle %d %d %d %d " // "-tags iemguiDEBUG\n", // x, label_x1, label_y1, label_x2, label_y2); if (label_x1 < *xp1) *xp1 = label_x1; @@ -361,8 +498,8 @@ void iemgui_label_getrect(t_iemgui x_gui, t_glist *x, if (label_y1 < *yp1) *yp1 = label_y1; if (label_y2 > *yp2) *yp2 = label_y2; //DEBUG - //sys_vgui(".x%lx.c delete iemguiDEBUG\n", x); - //sys_vgui(".x%lx.c create rectangle %d %d %d %d " + //sys_vgui(".x%zx.c delete iemguiDEBUG\n", x); + //sys_vgui(".x%zx.c create rectangle %d %d %d %d " // "-tags iemguiDEBUG\n", x, *xp1, *yp1, *xp2, *yp2); } } @@ -388,8 +525,8 @@ void iemgui_label_getrect(t_iemgui x_gui, t_glist *x, if (yr) { fprintf(stderr,"lower\n"); - sys_vgui(".x%lx.c lower selected %s\n", canvas, rtext_gettag(yr)); - sys_vgui(".x%lx.c raise selected %s\n", canvas, rtext_gettag(yr)); + sys_vgui(".x%zx.c lower selected %s\n", canvas, rtext_gettag(yr)); + sys_vgui(".x%zx.c raise selected %s\n", canvas, rtext_gettag(yr)); //canvas_raise_all_cords(canvas); } else @@ -405,7 +542,7 @@ void iemgui_label_getrect(t_iemgui x_gui, t_glist *x, // we get here if we are supposed to go // all the way to the bottom fprintf(stderr,"lower to the bottom\n"); - sys_vgui(".x%lx.c lower selected\n", canvas); + sys_vgui(".x%zx.c lower selected\n", canvas); } glist_noselect(canvas); */ @@ -478,20 +615,51 @@ void iemgui_pos(t_iemgui *x, t_symbol *s, int ac, t_atom *av) iemgui_shouldvis(x, IEM_GUI_DRAW_MODE_MOVE); } -void iemgui_color(t_iemgui *x, t_symbol *s, int ac, t_atom *av) +int iemgui_old_color_args(int argc, t_atom *argv) { - x->x_bcol = iemgui_compatible_col(atom_getintarg(0, ac, av)); - if(ac > 2) + int gotsym = 0, gotfloat = 0; + gotsym += atom_getsymbolarg(0, argc, argv) != &s_; + gotsym += atom_getsymbolarg(1, argc, argv) != &s_; + gotsym += atom_getsymbolarg(2, argc, argv) != &s_; + + gotfloat += argc >=1 && argv[0].a_type == A_FLOAT; + gotfloat += argc >=2 && argv[1].a_type == A_FLOAT; + gotfloat += argc >=2 && argv[2].a_type == A_FLOAT; + + if (gotfloat && gotsym) { - x->x_fcol = iemgui_compatible_col(atom_getintarg(1, ac, av)); - x->x_lcol = iemgui_compatible_col(atom_getintarg(2, ac, av)); + post("warning: unexpected mixing of symbol args with deprecated " + "float color syntax."); + return 1; } - else - x->x_lcol = iemgui_compatible_col(atom_getintarg(1, ac, av)); - if (glist_isvisible(x->x_glist)) + else if (gotfloat) return 1; + else return 0; +} + +void iemgui_color(t_iemgui *x, t_symbol *s, int ac, t_atom *av) +{ + if (ac) { - x->x_draw(x, x->x_glist, IEM_GUI_DRAW_MODE_CONFIG); - iemgui_label_draw_config(x); + if (ac >= 1) + x->x_bcol = iemgui_compatible_colorarg(x, 0, ac, av); + if (ac >= 2) + { + /* if there are only two args, the old style was to make + the 2nd argument the label color. So here we check for the + old-style float args and use that format if they are + present. */ + if (ac == 2 && iemgui_old_color_args(ac, av)) + x->x_lcol = iemgui_compatible_colorarg(x, 1, ac, av); + else + x->x_fcol = iemgui_compatible_colorarg(x, 1, ac, av); + } + if (ac >= 3) + x->x_lcol = iemgui_compatible_colorarg(x, 2, ac, av); + if (glist_isvisible(x->x_glist)) + { + x->x_draw(x, x->x_glist, IEM_GUI_DRAW_MODE_CONFIG); + iemgui_label_draw_config(x); + } } } @@ -561,7 +729,7 @@ void iemgui_vis(t_gobj *z, t_glist *glist, int vis) } } -void iemgui_save(t_iemgui *x, t_symbol **srl, int *bflcol) +void iemgui_save(t_iemgui *x, t_symbol **srl, t_symbol **bflcol) { if (srl) { srl[0] = x->x_snd; @@ -771,20 +939,20 @@ t_scalehandle *scalehandle_new(t_object *x, t_glist *glist, int scale, t_clickhandlefn chf, t_motionhandlefn mhf) { t_scalehandle *h = (t_scalehandle *)pd_new(scalehandle_class); - char buf[19]; // 3 + max size of %lx + char buf[19]; // 3 + max size of %zx h->h_master = x; h->h_glist = glist; if (!scale) /* Only bind for labels-- scaling uses pd_vmess in g_editor.c */ { - sprintf(buf, "_l%lx", (long unsigned int)x); + sprintf(buf, "_l%zx", (t_uint)x); pd_bind((t_pd *)h, h->h_bindsym = gensym(buf)); } else if (scale && pd_class((t_pd *)x) == my_canvas_class) { - sprintf(buf, "_s%lx", (long unsigned int)x); + sprintf(buf, "_s%zx", (t_uint)x); pd_bind((t_pd *)h, h->h_bindsym = gensym(buf)); } - sprintf(h->h_outlinetag, "h%lx", (t_int)h); + sprintf(h->h_outlinetag, "h%zux", (t_uint)h); h->h_dragon = 0; h->h_scale = scale; h->h_offset_x = 0; @@ -793,7 +961,7 @@ t_scalehandle *scalehandle_new(t_object *x, t_glist *glist, int scale, h->h_adjust_y = 0; h->h_vis = 0; h->h_constrain = 0; - sprintf(h->h_pathname, ".x%lx.h%lx", (t_int)h->h_glist, (t_int)h); + sprintf(h->h_pathname, ".x%zx.h%zx", (t_uint)h->h_glist, (t_uint)h); h->h_clickfn = chf; h->h_motionfn = mhf; return h; @@ -808,10 +976,10 @@ void scalehandle_free(t_scalehandle *h) pd_free((t_pd *)h); } -void properties_set_field_int(long props, const char *gui_field, int value) +void properties_set_field_int(t_int props, const char *gui_field, int value) { char tagbuf[MAXPDSTRING]; - sprintf(tagbuf, ".gfxstub%lx", props); + sprintf(tagbuf, ".gfxstub%zx", props); gui_vmess("gui_dialog_set_field", "ssi", tagbuf, gui_field, @@ -868,7 +1036,7 @@ void scalehandle_click_label(t_scalehandle *h) { //sys_vgui("lower %s\n", h->h_pathname); //t_scalehandle *othersh = x->x_handle; - //sys_vgui("lower .x%lx.h%lx\n", + //sys_vgui("lower .x%zx.h%zx\n", // (t_int)glist_getcanvas(x->x_glist), (t_int)othersh); } h->h_dragx = 0; @@ -1009,7 +1177,7 @@ void iemgui_label_draw_move(t_iemgui *x) //int x1=text_xpix(&x->x_obj, x->x_glist)+x->legacy_x; //int y1=text_ypix(&x->x_obj, x->x_glist)+x->legacy_y; //iemgui_getrect_legacy_label(x, &x1, &y1); - //sys_vgui(".x%lx.c coords %lxLABEL %d %d\n", + //sys_vgui(".x%zx.c coords %zxLABEL %d %d\n", // canvas, x, x1+x->x_ldx, y1+x->x_ldy); /* Note-- since we're not using x1/y1 above in the new GUI call, @@ -1100,7 +1268,7 @@ void iemgui_draw_io(t_iemgui *x, int old_sr_flags) t_canvas *canvas=glist_getcanvas(x->x_glist); if (x->x_glist != canvas) return; // is gop t_class *c = pd_class((t_pd *)x); - if (c == my_numbox_class && ((t_my_numbox *)x)->x_hide_frame > 1) + if (c == my_numbox_class && ((t_my_numbox *)x)->x_drawstyle > 1) return; //sigh if (!(old_sr_flags&4) && !glist_isvisible(canvas)) { @@ -1118,7 +1286,7 @@ void iemgui_draw_io(t_iemgui *x, int old_sr_flags) n = 0; int a=old_sr_flags&IEM_GUI_OLD_SND_FLAG; int b=x->x_snd!=s_empty; - //fprintf(stderr, "%lx SND: old_sr_flags=%d SND_FLAG=%d || " + //fprintf(stderr, "%zx SND: old_sr_flags=%d SND_FLAG=%d || " // "OUTCOME: OLD_SND_FLAG=%d not_empty=%d\n", // (t_int)x, old_sr_flags, IEM_GUI_OLD_SND_FLAG, a, b); @@ -1144,7 +1312,7 @@ void iemgui_draw_io(t_iemgui *x, int old_sr_flags) } a = old_sr_flags & IEM_GUI_OLD_RCV_FLAG; b = x->x_rcv != s_empty; - //fprintf(stderr, "%lx RCV: old_sr_flags=%d RCV_FLAG=%d || " + //fprintf(stderr, "%zx RCV: old_sr_flags=%d RCV_FLAG=%d || " // "OUTCOME: OLD_RCV_FLAG=%d not_empty=%d\n", // (t_int)x, old_sr_flags, IEM_GUI_OLD_RCV_FLAG, a, b); if (a && !b) @@ -1225,8 +1393,8 @@ void iemgui_base_draw_new(t_iemgui *x) gop_redraw = gr; char colorbuf[MAXPDSTRING]; sprintf(colorbuf, "#%6.6x", x->x_bcol); - gui_vmess("gui_gobj_new", "xxsiii", canvas, x, - "iemgui", x1, y1, glist_istoplevel(x->x_glist)); + gui_vmess("gui_gobj_new", "xxsiiii", canvas, x, + "iemgui", x1, y1, glist_istoplevel(x->x_glist), 0); gui_vmess("gui_text_draw_border", "xxsiii", canvas, x, @@ -1257,7 +1425,7 @@ void iemgui_base_draw_config(t_iemgui *x) char fcol[8]; sprintf(fcol,"#%6.6x", x->x_fcol); char tagbuf[MAXPDSTRING]; char bcol[8]; sprintf(bcol, "#%6.6x", x->x_bcol); - sprintf(tagbuf, "x%lxborder", (long unsigned int)x); + sprintf(tagbuf, "x%zxborder", (t_int)x); gui_vmess("gui_iemgui_base_color", "xxs", canvas, x, bcol); } @@ -1306,6 +1474,17 @@ void scrollbar_update(t_glist *glist) canvas_getscroll(canvas); } +/* ico@vt.edu 20200920: introduced for situation where getscroll +needs to occur before the next command, e.g. automate. */ +void scrollbar_synchronous_update(t_glist *glist) +{ + // glist_getcanvas is probably not needed but not before we make + // sure that there are unneded calls of this kind being made by + // non-toplevel objects... + gui_vmess("gui_canvas_get_immediate_scroll", + "x", glist_getcanvas(glist)); +} + void wb_init(t_widgetbehavior *wb, t_getrectfn gr, t_clickfn cl) { wb->w_getrectfn = gr; diff --git a/pd/src/g_all_guis.h b/pd/src/g_all_guis.h index a9d6768a01fd1c9b5504d2ffa4fd38840f53097a..b7684019fe00dd5815513673e2b6da7a0500924e 100644 --- a/pd/src/g_all_guis.h +++ b/pd/src/g_all_guis.h @@ -47,8 +47,8 @@ typedef struct _scalehandle t_glist *h_glist; // this is the canvas to draw on. Note that when objects are edited, "glist" and "canvas" mean the same. t_symbol *h_bindsym; int h_scale; - char h_pathname[37]; // max size for ".x%lx.h%lx" = 5+4*sizeof(long) - char h_outlinetag[18]; // max size for "h%lx" = 2+2*sizeof(long) + char h_pathname[37]; // max size for ".x%llx.h%llx" = 5+4*sizeof(long) + char h_outlinetag[18]; // max size for "h%llx" = 2+2*sizeof(long) int h_dragon; // bool int h_dragx; int h_dragy; @@ -190,9 +190,14 @@ typedef struct _my_numbox int x_numwidth; // unsigned (width in pixels) int x_scalewidth; /* temporary value for scalehandle */ int x_scaleheight; /* temporary value for scalehandle */ + int x_yresize_x; /* value of x when y resize started */ int x_tmpfontsize; /* temporary value for scalehandle */ + int x_num_fontsize;/* font size for the number only that should + automatically adjust to the box size */ + int x_focused; /* helps us determine when and how we are editing value + 0 no focus, 1 keyboard focus, 2 mouse focus */ int x_log_height; - int x_hide_frame; /* 0 default, 1 just arrow, 2, just frame, 3 both */ + int x_drawstyle; /* 0 default, 1 just frame, 2, just arrow, 3 number only */ } t_my_numbox; extern int sys_noloadbang; @@ -204,7 +209,11 @@ EXTERN void iemgui_verify_snd_ne_rcv(t_iemgui *iemgui); EXTERN t_symbol *iemgui_getfloatsym(t_atom *a); EXTERN t_symbol *iemgui_getfloatsymarg(int i, int argc, t_atom *argv); EXTERN void iemgui_new_getnames(t_iemgui *iemgui, int indx, t_atom *argv); + /* old interface, in case we have old externals calling it */ EXTERN void iemgui_all_colfromload(t_iemgui *iemgui, int *bflcol); + /* new interface for handling colors */ +EXTERN void iemgui_all_loadcolors(t_iemgui *x, t_atom *bcol, t_atom *fcol, + t_atom*lcol); EXTERN void iemgui_send(t_iemgui *x, t_symbol *s); EXTERN void iemgui_receive(t_iemgui *x, t_symbol *s); EXTERN void iemgui_label(t_iemgui *x, t_symbol *s); @@ -221,7 +230,7 @@ EXTERN void iemgui_displace_withtag(t_gobj *z, t_glist *glist, int dx, int dy); EXTERN void iemgui_select(t_gobj *z, t_glist *glist, int selected); EXTERN void iemgui_delete(t_gobj *z, t_glist *glist); EXTERN void iemgui_vis(t_gobj *z, t_glist *glist, int vis); -EXTERN void iemgui_save(t_iemgui *x, t_symbol **srl, int *bflcol); +EXTERN void iemgui_save(t_iemgui *x, t_symbol **srl, t_symbol **bflcol); EXTERN void iemgui_properties(t_iemgui *x, t_symbol **srl); EXTERN int iemgui_dialog(t_iemgui *x, int argc, t_atom *argv); @@ -240,7 +249,7 @@ EXTERN void scalehandle_draw_erase2(t_iemgui *x); EXTERN void scalehandle_draw(t_iemgui *x); EXTERN t_scalehandle *scalehandle_new(t_object *x, t_glist *glist, int scale, t_clickhandlefn chf, t_motionhandlefn mhf); EXTERN void scalehandle_free(t_scalehandle *h); -EXTERN void properties_set_field_int(long props, const char *gui_field, int value); +EXTERN void properties_set_field_int(t_int props, const char *gui_field, int value); EXTERN void scalehandle_dragon_label(t_scalehandle *h, float f1, float f2); EXTERN void scalehandle_click_label(t_scalehandle *h); EXTERN void scalehandle_click_scale(t_scalehandle *h); @@ -281,6 +290,7 @@ EXTERN const char *iemgui_typeface(t_iemgui *x); EXTERN void iemgui_class_addmethods(t_class *c); EXTERN void scrollbar_update(t_glist *glist); +EXTERN void scrollbar_synchronous_update(t_glist *glist); EXTERN void iemgui_init(t_iemgui *x, t_floatarg f); EXTERN void iemgui_out_bang(t_iemgui *x, int o, int chk_putin); diff --git a/pd/src/g_array.c b/pd/src/g_array.c index fac752ac05ea46382a875a9482539b5ee66e88bc..4b01e03586d82e4cea6b9bbbadc676ffaed745e6 100644 --- a/pd/src/g_array.c +++ b/pd/src/g_array.c @@ -545,8 +545,8 @@ void canvas_menuarray(t_glist *canvas) gui_vmess("gui_array_new", "si", gfxstub_new2(&x->gl_pd, x), gcount); - //sprintf(cmdbuf, "pdtk_array_dialog %%s array%d 100 3 1 .x%lx black black\n", - // ++gcount, (long unsigned int)canvas); + //sprintf(cmdbuf, "pdtk_array_dialog %%s array%d 100 3 1 .x%zx black black\n", + // ++gcount, (t_int)canvas); //gfxstub_new(&x->gl_pd, x, cmdbuf); } @@ -583,12 +583,12 @@ int garray_properties(t_garray *x, t_symbol **gfxstubp, t_symbol **namep, *fillp = x->x_fillcolor; *outlinep = x->x_outlinecolor; //sprintf(cmdbuf, ((x->x_name->s_name[0] == '$') ? - // "pdtk_array_dialog %%s \\%s %d %d 0 .x%lx %s %s\n" : - // "pdtk_array_dialog %%s %s %d %d 0 .x%lx %s %s\n"), + // "pdtk_array_dialog %%s \\%s %d %d 0 .x%zx %s %s\n" : + // "pdtk_array_dialog %%s %s %d %d 0 .x%zx %s %s\n"), // x->x_name->s_name, // a->a_n, // x->x_saveit + 2 * filestyle + 8 * x->x_hidename + 16 * x->x_joc, - // (long unsigned int)glist_getcanvas(canvas), + // (t_int)glist_getcanvas(canvas), // x->x_fillcolor->s_name, // x->x_outlinecolor->s_name); //gfxstub_new(&x->x_gobj.g_pd, x, cmdbuf); @@ -1265,7 +1265,7 @@ int array_doclick(t_array *array, t_glist *glist, t_scalar *sc, t_array *ap, array_motion_ycumulative = 0; } //fprintf(stderr," glist_grab %d %d\n", xpix, ypix); - glist_grab(glist, 0, array_motion, 0, xpix, ypix); + glist_grab(glist, 0, array_motion, 0, 0, xpix, ypix); } if (alt) { @@ -1348,7 +1348,7 @@ static void garray_select(t_gobj *z, t_glist *glist, int state) t_garray *x = (t_garray *)z; /* There's no replacement for the following command in the new GUI, but it looks like it's not needed anymore. */ - //sys_vgui("pdtk_select_all_gop_widgets .x%lx %lx %d\n", + //sys_vgui("pdtk_select_all_gop_widgets .x%zx %zx %d\n", // glist_getcanvas(glist), x->x_glist, state); extern void scalar_select(t_gobj *z, t_glist *owner, int state); @@ -1502,7 +1502,7 @@ static void garray_doredraw(t_gobj *client, t_glist *glist) canvas_restore_original_position(glist_getcanvas(glist), (t_gobj *)glist, 0, -1); } - //fprintf(stderr,"check if we need to reselect %lx %lx %lx\n", + //fprintf(stderr,"check if we need to reselect %zx %zx %zx\n", // glist_getcanvas(glist), (t_gobj *)glist, glist->gl_owner); int selected = 0; /* Unfortunately I forget to comment this. I can't remember why I @@ -1525,13 +1525,13 @@ static void garray_doredraw(t_gobj *client, t_glist *glist) perhaps with nested GOPs or something? Anyhow if there's a regression this commented-out call might be a place to investigate... */ - //sys_vgui("pdtk_select_all_gop_widgets .x%lx %lx %d\n", + //sys_vgui("pdtk_select_all_gop_widgets .x%zx %zx %d\n", // glist_getcanvas(glist), glist, 1); // a giant kludge-- we really just need gop items // to be children of their gop <group> t_scalar *sc = x->x_scalar; char tagbuf[MAXPDSTRING]; - sprintf(tagbuf, "scalar%lx", (long unsigned int)sc->sc_vec); + sprintf(tagbuf, "scalar%zx", (t_int)sc->sc_vec); gui_vmess("gui_gobj_select", "xs", glist_getcanvas(glist), tagbuf); } diff --git a/pd/src/g_bang.c b/pd/src/g_bang.c index bedbb664d1ecc0e2c931332383cd6bca7783872a..00d2b0be80af02a479e9e97b5ff7694c2977eb3a 100644 --- a/pd/src/g_bang.c +++ b/pd/src/g_bang.c @@ -49,9 +49,9 @@ void bng_draw_new(t_bng *x, t_glist *glist) /* The circle isn't quite centered in the nw.js port. Let's use the old interface to see if there's anything we're doing wrong. Then once we get the circle placement right we can remove the old code here... */ - //sys_vgui(".x%lx.c create circle %f %f -r %f " + //sys_vgui(".x%zx.c create circle %f %f -r %f " // "-stroke $pd_colors(iemgui_border) -fill #%6.6x " - // "-tags {%lxBUT x%lx text iemgui border}\n", + // "-tags {%zxBUT x%zx text iemgui border}\n", // canvas, cx, cy, cr, x->x_flashed?x->x_gui.x_fcol:x->x_gui.x_bcol, // x, x); gui_vmess("gui_bng_new", "xxfff", @@ -196,11 +196,11 @@ static void bng_getrect(t_gobj *z, t_glist *glist, int *xp1, int *yp1, static void bng_save(t_gobj *z, t_binbuf *b) { t_bng *x = (t_bng *)z; - int bflcol[3]; + t_symbol *bflcol[3]; t_symbol *srl[3]; iemgui_save(&x->x_gui, srl, bflcol); - binbuf_addv(b, "ssiisiiiisssiiiiiii;", gensym("#X"),gensym("obj"), + binbuf_addv(b, "ssiisiiiisssiiiisss;", gensym("#X"),gensym("obj"), (int)x->x_gui.x_obj.te_xpix, (int)x->x_gui.x_obj.te_ypix, gensym("bng"), x->x_gui.x_w, x->x_flashtime_hold, x->x_flashtime_break, @@ -430,7 +430,6 @@ static void bng_tick_lck(t_bng *x) static void *bng_new(t_symbol *s, int argc, t_atom *argv) { t_bng *x = (t_bng *)pd_new(bng_class); - int bflcol[]={-262144, -1, -1}; int a=IEM_GUI_DEFAULTSIZE; int ldx=17, ldy=7; int fs=10; @@ -440,6 +439,10 @@ static void *bng_new(t_symbol *s, int argc, t_atom *argv) iem_inttosymargs(&x->x_gui, 0); iem_inttofstyle(&x->x_gui, 0); + x->x_gui.x_bcol = 0xFCFCFC; + x->x_gui.x_fcol = 0x00; + x->x_gui.x_lcol = 0x00; + if((argc == 14)&&IS_A_FLOAT(argv,0) &&IS_A_FLOAT(argv,1)&&IS_A_FLOAT(argv,2) &&IS_A_FLOAT(argv,3) @@ -447,10 +450,8 @@ static void *bng_new(t_symbol *s, int argc, t_atom *argv) &&(IS_A_SYMBOL(argv,5)||IS_A_FLOAT(argv,5)) &&(IS_A_SYMBOL(argv,6)||IS_A_FLOAT(argv,6)) &&IS_A_FLOAT(argv,7)&&IS_A_FLOAT(argv,8) - &&IS_A_FLOAT(argv,9)&&IS_A_FLOAT(argv,10)&&IS_A_FLOAT(argv,11) - &&IS_A_FLOAT(argv,12)&&IS_A_FLOAT(argv,13)) + &&IS_A_FLOAT(argv,9)&&IS_A_FLOAT(argv,10)) { - a = atom_getintarg(0, argc, argv); fthold = atom_getintarg(1, argc, argv); ftbreak = atom_getintarg(2, argc, argv); @@ -460,9 +461,7 @@ static void *bng_new(t_symbol *s, int argc, t_atom *argv) ldy = atom_getintarg(8, argc, argv); iem_inttofstyle(&x->x_gui, atom_getintarg(9, argc, argv)); fs = maxi(atom_getintarg(10, argc, argv),4); - bflcol[0] = atom_getintarg(11, argc, argv); - bflcol[1] = atom_getintarg(12, argc, argv); - bflcol[2] = atom_getintarg(13, argc, argv); + iemgui_all_loadcolors(&x->x_gui, argv+11, argv+12, argv+13); } else iemgui_new_getnames(&x->x_gui, 4, 0); @@ -479,7 +478,6 @@ static void *bng_new(t_symbol *s, int argc, t_atom *argv) x->x_gui.x_w = iemgui_clip_size(a); x->x_gui.x_h = x->x_gui.x_w; bng_check_minmax(x, ftbreak, fthold); - iemgui_all_colfromload(&x->x_gui, bflcol); x->x_gui.x_locked = 0; iemgui_verify_snd_ne_rcv(&x->x_gui); x->x_clock_hld = clock_new(x, (t_method)bng_tick_hld); diff --git a/pd/src/g_canvas.c b/pd/src/g_canvas.c index b4e4fd4c86783196027080d8919aa75828132d11..9ae490767fb08c0927d0aef3666729a0db965acd 100644 --- a/pd/src/g_canvas.c +++ b/pd/src/g_canvas.c @@ -10,12 +10,20 @@ to be different but are now unified except for some fossilized names.) */ #include "m_pd.h" #include "m_imp.h" #include "s_stuff.h" +#include "s_utf8.h" #include "g_magicglass.h" #include "g_canvas.h" #include "g_all_guis.h" #include <string.h> #include <math.h> +#ifdef MSW +#include <io.h> +#endif +#ifdef _MSC_VER +#define snprintf _snprintf +#endif + t_garray *array_garray; t_class *preset_hub_class; t_class *preset_node_class; @@ -35,6 +43,19 @@ struct _canvasenvironment t_namelist *ce_path; /* search path */ }; +t_canvasenvironment *dummy_canvas_env(const char *dir) +{ + static t_canvasenvironment dummy_env = { + .ce_dir = NULL, + .ce_argc = 0, + .ce_argv = NULL, + .ce_dollarzero = 0, + .ce_path = NULL + }; + dummy_env.ce_dir = gensym(dir); + return &dummy_env; +} + #define GLIST_DEFCANVASWIDTH 450 #define GLIST_DEFCANVASHEIGHT 300 @@ -74,6 +95,8 @@ static t_symbol *canvas_newdirectory = &s_; static int canvas_newargc; static t_atom *canvas_newargv; +static t_ab_definition *canvas_newabsource = 0; + /* maintain the list of visible toplevels for the GUI's "windows" menu */ void canvas_updatewindowlist( void) { @@ -90,7 +113,7 @@ void canvas_updatewindowlist( void) if (x->gl_havewindow) { gui_s(x->gl_name->s_name); - gui_x((long unsigned int)x); + gui_x((t_int)x); } } } @@ -136,6 +159,12 @@ void glob_setfilename(void *dummy, t_symbol *filesym, t_symbol *dirsym) canvas_newdirectory = dirsym; } +/* set the source for the next canvas, it will be an ab instance */ +void canvas_setabsource(t_ab_definition *abdef) +{ + canvas_newabsource = abdef; +} + t_canvas *canvas_getcurrent(void) { return ((t_canvas *)pd_findbyclass(&s__X, canvas_class)); @@ -210,12 +239,16 @@ t_symbol *canvas_realizedollar(t_canvas *x, t_symbol *s) t_symbol *canvas_getcurrentdir(void) { - t_canvasenvironment *e = canvas_getenv(canvas_getcurrent()); - return (e->ce_dir); + return (canvas_getdir(canvas_getcurrent())); } +/* ** refactored function, check for errors */ t_symbol *canvas_getdir(t_canvas *x) { + x = canvas_getrootfor(x); + /* in the case the root is an ab instance, we borrow the + dir from the main root canvas (where the definition is stored) */ + if(x->gl_isab) x = x->gl_absource->ad_owner; t_canvasenvironment *e = canvas_getenv(x); return (e->ce_dir); } @@ -388,6 +421,9 @@ static int calculate_zoom(t_float zoom_hack) return zoom; } +int canvas_dirty_broadcast_all(t_symbol *name, t_symbol *dir, int mess); +int canvas_dirty_broadcast_ab(t_canvas *x, t_ab_definition *abdef, int mess); + /* make a new glist. It will either be a "root" canvas or else it appears as a "text" object in another window (canvas_getcurrent() tells us which.) */ @@ -416,7 +452,7 @@ t_canvas *canvas_new(void *dummy, t_symbol *sel, int argc, t_atom *argv) x->gl_obj.te_type = T_OBJECT; if (!owner) canvas_addtolist(x); - /* post("canvas %lx, owner %lx", x, owner); */ + /* post("canvas %zx, owner %zx", x, owner); */ if (argc == 5) /* toplevel: x, y, w, h, font */ { @@ -463,6 +499,20 @@ t_canvas *canvas_new(void *dummy, t_symbol *sel, int argc, t_atom *argv) } else x->gl_env = 0; + x->gl_abdefs = 0; + /* if canvas_newabsource is set means that + this canvas is going to be an ab instance */ + if(canvas_newabsource) + { + x->gl_isab = 1; + x->gl_absource = canvas_newabsource; + canvas_newabsource = 0; + } + else x->gl_isab = 0; + + x->gl_subdirties = 0; + x->gl_dirties = 0; + if (yloc < GLIST_DEFCANVASYLOC) yloc = GLIST_DEFCANVASYLOC; if (xloc < 0) @@ -479,7 +529,7 @@ t_canvas *canvas_new(void *dummy, t_symbol *sel, int argc, t_atom *argv) canvas_bind(x); x->gl_loading = 1; x->gl_unloading = 0; - //fprintf(stderr,"loading = 1 .x%lx owner=.x%lx\n", (t_int)x, (t_int)x->gl_owner); + //fprintf(stderr,"loading = 1 .x%zx owner=.x%zx\n", (t_uint)x, (t_uint)x->gl_owner); x->gl_goprect = 0; /* no GOP rectangle unless it's turned on later */ /* cancel "vis" flag if we're a subpatch of an abstraction inside another patch. A separate mechanism prevents @@ -495,6 +545,7 @@ t_canvas *canvas_new(void *dummy, t_symbol *sel, int argc, t_atom *argv) } x->gl_willvis = vis; x->gl_edit = !strncmp(x->gl_name->s_name, "Untitled", 8); + x->gl_edit_save = 0; x->gl_font = sys_nearestfontsize(font); x->gl_zoom = zoom; pd_pushsym(&x->gl_pd); @@ -511,6 +562,17 @@ t_canvas *canvas_new(void *dummy, t_symbol *sel, int argc, t_atom *argv) canvas_field_vec = NULL; canvas_field_gp = NULL; + /* in the case it is an abstraction (gl_env is not null) + get the number of dirty instances of this same abstraction */ + if(x->gl_env) + { + if(!x->gl_isab) + x->gl_dirties = canvas_dirty_broadcast_all(x->gl_name, + canvas_getdir(x), 0); + else + x->gl_dirties = canvas_dirty_broadcast_ab(canvas_getrootfor_ab(x), x->gl_absource, 0); + } + return(x); } @@ -618,6 +680,8 @@ void glist_glist(t_glist *g, t_symbol *s, int argc, t_atom *argv) { if (canvas_hasarray(g)) return; pd_vmess(&g->gl_pd, gensym("editmode"), "i", 1); + // disallow creation of new objects in scalars only window + if (canvas_has_scalars_only(g) == 2) return; t_symbol *sym = atom_getsymbolarg(0, argc, argv); /* if we wish to put a graph where the mouse is we need to replace bogus name */ if (!strcmp(sym->s_name, "NULL")) sym = &s_; @@ -704,6 +768,14 @@ t_symbol *canvas_makebindsym(t_symbol *s) return (gensym(buf)); } +t_symbol *canvas_makebindsym_ab(t_symbol *s) +{ + char buf[MAXPDSTRING]; + snprintf(buf, MAXPDSTRING-1, "ab-%s", s->s_name); + buf[MAXPDSTRING-1] = 0; + return (gensym(buf)); +} + int garray_getname(t_garray *x, t_symbol **namep); void canvas_args_to_string(char *namebuf, t_canvas *x) @@ -728,14 +800,15 @@ void canvas_args_to_string(char *namebuf, t_canvas *x) { namebuf[0] = 0; t_gobj *g = NULL; + t_garray *a = NULL; t_symbol *arrayname; - int found = 0; + int found = 0, res; for (g = x->gl_list; g; g = g->g_next) { if (pd_class(&g->g_pd) == garray_class) { - garray_getname((t_garray *)g, &arrayname); + res = garray_getname((t_garray *)g, &arrayname); if (found) { strcat(namebuf, " "); @@ -757,6 +830,186 @@ void canvas_reflecttitle(t_canvas *x) namebuf, canvas_getdir(x)->s_name, x->gl_dirty); } +/* --------------------- */ + +/* climbs up to the root canvas while enabling or disabling visual markings for dirtiness + of traversed canvases */ +void canvas_dirtyclimb(t_canvas *x, int n) +{ + if (x->gl_owner) + { + gobj_dirty(&x->gl_gobj, x->gl_owner, + (n ? 1 : (x->gl_subdirties ? 2 : 0))); + x = x->gl_owner; + while(x->gl_owner) + { + x->gl_subdirties += ((unsigned)n ? 1 : -1); + if(!x->gl_dirty) + gobj_dirty(&x->gl_gobj, x->gl_owner, (x->gl_subdirties ? 2 : 0)); + x = x->gl_owner; + } + } +} + +/* the following functions are used to broadcast messages to all instances of + a specific abstraction (either file-based or ab). + the state of these instances change accoring to the message sent. */ + +void clone_iterate(t_pd *z, t_canvas_iterator it, void* data); +int clone_match(t_pd *z, t_symbol *name, t_symbol *dir); +int clone_isab(t_pd *z); +int clone_matchab(t_pd *z, t_ab_definition *source); + +static void canvas_dirty_common(t_canvas *x, int mess) +{ + if(mess == 2) + { + if(x->gl_dirty) + { + if(!x->gl_havewindow) canvas_vis(x, 1); + gui_vmess("gui_canvas_emphasize", "x", x); + } + } + else + { + x->gl_dirties += mess; + if(x->gl_havewindow) + canvas_warning(x, (x->gl_dirties > 1 ? + (x->gl_dirty ? 2 : 1) + : (x->gl_dirties ? !x->gl_dirty : 0))); + } +} + +/* packed data passing structure for canvas_dirty_broadcast */ +typedef struct _dirty_broadcast_data +{ + t_symbol *name; + t_symbol *dir; + int mess; + int *res; /* return value */ +} t_dirty_broadcast_data; + +static void canvas_dirty_deliver_packed(t_canvas *x, t_dirty_broadcast_data *data) +{ + *data->res += (x->gl_dirty > 0); + canvas_dirty_common(x, data->mess); +} + +static void canvas_dirty_broadcast_packed(t_canvas *x, t_dirty_broadcast_data *data); + +static int canvas_dirty_broadcast(t_canvas *x, t_symbol *name, t_symbol *dir, int mess) +{ + int res = 0; + t_gobj *g; + for (g = x->gl_list; g; g = g->g_next) + { + if(pd_class(&g->g_pd) == canvas_class) + { + if(canvas_isabstraction((t_canvas *)g) && !((t_canvas *)g)->gl_isab + && ((t_canvas *)g)->gl_name == name + && canvas_getdir((t_canvas *)g) == dir) + { + res += (((t_canvas *)g)->gl_dirty > 0); + canvas_dirty_common((t_canvas *)g, mess); + } + else + { + res += canvas_dirty_broadcast((t_canvas *)g, name, dir, mess); + } + } + else if(pd_class(&g->g_pd) == clone_class) + { + int cres = 0; + t_dirty_broadcast_data data; + data.name = name; data.dir = dir; data.mess = mess; data.res = &cres; + if(clone_match(&g->g_pd, name, dir)) + { + clone_iterate(&g->g_pd, canvas_dirty_deliver_packed, &data); + } + else + { + clone_iterate(&g->g_pd, canvas_dirty_broadcast_packed, &data); + } + res += cres; + } + } + return (res); +} + +static void canvas_dirty_broadcast_packed(t_canvas *x, t_dirty_broadcast_data *data) +{ + *data->res = canvas_dirty_broadcast(x, data->name, data->dir, data->mess); +} + +int canvas_dirty_broadcast_all(t_symbol *name, t_symbol *dir, int mess) +{ + int res = 0; + t_canvas *x; + for (x = pd_this->pd_canvaslist; x; x = x->gl_next) + res += canvas_dirty_broadcast(x, name, dir, mess); + return (res); +} + +/* same but for ab */ + +typedef struct _dirty_broadcast_ab_data +{ + t_ab_definition *abdef; + int mess; + int *res; +} t_dirty_broadcast_ab_data; + +static void canvas_dirty_deliver_ab_packed(t_canvas *x, t_dirty_broadcast_ab_data *data) +{ + *data->res += (x->gl_dirty > 0); + canvas_dirty_common(x, data->mess); +} + +static void canvas_dirty_broadcast_ab_packed(t_canvas *x, t_dirty_broadcast_ab_data *data); + +int canvas_dirty_broadcast_ab(t_canvas *x, t_ab_definition *abdef, int mess) +{ + int res = 0; + t_gobj *g; + for (g = x->gl_list; g; g = g->g_next) + { + if(pd_class(&g->g_pd) == canvas_class) + { + if(canvas_isabstraction((t_canvas *)g) && ((t_canvas *)g)->gl_isab + && ((t_canvas *)g)->gl_absource == abdef) + { + res += (((t_canvas *)g)->gl_dirty > 0); + canvas_dirty_common((t_canvas *)g, mess); + } + else if(!canvas_isabstraction((t_canvas *)g) || ((t_canvas *)g)->gl_isab) + { + res += canvas_dirty_broadcast_ab((t_canvas *)g, abdef, mess); + } + } + else if(pd_class(&g->g_pd) == clone_class) + { + int cres = 0; + t_dirty_broadcast_ab_data data; + data.abdef = abdef; data.mess = mess; data.res = &cres; + if(clone_matchab(&g->g_pd, abdef)) + { + clone_iterate(&g->g_pd, canvas_dirty_deliver_ab_packed, &data); + } + else if(clone_isab(&g->g_pd)) + { + clone_iterate(&g->g_pd, canvas_dirty_broadcast_ab_packed, &data); + } + res += cres; + } + } + return (res); +} + +static void canvas_dirty_broadcast_ab_packed(t_canvas *x, t_dirty_broadcast_ab_data *data) +{ + *data->res = canvas_dirty_broadcast_ab(x, data->abdef, data->mess); +} + /* mark a glist dirty or clean */ void canvas_dirty(t_canvas *x, t_floatarg n) { @@ -768,6 +1021,23 @@ void canvas_dirty(t_canvas *x, t_floatarg n) x2->gl_dirty = n; if (x2->gl_havewindow) canvas_reflecttitle(x2); + + /* set dirtiness visual markings */ + canvas_dirtyclimb(x2, (unsigned)n); + + /* in the case it is an abstraction, we tell all other + instances that there is eiher one more dirty instance or + one less dirty instance */ + if(canvas_isabstraction(x2) + && (x2->gl_owner || x2->gl_isclone)) + { + if(!x2->gl_isab) + canvas_dirty_broadcast_all(x2->gl_name, canvas_getdir(x2), + (x2->gl_dirty ? 1 : -1)); + else + canvas_dirty_broadcast_ab(canvas_getrootfor_ab(x2), x2->gl_absource, + (x2->gl_dirty ? 1 : -1)); + } } } @@ -808,9 +1078,9 @@ void canvas_draw_gop_resize_hooks(t_canvas* x) x->gl_goprect && !x->gl_editor->e_selection) { //Drawing and Binding Resize_Blob for GOP - //fprintf(stderr,"draw_gop_resize_hooks DRAW %lx %lx\n", (t_int)x, (t_int)glist_getcanvas(x)); - sprintf(sh->h_pathname, ".x%lx.h%lx", (t_int)x, (t_int)sh); - sprintf(mh->h_pathname, ".x%lx.h%lx", (t_int)x, (t_int)mh); + //fprintf(stderr,"draw_gop_resize_hooks DRAW %zx %zx\n", (t_uint)x, (t_uint)glist_getcanvas(x)); + sprintf(sh->h_pathname, ".x%zx.h%zx", (t_uint)x, (t_uint)sh); + sprintf(mh->h_pathname, ".x%zx.h%zx", (t_uint)x, (t_uint)mh); /* These are handled now in canvas_doclick */ //scalehandle_draw_select(sh, @@ -861,7 +1131,7 @@ void canvas_drawredrect(t_canvas *x, int doit) called from the GUI after the fact to "notify" us that we're mapped. */ void canvas_map(t_canvas *x, t_floatarg f) { - //fprintf(stderr,"canvas_map %lx %f\n", (t_int)x, f); + //fprintf(stderr,"canvas_map %zx %f\n", (t_uint)x, f); int flag = (f != 0); t_gobj *y; if (flag) @@ -915,7 +1185,7 @@ void canvas_map(t_canvas *x, t_floatarg f) void canvas_redraw(t_canvas *x) { if (do_not_redraw) return; - //fprintf(stderr,"canvas_redraw %lx\n", (t_int)x); + //fprintf(stderr,"canvas_redraw %zx\n", (t_uint)x); if (glist_isvisible(x)) { //fprintf(stderr,"canvas_redraw glist_isvisible=true\n"); @@ -958,7 +1228,7 @@ void glist_menu_open(t_glist *x) else { // Not sure if this needs to get ported... need to test - //sys_vgui("focus .x%lx\n", (t_int)x); + //sys_vgui("focus .x%zx\n", (t_uint)x); } } else @@ -992,10 +1262,30 @@ int glist_getfont(t_glist *x) } extern void canvas_group_free(t_pd *x); +static void canvas_deregister_ab(t_canvas *x, t_ab_definition *a); void canvas_free(t_canvas *x) { - //fprintf(stderr,"canvas_free %lx\n", (t_int)x); + //fprintf(stderr,"canvas_free %zx\n", (t_uint)x); + + /* crude hack. in the case it was a clone instance, it shouldn't have an owner. + For ab instances, we have set the owner inside clone_free because we need it + in order to deregister the dependencies. + here we set it to NULL again to prevent any error in the functions called bellow */ + t_canvas *aux = x->gl_owner; + if(x->gl_isclone) x->gl_owner = 0; + + /* in the case it is a dirty abstraction, we tell all other + instances that there is one less dirty instance */ + if(canvas_isabstraction(x) && x->gl_dirty + && (x->gl_owner || x->gl_isclone)) + { + if(!x->gl_isab) + canvas_dirty_broadcast_all(x->gl_name, canvas_getdir(x), -1); + else + canvas_dirty_broadcast_ab(canvas_getrootfor_ab(x), x->gl_absource, -1); + } + t_gobj *y; int dspstate = canvas_suspend_dsp(); @@ -1033,6 +1323,26 @@ void canvas_free(t_canvas *x) canvas_takeofflist(x); if (x->gl_svg) /* for groups, free the data */ canvas_group_free(x->gl_svg); + + /* freeing an ab instance */ + if(x->gl_isab) + { + x->gl_absource->ad_numinstances--; + canvas_deregister_ab((x->gl_isclone ? aux : x->gl_owner), + x->gl_absource); + } + + /* free stored ab definitions */ + t_ab_definition *d = x->gl_abdefs, *daux; + while(d) + { + daux = d->ad_next; + binbuf_free(d->ad_source); + freebytes(d->ad_dep, sizeof(t_ab_definition*)*d->ad_numdep); + freebytes(d->ad_deprefs, sizeof(int)*d->ad_numdep); + freebytes(d, sizeof(t_ab_definition)); + d = daux; + } } /* ----------------- lines ---------- */ @@ -1083,7 +1393,7 @@ void canvas_deletelinesfor(t_canvas *x, t_text *text) { /* Still don't see any place where this gets used. Maybe it's used by older externals? Need to test... */ - //sys_vgui(".x%lx.c delete l%lx\n", + //sys_vgui(".x%zx.c delete l%zx\n", // glist_getcanvas(x), oc); /* probably need a gui_vmess here */ } @@ -1106,7 +1416,7 @@ void canvas_eraselinesfor(t_canvas *x, t_text *text) if (x->gl_editor) { char tagbuf[MAXPDSTRING]; - sprintf(tagbuf, "l%lx", (long unsigned int)oc); + sprintf(tagbuf, "l%zx", (t_uint)oc); gui_vmess("gui_canvas_delete_line", "xs", glist_getcanvas(x), tagbuf); } @@ -1130,7 +1440,7 @@ void canvas_deletelinesforio(t_canvas *x, t_text *text, if (x->gl_editor) { char buf[MAXPDSTRING]; - sprintf(buf, "l%lx", (long unsigned int)oc); + sprintf(buf, "l%zx", (t_uint)oc); gui_vmess("gui_canvas_delete_line", "xs", glist_getcanvas(x), buf); @@ -1148,7 +1458,7 @@ static void canvas_pop(t_canvas *x, t_floatarg fvis) canvas_resortinlets(x); canvas_resortoutlets(x); x->gl_loading = 0; - //fprintf(stderr,"loading = 0 .x%lx owner=.x%lx\n", x, x->gl_owner); + //fprintf(stderr,"loading = 0 .x%zx owner=.x%zx\n", x, x->gl_owner); } extern void *svg_new(t_pd *x, t_symbol *s, int argc, t_atom *argv); @@ -1168,7 +1478,7 @@ void canvas_restore(t_canvas *x, t_symbol *s, int argc, t_atom *argv) { t_pd *z; int is_draw_command = 0; - //fprintf(stderr,"canvas_restore %lx\n", x); + //fprintf(stderr,"canvas_restore %zx\n", x); /* for [draw g] and [draw svg] we add an inlet to the svg attr proxy */ if (atom_getsymbolarg(2, argc, argv) == gensym("draw")) { @@ -1211,7 +1521,7 @@ void canvas_loadbangsubpatches(t_canvas *x, t_symbol *s) { if (!canvas_isabstraction((t_canvas *)y)) { - //fprintf(stderr,"%lx s:canvas_loadbangsubpatches %s\n", + //fprintf(stderr,"%zx s:canvas_loadbangsubpatches %s\n", // x, s->s_name); canvas_loadbangsubpatches((t_canvas *)y, s); } @@ -1220,7 +1530,7 @@ void canvas_loadbangsubpatches(t_canvas *x, t_symbol *s) if ((pd_class(&y->g_pd) != canvas_class) && zgetfn(&y->g_pd, s)) { - //fprintf(stderr,"%lx s:obj_loadbang %s\n",x,s->s_name); + //fprintf(stderr,"%zx s:obj_loadbang %s\n",x,s->s_name); pd_vmess(&y->g_pd, s, "f", (t_floatarg)LB_LOAD); } } @@ -1234,13 +1544,13 @@ static void canvas_loadbangabstractions(t_canvas *x, t_symbol *s) { if (canvas_isabstraction((t_canvas *)y)) { - //fprintf(stderr,"%lx a:canvas_loadbang %s\n",x,s->s_name); + //fprintf(stderr,"%zx a:canvas_loadbang %s\n",x,s->s_name); canvas_loadbangabstractions((t_canvas *)y, s); canvas_loadbangsubpatches((t_canvas *)y, s); } else { - //fprintf(stderr,"%lx a:canvas_loadbangabstractions %s\n", + //fprintf(stderr,"%zx a:canvas_loadbangabstractions %s\n", // x, s->s_name); canvas_loadbangabstractions((t_canvas *)y, s); } @@ -1251,14 +1561,14 @@ void canvas_loadbang(t_canvas *x) { //t_gobj *y; // first loadbang preset hubs and nodes - //fprintf(stderr,"%lx 0\n", x); + //fprintf(stderr,"%zx 0\n", x); canvas_loadbangabstractions(x, gensym("pre-loadbang")); canvas_loadbangsubpatches(x, gensym("pre-loadbang")); - //fprintf(stderr,"%lx 1\n", x); + //fprintf(stderr,"%zx 1\n", x); // then do the regular loadbang canvas_loadbangabstractions(x, gensym("loadbang")); canvas_loadbangsubpatches(x, gensym("loadbang")); - //fprintf(stderr,"%lx 2\n", x); + //fprintf(stderr,"%zx 2\n", x); } /* JMZ/MSP: @@ -1391,13 +1701,15 @@ static void canvas_relocate(t_canvas *x, t_symbol *canvasgeom, void canvas_popabstraction(t_canvas *x) { newest = &x->gl_pd; + gensym("#A")->s_thing = 0; + pd_bind(newest, gensym("#A")); pd_popsym(&x->gl_pd); //x->gl_loading = 1; - //fprintf(stderr,"loading = 1 .x%lx owner=.x%lx\n", x, x->gl_owner); + //fprintf(stderr,"loading = 1 .x%zx owner=.x%zx\n", x, x->gl_owner); canvas_resortinlets(x); canvas_resortoutlets(x); x->gl_loading = 0; - //fprintf(stderr,"loading = 0 .x%lx owner=.x%lx\n", x, x->gl_owner); + //fprintf(stderr,"loading = 0 .x%zx owner=.x%zx\n", x, x->gl_owner); } void canvas_logerror(t_object *y) @@ -1415,7 +1727,7 @@ static void *subcanvas_new(t_symbol *s) { t_atom a[6]; t_canvas *x, *z = canvas_getcurrent(); - //fprintf(stderr,"subcanvas_new current canvas .x%lx\n", (t_int)z); + //fprintf(stderr,"subcanvas_new current canvas .x%zx\n", (t_uint)z); if (!*s->s_name) s = gensym("/SUBPATCH/"); SETFLOAT(a, 0); SETFLOAT(a+1, GLIST_DEFCANVASYLOC); @@ -1564,13 +1876,17 @@ static int canvas_should_bind(t_canvas *x) static void canvas_bind(t_canvas *x) { - if (canvas_should_bind(x)) + if (x->gl_isab) /* if it is an ab instance, we bind it to symbol 'ab-<name>' */ + pd_bind(&x->gl_pd, canvas_makebindsym_ab(x->gl_name)); + else if (canvas_should_bind(x)) pd_bind(&x->gl_pd, canvas_makebindsym(x->gl_name)); } static void canvas_unbind(t_canvas *x) { - if (canvas_should_bind(x)) + if (x->gl_isab) + pd_unbind(&x->gl_pd, canvas_makebindsym_ab(x->gl_name)); + else if (canvas_should_bind(x)) pd_unbind(&x->gl_pd, canvas_makebindsym(x->gl_name)); } @@ -1812,7 +2128,7 @@ static void glist_redrawall(t_template *template, t_glist *gl, int action) { /* Haven't tested scalars inside gop yet, but we probably need a gui_vmess here */ - sys_vgui("pdtk_select_all_gop_widgets .x%lx %lx %d\n", + sys_vgui("pdtk_select_all_gop_widgets .x%zx %zx %d\n", glist_getcanvas(gl), gl, 1); } } @@ -1853,6 +2169,533 @@ void canvas_redrawallfortemplatecanvas(t_canvas *x, int action) canvas_redrawallfortemplate(0, action); } +/* ------------------------------- ab ------------------------ */ + +static char ab_templatecanvas[] = "#N canvas;\n"; + +/* create an ab instance from its source */ +static t_pd *do_create_ab(t_ab_definition *abdef, int argc, t_atom *argv) +{ + canvas_setargs(argc, argv); + int dspstate = canvas_suspend_dsp(); + glob_setfilename(0, abdef->ad_name, gensym("[ab]")); + + /* set ab source, next canvas is going to be a private abstraction */ + canvas_setabsource(abdef); + binbuf_eval(abdef->ad_source, 0, 0, 0); + canvas_initbang((t_canvas *)(s__X.s_thing)); + + glob_setfilename(0, &s_, &s_); + canvas_resume_dsp(dspstate); + canvas_popabstraction((t_canvas *)(s__X.s_thing)); + canvas_setargs(0, 0); + + /* open the canvas if we are creating it for the first time */ + canvas_vis((t_canvas *)newest, !glist_amreloadingabstractions + && !abdef->ad_numinstances + && binbuf_getnatom(abdef->ad_source) == 3); + + return(newest); +} + +/* get root canvas crossing ab boundaries, where ab definitions are stored */ +t_canvas *canvas_getrootfor_ab(t_canvas *x) +{ + if ((!x->gl_owner && !x->gl_isclone) || (canvas_isabstraction(x) && !x->gl_isab)) + return (x); + else if (x->gl_isab) /* shortcut + workaround for clones (since they haven't owner)*/ + return (x->gl_absource->ad_owner); + else + return (canvas_getrootfor_ab(x->gl_owner)); +} + +/* check if the dependency graph has a cycle, assuming an new edge between parent and + current nodes if there is a cycle, a visual scheme of the cycle is stored in 'res' */ +static int ab_check_cycle(t_ab_definition *current, t_ab_definition *parent, int pathlen, + char *path, char *res) +{ + if(current == parent) + { + sprintf(path+pathlen, "[ab %s]", current->ad_name->s_name); + strcpy(res, path); + return (1); + } + else + { + /* if it is a local private abstraction, get rid of classmember-like names (only used internally) */ + char *hash = strrchr(current->ad_name->s_name, '#'); + if(!hash) hash = current->ad_name->s_name; + else hash += 1; + int len = strlen(hash); + sprintf(path+pathlen, "[ab %s]<-", hash); + pathlen += (len+7); + int i, cycle = 0; + for(i = 0; !cycle && i < current->ad_numdep; i++) + { + cycle = ab_check_cycle(current->ad_dep[i], parent, pathlen, path, res); + } + pathlen -= (len+7); + return (cycle); + } +} + +/* try to register a new dependency into the dependency graph, + returns 0 and the scheme in 'res' if a dependency issue is found */ +static int canvas_register_ab(t_canvas *x, t_ab_definition *a, char *res) +{ + /* climb to closest ab */ + while(x && !x->gl_isab) + x = x->gl_owner; + + if(x && x->gl_isab) + { + t_ab_definition *f = x->gl_absource; + + int i, found = 0; + for(i = 0; !found && i < a->ad_numdep; i++) + found = (a->ad_dep[i] == f); + + if(!found) + { + char path[MAXPDSTRING]; + sprintf(path, "[ab %s]<-", a->ad_name->s_name); + if(!ab_check_cycle(f, a, strlen(path), path, res)) + { + /* no dependency issues found so we add the new dependency */ + a->ad_dep = + (t_ab_definition **)resizebytes(a->ad_dep, sizeof(t_ab_definition *)*a->ad_numdep, + sizeof(t_ab_definition *)*(a->ad_numdep+1)); + a->ad_deprefs = + (int *)resizebytes(a->ad_deprefs, sizeof(int)*a->ad_numdep, + sizeof(int)*(a->ad_numdep+1)); + a->ad_dep[a->ad_numdep] = f; + a->ad_deprefs[a->ad_numdep] = 1; + a->ad_numdep++; + } + else return (0); + } + else + { + a->ad_deprefs[i-1]++; + } + } + return (1); +} + +static void canvas_deregister_ab(t_canvas *x, t_ab_definition *a) +{ + /* climb to closest ab */ + while(x && !x->gl_isab) + x = x->gl_owner; + + if(x && x->gl_isab) + { + t_ab_definition *f = x->gl_absource; + + int i, found = 0; + for(i = 0; !found && i < a->ad_numdep; i++) + found = (a->ad_dep[i] == f); + + if(found) + { + a->ad_deprefs[i-1]--; + + if(!a->ad_deprefs[i-1]) + { + /* we can delete the dependency since there are no instances left */ + t_ab_definition **ad = + (t_ab_definition **)getbytes(sizeof(t_ab_definition *) * (a->ad_numdep - 1)); + int *adr = (int *)getbytes(sizeof(int) * (a->ad_numdep - 1)); + memcpy(ad, a->ad_dep, sizeof(t_ab_definition *) * (i-1)); + memcpy(ad+(i-1), a->ad_dep+i, sizeof(t_ab_definition *) * (a->ad_numdep - i)); + memcpy(adr, a->ad_deprefs, sizeof(int) * (i-1)); + memcpy(adr+(i-1), a->ad_deprefs+i, sizeof(int) * (a->ad_numdep - i)); + freebytes(a->ad_dep, sizeof(t_ab_definition *) * a->ad_numdep); + freebytes(a->ad_deprefs, sizeof(int) * a->ad_numdep); + a->ad_numdep--; + a->ad_dep = ad; + a->ad_deprefs = adr; + } + } + else bug("canvas_deregister_ab"); + } +} + +/* tries to find an ab definition given its name */ +static t_ab_definition *canvas_find_ab(t_canvas *x, t_symbol *name) +{ + t_canvas *c = canvas_getrootfor_ab(x); + t_ab_definition* d; + for (d = c->gl_abdefs; d; d = d->ad_next) + { + if (d->ad_name == name) + return d; + } + return 0; +} + +/* tries to add a new ab definition. returns the definition if it has been added, 0 otherwise */ +static t_ab_definition *canvas_add_ab(t_canvas *x, t_symbol *name, t_binbuf *source) +{ + if(!canvas_find_ab(x, name)) + { + t_canvas *c = canvas_getrootfor_ab(x); + t_ab_definition *abdef = (t_ab_definition *)getbytes(sizeof(t_ab_definition)); + + abdef->ad_name = name; + abdef->ad_source = source; + abdef->ad_numinstances = 0; + abdef->ad_owner = c; + abdef->ad_numdep = 0; + abdef->ad_dep = (t_ab_definition **)getbytes(0); + abdef->ad_deprefs = (int *)getbytes(0); + abdef->ad_visflag = 0; + + abdef->ad_next = c->gl_abdefs; + c->gl_abdefs = abdef; + return (abdef); + } + return (0); +} + +static int canvas_del_ab(t_canvas *x, t_symbol *name) +{ + t_canvas *c = canvas_getrootfor_ab(x); + t_ab_definition *abdef, *abdefpre; + for(abdef = c->gl_abdefs, abdefpre = 0; abdef; abdefpre = abdef, abdef = abdef->ad_next) + { + if(abdef->ad_name == name && !abdef->ad_numinstances) + { + if(abdefpre) abdefpre->ad_next = abdef->ad_next; + else c->gl_abdefs = abdef->ad_next; + binbuf_free(abdef->ad_source); + freebytes(abdef->ad_dep, sizeof(t_ab_definition*)*abdef->ad_numdep); + freebytes(abdef->ad_deprefs, sizeof(int)*abdef->ad_numdep); + freebytes(abdef, sizeof(t_ab_definition)); + return (1); + } + } + return (0); +} + +/* given the ab definitions list, returns its topological ordering */ + +static int currvisflag = 0; + +static void ab_topological_sort_rec(t_ab_definition *a, t_ab_definition **stack, int *head) +{ + a->ad_visflag = currvisflag; + + int i; + for(i = 0; i < a->ad_numdep; i++) + { + if(a->ad_dep[i]->ad_visflag != currvisflag) + ab_topological_sort_rec(a->ad_dep[i], stack, head); + } + + stack[*head] = a; + (*head)++; +} + +static void ab_topological_sort(t_ab_definition *abdefs, t_ab_definition **stack, int *head) +{ + currvisflag++; + t_ab_definition *abdef; + for(abdef = abdefs; abdef; abdef = abdef->ad_next) + { + if(abdef->ad_visflag != currvisflag) + ab_topological_sort_rec(abdef, stack, head); + } +} + +/* saves all ab definition within the scope into the b binbuf, + they are sorted topollogially before saving in order to get exactly the + same state (ab objects that can't be instantiated due dependencies) when reloading the file */ +void canvas_saveabdefinitionsto(t_canvas *x, t_binbuf *b) +{ + if(!x->gl_abdefs) + return; + + int numabdefs = 0; + t_ab_definition *abdef; + for(abdef = x->gl_abdefs; abdef; abdef = abdef->ad_next) + numabdefs++; + + t_ab_definition **stack = + (t_ab_definition **)getbytes(sizeof(t_ab_definition *) * numabdefs); + int head = 0; + ab_topological_sort(x->gl_abdefs, stack, &head); + + int i, fra = 0; + for(i = 0; i < head; i++) + { + if(stack[i]->ad_numinstances) + { + if(!fra) + { + binbuf_addv(b, "ssi;", gensym("#X"), gensym("abframe"), 1); + fra = 1; + } + + binbuf_add(b, binbuf_getnatom(stack[i]->ad_source), binbuf_getvec(stack[i]->ad_source)); + binbuf_addv(b, "sss", gensym("#X"), gensym("abpush"), stack[i]->ad_name); + + int j; + for(j = 0; j < stack[i]->ad_numdep; j++) + binbuf_addv(b, "s", stack[i]->ad_dep[j]->ad_name); + binbuf_addsemi(b); + } + } + if(fra) binbuf_addv(b, "ssi;", gensym("#X"), gensym("abframe"), 0); + + freebytes(stack, sizeof(t_ab_definition *) * numabdefs); +} + +/* saves last canvas as an ab definition */ +static void canvas_abpush(t_canvas *x, t_symbol *s, int argc, t_atom *argv) +{ + canvas_pop(x, 0); + + t_canvas *c = canvas_getcurrent(); + t_symbol *name = argv[0].a_w.w_symbol; + t_binbuf *source = binbuf_new(); + x->gl_env = dummy_canvas_env(canvas_getdir(x)->s_name); //to save it as a root canvas + mess1(&((t_text *)x)->te_pd, gensym("saveto"), source); + x->gl_env = 0; + + t_ab_definition *n; + if(!(n = canvas_add_ab(c, name, source))) + { + error("canvas_abpush: ab definition for '%s' already exists, skipping", + name->s_name); + } + else + { + if(argc > 1) + { + /* restore all dependencies, to get exactly the + same state (ab objects that can't be instantiated due dependencies) as before */ + n->ad_numdep = argc-1; + n->ad_dep = + (t_ab_definition **)resizebytes(n->ad_dep, 0, sizeof(t_ab_definition *)*n->ad_numdep); + n->ad_deprefs = + (int *)resizebytes(n->ad_deprefs, 0, sizeof(int)*n->ad_numdep); + + int i; + for(i = 1; i < argc; i++) + { + t_symbol *abname = argv[i].a_w.w_symbol; + t_ab_definition *absource = canvas_find_ab(c, abname); + if(!absource) { bug("canvas_abpush"); return; } + n->ad_dep[i-1] = absource; + n->ad_deprefs[i-1] = 0; + } + } + } + + pd_free(&x->gl_pd); +} + +/* extends the name for a local ab, using a classmember-like format */ +static t_symbol *ab_extend_name(t_canvas *x, t_symbol *s) +{ + char res[MAXPDSTRING]; + t_canvas *next = canvas_getrootfor(x); + if(next->gl_isab) + sprintf(res, "%s#%s", next->gl_absource->ad_name->s_name, s->s_name); + else + strcpy(res, s->s_name); + return gensym(res); +} + +int abframe = 0; +static void canvas_abframe(t_canvas *x, t_float val) +{ + abframe = val; +} + +extern t_class *text_class; + +/* creator for "ab" objects */ +static void *ab_new(t_symbol *s, int argc, t_atom *argv) +{ + if(abframe) + /* return dummy text object so that creator + does not throw an error */ + return pd_new(text_class); + + t_canvas *c = canvas_getcurrent(); + + if (argc && argv[0].a_type != A_SYMBOL) + { + error("ab_new: ab name must be a symbol"); + newest = 0; + } + else + { + t_symbol *name = (argc ? argv[0].a_w.w_symbol : gensym("(ab)")); + t_ab_definition *source; + + if(name->s_name[0] == '@') /* is local ab */ + name = ab_extend_name(c, name); + + if(!(source = canvas_find_ab(c, name))) + { + t_binbuf *b = binbuf_new(); + binbuf_text(b, ab_templatecanvas, strlen(ab_templatecanvas)); + source = canvas_add_ab(c, name, b); + } + + char res[MAXPDSTRING]; + if(canvas_register_ab(c, source, res)) + { + newest = do_create_ab(source, (argc ? argc-1 : 0), (argc ? argv+1 : 0)); + source->ad_numinstances++; + } + else + { + if(!glist_amreloadingabstractions) + error("ab_new: can't insantiate ab within itself\n cycle: %s", res); + newest = 0; + } + } + return (newest); +} + +static void canvas_getabstractions(t_canvas *x) +{ + t_canvas *c = canvas_getrootfor_ab(x), + *r = canvas_getrootfor(x); + gfxstub_deleteforkey(x); + char *gfxstub = gfxstub_new2(&x->gl_pd, &x->gl_pd); + t_ab_definition *abdef; + gui_start_vmess("gui_abstractions_dialog", "xs", x, gfxstub); + gui_start_array(); + gui_end_array(); + gui_start_array(); + for(abdef = c->gl_abdefs; abdef; abdef = abdef->ad_next) + { + char *hash = strrchr(abdef->ad_name->s_name, '#'); + if(!hash) + { + if(abdef->ad_name->s_name[0] != '@' || !r->gl_isab) + { + gui_s(abdef->ad_name->s_name); + gui_i(abdef->ad_numinstances); + } + } + else + { + *hash = '\0'; + if(r->gl_isab && + gensym(abdef->ad_name->s_name) == r->gl_absource->ad_name) + { + gui_s(hash+1); + gui_i(abdef->ad_numinstances); + } + *hash = '#'; + } + } + gui_end_array(); + gui_end_vmess(); +} + +static void canvas_delabstractions(t_canvas *x, t_symbol *s, int argc, t_atom *argv) +{ + t_symbol *name; + int i; + for(i = 0; i < argc; i++) + { + name = atom_getsymbol(argv++); + if(name->s_name[0] == '@') + name = ab_extend_name(x, name); + if(!canvas_del_ab(x, name)) + bug("canvas_delabstractions"); + } + startpost("info: a total of [%d] ab definitions have been deleted\n > ", argc); + postatom(argc, argv-argc); + endpost(); +} + +/* --------- */ + +static t_class *abdefs_class; + +typedef struct _abdefs +{ + t_object x_obj; + t_canvas *x_canvas; +} t_abdefs; + +static void *abdefs_new(void) +{ + t_abdefs *x = (t_abdefs *)pd_new(abdefs_class); + x->x_canvas = canvas_getcurrent(); + outlet_new(&x->x_obj, &s_list); + return (x); +} + +static void abdefs_get(t_abdefs *x); +static void abdefs_bang(t_abdefs *x) +{ + abdefs_get(x); +} + +static void abdefs_get(t_abdefs *x) +{ + t_canvas *c = canvas_getrootfor_ab(x->x_canvas), + *r = canvas_getrootfor(x->x_canvas); + t_binbuf *out = binbuf_new(); + t_ab_definition *abdef; + for(abdef = c->gl_abdefs; abdef; abdef = abdef->ad_next) + { + char *hash = strrchr(abdef->ad_name->s_name, '#'); + if(!hash) + { + if(abdef->ad_name->s_name[0] != '@' || !r->gl_isab) + { + binbuf_addv(out, "si", abdef->ad_name, abdef->ad_numinstances); + } + } + else + { + *hash = '\0'; + if(r->gl_isab && + gensym(abdef->ad_name->s_name) == r->gl_absource->ad_name) + { + binbuf_addv(out, "si", gensym(hash+1), abdef->ad_numinstances); + } + *hash = '#'; + } + } + outlet_list(x->x_obj.ob_outlet, &s_list, + binbuf_getnatom(out), binbuf_getvec(out)); + binbuf_free(out); +} + +static void abdefs_instances(t_abdefs *x, t_symbol *s) +{ + t_ab_definition *abdef; + if((abdef = canvas_find_ab(x->x_canvas, s))) + { + t_atom at[1]; + SETFLOAT(at, abdef->ad_numinstances); + outlet_list(x->x_obj.ob_outlet, &s_list, 1, at); + } + else + error("abdefs: couldn't find definition for '%s'", s->s_name); +} + +/* --------- */ + +static void canvas_showdirty(t_canvas *x) +{ + if(!x->gl_isab) + canvas_dirty_broadcast_all(x->gl_name, canvas_getdir(x), 2); + else + canvas_dirty_broadcast_ab(canvas_getrootfor_ab(x), x->gl_absource, 2); +} + /* ------------------------------- declare ------------------------ */ /* put "declare" objects in a patch to tell it about the environment in @@ -2054,7 +2897,14 @@ void canvas_declare(t_canvas *x, t_symbol *s, int argc, t_atom *argv) canvas_stdlib(e, atom_getsymbolarg(i+1, argc, argv)->s_name); i++; } - else post("declare: %s: unknown declaration", flag); + // ag: Handle the case of an unrecognized option argument (presumably + // a float). + else if (!*flag) { + post("declare: %g: unknown argument", atom_getfloatarg(i, argc, argv)); + } + else { + post("declare: %s: unknown declaration", flag); + } } } @@ -2236,7 +3086,7 @@ static void canvas_f(t_canvas *x, t_symbol *s, int argc, t_atom *argv) { static int warned_future_version; static int warned_old_syntax; - //fprintf(stderr,"canvas_f %lx %d current=%lx %s\n", + //fprintf(stderr,"canvas_f %zx %d current=%zx %s\n", // (t_int)x, argc, canvas_getcurrent(), // last_typedmess != NULL ? last_typedmess->s_name : "none"); t_canvas *xp = x; //parent window for a special case dealing with subpatches @@ -2271,7 +3121,7 @@ static void canvas_f(t_canvas *x, t_symbol *s, int argc, t_atom *argv) { for (g = x->gl_list; g2 = g->g_next; g = g2) ; - //fprintf(stderr,"same canvas .x%lx .x%lx\n", (t_int)g, (t_int)x); + //fprintf(stderr,"same canvas .x%zx .x%zx\n", (t_uint)g, (t_uint)x); } if ((ob = pd_checkobject(&g->g_pd)) || pd_class(&g->g_pd) == canvas_class) { @@ -2291,7 +3141,7 @@ void canvasgop_draw_move(t_canvas *x, int doit) //delete the earlier GOP window so that when dragging //there is only one GOP window present on parent /* don't think we need this anymore */ - //sys_vgui(".x%lx.c delete GOP\n", x); + //sys_vgui(".x%zx.c delete GOP\n", x); //redraw the GOP canvas_setgraph(x, x->gl_isgraph+2*x->gl_hidetext, 0); @@ -2443,7 +3293,16 @@ void canvasgop__motionhook(t_scalehandle *sh, t_floatarg mouse_x, t_glist *owner = glist_getcanvas(x); /* Just unvis the object, then vis it once we've done our mutation and checks */ - gobj_vis((t_gobj *)x, owner, 0); + /* ico@vt.edu 2020-08-26: this was owner instead of x->gl_owner However, + there is a special case where this causes consistency check error + in canvas_vis because a gop patch size is being manipulated on the + parent window and its window is also visible, glist_getcanvas() will + return its own window even though the user is manipulating the size + on the parent window. So, here we ensure that we are always getting + the parent window, and then we update the red rectangle on its own + window below (see if (x->gl_havewindow)). The same is true for vising + towards the bottom of this function. */ + gobj_vis((t_gobj *)x, x->gl_owner, 0); /* struct _glist has its own member e_xnew for storing our offset. At some point we need to refactor since our t_scalehandle has members for storing offsets already. */ @@ -2479,9 +3338,22 @@ void canvasgop__motionhook(t_scalehandle *sh, t_floatarg mouse_x, owner->gl_editor->e_xnew = mouse_x; owner->gl_editor->e_ynew = mouse_y; canvas_fixlinesfor(owner, (t_text *)x); - gobj_vis((t_gobj *)x, owner, 1); + gobj_vis((t_gobj *)x, x->gl_owner, 1); canvas_dirty(owner, 1); + /* ico@vt.edu 2020-08-26: if we are changing the gop size + on the parent window with our own window open, updated the + red rectangle on our own window */ + if (x->gl_havewindow) + { + gui_vmess("gui_canvas_redrect_coords", "xiiii", + x, + x->gl_xmargin, + x->gl_ymargin, + x->gl_xmargin + x->gl_pixwidth, + x->gl_ymargin + x->gl_pixheight); + } + int properties = gfxstub_haveproperties((void *)x); if (properties) { @@ -2515,6 +3387,14 @@ void canvasgop__motionhook(t_scalehandle *sh, t_floatarg mouse_x, properties_set_field_int(properties, "y_pix",x->gl_pixheight + sh->h_dragy); } + /* ico@vt.edu: resize parent window gop rectangle if visible + as an added bonus, this also works even if it is only + visible inside another gop (gop within a gop within a gop) */ + if (x->gl_owner && glist_isvisible(x->gl_owner)) + { + gobj_vis(&x->gl_gobj, x->gl_owner, 0); + gobj_vis(&x->gl_gobj, x->gl_owner, 1); + } } else /* move_gop hook */ { @@ -2656,6 +3536,8 @@ void g_canvas_setup(void) gensym("vis"), A_FLOAT, A_NULL); class_addmethod(canvas_class, (t_method)glist_menu_open, gensym("menu-open"), A_NULL); + class_addmethod(canvas_class, (t_method)canvas_query_editmode, + gensym("query-editmode"), A_NULL); class_addmethod(canvas_class, (t_method)canvas_map, gensym("map"), A_FLOAT, A_NULL); class_addmethod(canvas_class, (t_method)canvas_dirty, @@ -2693,6 +3575,29 @@ void g_canvas_setup(void) class_addcreator((t_newmethod)table_new, gensym("table"), A_DEFSYM, A_DEFFLOAT, 0); +/* ------------------- */ + + class_addmethod(canvas_class, (t_method)canvas_showdirty, + gensym("showdirty"), 0); + +/*---------------------------- ab ------------------- */ + + class_addcreator((t_newmethod)ab_new, gensym("ab"), A_GIMME, 0); + class_addmethod(canvas_class, (t_method)canvas_abpush, + gensym("abpush"), A_GIMME, 0); + class_addmethod(canvas_class, (t_method)canvas_abframe, + gensym("abframe"), A_FLOAT, 0); + + abdefs_class = class_new(gensym("abdefs"), (t_newmethod)abdefs_new, + 0, sizeof(t_abdefs), CLASS_DEFAULT, A_NULL); + class_addbang(abdefs_class, (t_method)abdefs_bang); + class_addmethod(abdefs_class, (t_method)abdefs_get, gensym("get"), 0); + class_addmethod(abdefs_class, (t_method)abdefs_instances, gensym("instances"), A_SYMBOL, 0); + + class_addmethod(canvas_class, (t_method)canvas_getabstractions, + gensym("getabstractions"), 0); + class_addmethod(canvas_class, (t_method)canvas_delabstractions, + gensym("delabstractions"), A_GIMME, 0); /*---------------------------- declare ------------------- */ declare_class = class_new(gensym("declare"), (t_newmethod)declare_new, (t_method)declare_free, sizeof(t_declare), CLASS_NOINLET, A_GIMME, 0); diff --git a/pd/src/g_canvas.h b/pd/src/g_canvas.h index 964d8fab820992ae09b20e49af661c5d8f472645..cde9837014ad4a16ab8b7ca2eb8275062a2b1f7f 100644 --- a/pd/src/g_canvas.h +++ b/pd/src/g_canvas.h @@ -60,6 +60,8 @@ typedef struct _updateheader /* types to support glists grabbing mouse motion or keys from parent */ typedef void (*t_glistmotionfn)(void *z, t_floatarg dx, t_floatarg dy); typedef void (*t_glistkeyfn)(void *z, t_floatarg key); +typedef void (*t_glistkeynamefn)(void *z, t_symbol *s, int argc, t_atom *argv); +typedef void (*t_glistkeynameafn)(void *z, t_symbol *s, int argc, t_atom *argv); EXTERN_STRUCT _rtext; #define t_rtext struct _rtext @@ -76,6 +78,8 @@ EXTERN_STRUCT _tscalar; EXTERN_STRUCT _canvasenvironment; #define t_canvasenvironment struct _canvasenvironment +extern t_canvasenvironment *dummy_canvas_env(const char *dir); + EXTERN_STRUCT _fielddesc; #define t_fielddesc struct _fielddesc @@ -106,9 +110,10 @@ typedef struct _editor t_rtext *e_rtext; /* text responder linked list */ t_selection *e_selection; /* head of the selection list */ t_rtext *e_textedfor; /* the rtext if any that we are editing */ - t_gobj *e_grab; /* object being "dragged" */ + t_gobj *e_grab; /* object being dragged/focused */ t_glistmotionfn e_motionfn; /* ... motion callback */ t_glistkeyfn e_keyfn; /* ... keypress callback */ + t_glistkeynameafn e_keynameafn; /* ... keyname with autorepeat press callback */ t_binbuf *e_connectbuf; /* connections to deleted objects */ t_binbuf *e_deleted; /* last stuff we deleted */ t_guiconnect *e_guiconnect; /* GUI connection for filtering messages */ @@ -164,6 +169,24 @@ typedef struct _tick /* where to put ticks on x or y axes */ int k_lperb; /* little ticks per big; 0 if no ticks to draw */ } t_tick; +/* the t_ab_definition structure holds an ab definiton and all the attributes we need + to handle it */ +typedef struct _ab_definition +{ + t_symbol *ad_name; /* id for the ab definition */ + t_binbuf *ad_source; /* binbuf where the source is stored */ + int ad_numinstances; /* number of instances */ + struct _ab_definition *ad_next; /* next ab definition */ + t_canvas *ad_owner; /* canvas that stores this definition */ + + /* dependency graph stuff */ + int ad_numdep; /* number of other ab definitions that it depends on */ + struct _ab_definition **ad_dep; /* the actual ab defintitions */ + int *ad_deprefs; /* number of instances that define the dependency */ + int ad_visflag; /* visited flag for topological sort algorithm */ +} t_ab_definition; + + /* the t_glist structure, which describes a list of elements that live on an area of a window. @@ -210,6 +233,7 @@ struct _glist unsigned int gl_loading:1; /* am now loading from file */ unsigned int gl_willvis:1; /* make me visible after loading */ unsigned int gl_edit:1; /* edit mode */ + unsigned int gl_edit_save:1; /* set in temporary run mode */ unsigned int gl_isdeleting:1; /* we're inside glist_delete -- hack! */ unsigned int gl_unloading:1; /* we're inside canvas_free */ unsigned int gl_goprect:1; /* draw rectangle for graph-on-parent */ @@ -232,11 +256,21 @@ struct _glist t_symbol *gl_templatesym; /* for "canvas" data type */ t_word *gl_vec; /* for "canvas" data type */ t_gpointer gl_gp; /* parent for "canvas" data type */ + + int gl_subdirties; /* number of descending dirty abstractions */ + int gl_dirties; /* number of diry instances, for multiple dirty warning */ + + unsigned int gl_isab:1; /* is an ab instance */ + t_ab_definition *gl_absource; /* ab definition pointer, + in the case it is an ab instance */ + t_ab_definition *gl_abdefs; /* stored ab definitions */ }; #define gl_gobj gl_obj.te_g #define gl_pd gl_gobj.g_pd +typedef void (*t_canvas_iterator)(t_canvas *x, void *data); + /*-------------------universal preset stuff---------------------*/ // for the universal preset_node ability (see g_editor.c doconnect/disconnect functions) // this is where all the classes capable of being controlled via preset should be defined @@ -436,6 +470,7 @@ EXTERN void gobj_save(t_gobj *x, t_binbuf *b); EXTERN void gobj_properties(t_gobj *x, struct _glist *glist); EXTERN void gobj_save(t_gobj *x, t_binbuf *b); EXTERN int gobj_shouldvis(t_gobj *x, struct _glist *glist); +EXTERN void gobj_dirty(t_gobj *x, t_glist *g, int state); /* -------------------- functions on glists --------------------- */ EXTERN t_glist *glist_new( void); @@ -451,7 +486,8 @@ EXTERN void glist_selectall(t_glist *x); EXTERN void glist_delete(t_glist *x, t_gobj *y); EXTERN void glist_retext(t_glist *x, t_text *y); EXTERN void glist_grab(t_glist *x, t_gobj *y, t_glistmotionfn motionfn, - t_glistkeyfn keyfn, int xpos, int ypos); + t_glistkeyfn keyfn, t_glistkeynameafn keynameafn, + int xpos, int ypos); EXTERN int glist_isvisible(t_glist *x); EXTERN int glist_istoplevel(t_glist *x); EXTERN t_glist *glist_findgraph(t_glist *x); @@ -547,6 +583,8 @@ EXTERN void canvas_setcurrent(t_canvas *x); EXTERN void canvas_unsetcurrent(t_canvas *x); EXTERN t_symbol *canvas_realizedollar(t_canvas *x, t_symbol *s); EXTERN t_canvas *canvas_getrootfor(t_canvas *x); +EXTERN t_canvas *canvas_getrootfor_ab(t_canvas *x); +EXTERN int abframe; EXTERN void canvas_dirty(t_canvas *x, t_floatarg n); EXTERN int canvas_getfont(t_canvas *x); typedef int (*t_canvasapply)(t_canvas *x, t_int x1, t_int x2, t_int x3); @@ -559,6 +597,7 @@ EXTERN void canvas_resortoutlets(t_canvas *x); EXTERN void canvas_free(t_canvas *x); EXTERN void canvas_updatewindowlist( void); EXTERN void canvas_editmode(t_canvas *x, t_floatarg yesplease); +EXTERN void canvas_query_editmode(t_canvas *x); EXTERN int canvas_isabstraction(t_canvas *x); EXTERN int canvas_istable(t_canvas *x); EXTERN int canvas_showtext(t_canvas *x); @@ -572,6 +611,9 @@ EXTERN t_gobj *canvas_findhitbox(t_canvas *x, int xpos, int ypos, int *x1p, int *y1p, int *x2p, int *y2p); EXTERN int canvas_setdeleting(t_canvas *x, int flag); EXTERN int canvas_hasarray(t_canvas *x); +EXTERN int canvas_has_scalars_only(t_canvas *x); + +EXTERN void canvas_warning(t_canvas *x, int warid); #define LB_LOAD 0 /* "loadbang" actions - 0 for original meaning */ #define LB_INIT 1 /* loaded but not yet connected to parent patch */ diff --git a/pd/src/g_clone.c b/pd/src/g_clone.c index ade8cddd5e9f789e103030608076bee555969e27..d5ba76414de9c785cf1e71efc617c821f3da4c27 100644 --- a/pd/src/g_clone.c +++ b/pd/src/g_clone.c @@ -63,15 +63,41 @@ typedef struct _clone int x_phase; int x_startvoice; /* number of first voice, 0 by default */ int x_suppressvoice; /* suppress voice number as $1 arg */ + t_canvas *x_owner; /* clone owner */ } t_clone; +/* the given 'it' function is executed over each of the underlying canvases + (they are passed as first parameter). 'data' is passed as second argument */ +void clone_iterate(t_pd *z, t_canvas_iterator it, void* data) +{ + t_clone *x = (t_clone *)z; + int i; + for(i = 0; i < x->x_n; i++) + it(x->x_vec[i].c_gl, data); +} + int clone_match(t_pd *z, t_symbol *name, t_symbol *dir) { t_clone *x = (t_clone *)z; if (!x->x_n) return (0); - return (x->x_vec[0].c_gl->gl_name == name && - canvas_getdir(x->x_vec[0].c_gl) == dir); + return (!x->x_vec[0].c_gl->gl_isab + && x->x_vec[0].c_gl->gl_name == name + && canvas_getdir(x->x_vec[0].c_gl) == dir); +} + +int clone_isab(t_pd *z) +{ + t_clone *x = (t_clone *)z; + if (!x->x_n) + return (0); + return (x->x_vec[0].c_gl->gl_isab); +} + +int clone_matchab(t_pd *z, t_ab_definition *source) +{ + t_clone *x = (t_clone *)z; + return (clone_isab(z) && x->x_vec[0].c_gl->gl_absource == source); } void obj_sendinlet(t_object *x, int n, t_symbol *s, int argc, t_atom *argv); @@ -125,12 +151,13 @@ static void clone_in_set(t_in *x, t_floatarg f) static void clone_in_all(t_in *x, t_symbol *s, int argc, t_atom *argv) { - int i; + int phasewas = x->i_owner->x_phase, i; for (i = 0; i < x->i_owner->x_n; i++) { x->i_owner->x_phase = i; clone_in_this(x, s, argc, argv); } + x->i_owner->x_phase = phasewas; } static void clone_in_vis(t_in *x, t_floatarg fn, t_floatarg vis) @@ -143,6 +170,14 @@ static void clone_in_vis(t_in *x, t_floatarg fn, t_floatarg vis) canvas_vis(x->i_owner->x_vec[n].c_gl, (vis != 0)); } +static void clone_in_fwd(t_in *x, t_symbol *s, int argc, t_atom *argv) +{ + if(s != gensym("fwd")) + typedmess(&x->i_pd, s, argc, argv); + else + pd_error(x->i_owner, "clone-inlet: no method for 'fwd'"); +} + static void clone_out_anything(t_out *x, t_symbol *s, int argc, t_atom *argv) { t_atom *outv; @@ -166,15 +201,21 @@ static void clone_free(t_clone *x) for (i = 0; i < x->x_n; i++) { canvas_closebang(x->x_vec[i].c_gl); + if(x->x_vec[i].c_gl->gl_isab) + { + /* crude hack. since clones don't have owner, + we set it manually to allow the clone to + deregister the dependencies */ + x->x_vec[i].c_gl->gl_owner = x->x_owner; + } pd_free(&x->x_vec[i].c_gl->gl_pd); + t_freebytes(x->x_outvec[i], + x->x_nout * sizeof(*x->x_outvec[i])); } t_freebytes(x->x_vec, x->x_n * sizeof(*x->x_vec)); t_freebytes(x->x_argv, x->x_argc * sizeof(*x->x_argv)); t_freebytes(x->x_invec, x->x_nin * sizeof(*x->x_invec)); - for (i = 0; i < x->x_nout; i++) - t_freebytes(x->x_outvec[i], - x->x_nout * sizeof(*x->x_outvec[i])); - t_freebytes(x->x_outvec, x->x_nout * sizeof(*x->x_outvec)); + t_freebytes(x->x_outvec, x->x_n * sizeof(*x->x_outvec)); } } @@ -220,7 +261,8 @@ void clone_setn(t_clone *x, t_floatarg f) { t_canvas *c; t_out *outvec; - SETFLOAT(x->x_argv, x->x_startvoice + i); + /* in the case they are [ab]s, the instance number is one atom beyond */ + SETFLOAT((x->x_vec[0].c_gl->gl_isab ? x->x_argv+1 : x->x_argv), x->x_startvoice + i); if (!(c = clone_makeone(x->x_s, x->x_argc - x->x_suppressvoice, x->x_argv + x->x_suppressvoice))) { @@ -346,6 +388,7 @@ static void clone_dsp(t_clone *x, t_signal **sp) } } +static int clone_newabclone = 0; static void *clone_new(t_symbol *s, int argc, t_atom *argv) { t_clone *x = (t_clone *)pd_new(clone_class); @@ -385,10 +428,27 @@ static void *clone_new(t_symbol *s, int argc, t_atom *argv) else goto usage; /* store a copy of the argmuents with an extra space (argc+1) for supplying an instance number, which we'll bash as we go. */ - x->x_argc = argc - 1; - x->x_argv = getbytes(x->x_argc * sizeof(*x->x_argv)); - memcpy(x->x_argv, argv+1, x->x_argc * sizeof(*x->x_argv)); - SETFLOAT(x->x_argv, x->x_startvoice); + if(clone_newabclone) + /* we are creating a clone from an [ab] definition, we use the same creation + method as for normal clones but the name we pass to objectmaker is + 'ab <name>' instead of just '<name>' */ + { + x->x_argc = argc; + x->x_argv = getbytes(x->x_argc * sizeof(*x->x_argv)); + memcpy(x->x_argv, argv, x->x_argc * sizeof(*x->x_argv)); + SETSYMBOL(x->x_argv, x->x_s); + SETFLOAT(x->x_argv+1, x->x_startvoice); + x->x_s = gensym("ab"); + x->x_owner = canvas_getcurrent(); + clone_newabclone = 0; + } + else + { + x->x_argc = argc - 1; + x->x_argv = getbytes(x->x_argc * sizeof(*x->x_argv)); + memcpy(x->x_argv, argv+1, x->x_argc * sizeof(*x->x_argv)); + SETFLOAT(x->x_argv, x->x_startvoice); + } if (!(c = clone_makeone(x->x_s, x->x_argc - x->x_suppressvoice, x->x_argv + x->x_suppressvoice))) goto fail; @@ -405,7 +465,8 @@ static void *clone_new(t_symbol *s, int argc, t_atom *argv) obj_issignalinlet(&x->x_vec[0].c_gl->gl_obj, i); x->x_invec[i].i_n = i; if (x->x_invec[i].i_signal) - signalinlet_new(&x->x_obj, 0); + inlet_new(&x->x_obj, &x->x_invec[i].i_pd, + &s_signal, &s_signal); else inlet_new(&x->x_obj, &x->x_invec[i].i_pd, 0, 0); } x->x_nout = obj_noutlets(&x->x_vec[0].c_gl->gl_obj); @@ -435,10 +496,20 @@ fail: return (0); } +/* creator for [ab]-based clones */ +static void *abclone_new(t_symbol *s, int argc, t_atom *argv) +{ + clone_newabclone = 1; + return clone_new(s, argc, argv); +} + void clone_setup(void) { clone_class = class_new(gensym("clone"), (t_newmethod)clone_new, (t_method)clone_free, sizeof(t_clone), CLASS_NOINLET, A_GIMME, 0); + + class_addcreator((t_newmethod)abclone_new, gensym("abclone"), A_GIMME, 0); + class_addmethod(clone_class, (t_method)clone_click, gensym("click"), A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0); class_addmethod(clone_class, (t_method)clone_loadbang, gensym("loadbang"), @@ -458,6 +529,8 @@ void clone_setup(void) A_GIMME, 0); class_addmethod(clone_in_class, (t_method)clone_in_vis, gensym("vis"), A_FLOAT, A_FLOAT, 0); + class_addmethod(clone_in_class, (t_method)clone_in_fwd, gensym("fwd"), + A_GIMME, 0); class_addlist(clone_in_class, (t_method)clone_in_list); clone_out_class = class_new(gensym("clone-outlet"), 0, 0, diff --git a/pd/src/g_editor.c b/pd/src/g_editor.c index 320c6126211678e1e41c8aeb15260e94cf66d336..ef71817264cea7a3ee78a7b194252418b37c434b 100644 --- a/pd/src/g_editor.c +++ b/pd/src/g_editor.c @@ -128,7 +128,7 @@ void canvas_raise_all_cords (t_canvas *x) { just insert all gobjs (and scalars) before the first patch cord. This way we don't have to constantly raise all the patch cords above everything else. */ - //sys_vgui(".x%lx.c raise all_cords\n", x); + //sys_vgui(".x%zx.c raise all_cords\n", x); } static void canvas_enteritem (t_canvas *x, int xpos, int ypos, const char *tag) { @@ -172,7 +172,7 @@ static void canvas_nlet_conf (t_canvas *x, int type) { } void canvas_getscroll (t_canvas *x) { - //sys_vgui("pdtk_canvas_getscroll .x%lx.c\n",(long)x); + //sys_vgui("pdtk_canvas_getscroll .x%zx.c\n",(long)x); gui_vmess("gui_canvas_get_overriding_scroll", "x", x); } @@ -258,7 +258,7 @@ int gobj_shouldvis(t_gobj *x, struct _glist *glist) /* return true if the text box should be drawn. We don't show text boxes inside graphs---except comments, if we're doing the new (goprect) style. */ - //fprintf(stderr,"pd_checkobject %lx\n", x); + //fprintf(stderr,"pd_checkobject %zx\n", x); /*fprintf(stderr,"pd_checkobject %d %d %d %d %d %d %d\n", glist->gl_havewindow, (ob->te_pd != canvas_class ? 1:0), @@ -314,7 +314,7 @@ int canvas_restore_original_position(t_glist *x, t_gobj *y, const char* objtag, int dir) { /* we do this instead to save us costly redraw of the canvas */ - //fprintf(stderr,"canvas_restore_original_position %lx %lx %s %d\n", + //fprintf(stderr,"canvas_restore_original_position %zx %zx %s %d\n", // (t_int)x, (t_int)y, objtag, dir); int ret = 0; // we only do this if we are not embedded inside gop, otherwise @@ -433,7 +433,7 @@ void glist_selectline(t_glist *x, t_outconnect *oc, int index1, x->gl_editor->e_selectline_index2 = index2; x->gl_editor->e_selectline_inno = inno; x->gl_editor->e_selectline_tag = oc; - sprintf(tagbuf, "l%lx", (long unsigned int)oc); + sprintf(tagbuf, "l%zx", (t_int)oc); gui_vmess("gui_canvas_select_line", "xs", x, tagbuf); c_selection = x; canvas_draw_gop_resize_hooks(x); @@ -453,8 +453,8 @@ void glist_deselectline(t_glist *x) oc = linetraverser_next(&t); } while (oc && oc != x->gl_editor->e_selectline_tag); canvas_draw_gop_resize_hooks(x); - sprintf(tagbuf, "l%lx", - (long unsigned int)x->gl_editor->e_selectline_tag); + sprintf(tagbuf, "l%zx", + (t_int)x->gl_editor->e_selectline_tag); gui_vmess("gui_canvas_deselect_line", "xs", x, tagbuf); } } @@ -473,7 +473,7 @@ int glist_isselected(t_glist *x, t_gobj *y) /* call this for unselected objects only */ void glist_select(t_glist *x, t_gobj *y) { - //fprintf(stderr,"glist_select c_selection=%lx x=%lx\n", + //fprintf(stderr,"glist_select c_selection=%zx x=%zx\n", // (t_int)c_selection, (t_int)x); if (x->gl_editor) { @@ -509,7 +509,7 @@ void glist_select(t_glist *x, t_gobj *y) c_selection = x; /* Not sure if this is still needed */ - //sys_vgui("pdtk_canvas_update_edit_menu .x%lx 1\n", x); + //sys_vgui("pdtk_canvas_update_edit_menu .x%zx 1\n", x); canvas_draw_gop_resize_hooks(x); } //fprintf(stderr,"select done\n"); @@ -611,7 +611,7 @@ void glist_deselect(t_glist *x, t_gobj *y) canvas_resume_dsp(1); /* Not sure if this is still needed */ //if (!x->gl_editor->e_selection) - // sys_vgui("pdtk_canvas_update_edit_menu .x%lx 0\n", x); + // sys_vgui("pdtk_canvas_update_edit_menu .x%zx 0\n", x); canvas_draw_gop_resize_hooks(x); } //reenter = 0; @@ -821,7 +821,7 @@ void canvas_disconnect(t_canvas *x, if (srcno == index1 && t.tr_outno == outno && sinkno == index2 && t.tr_inno == inno) { - sprintf(tagbuf, "l%lx", (long unsigned int)oc); + sprintf(tagbuf, "l%zx", (t_int)oc); gui_vmess("gui_canvas_delete_line", "xs", x, tagbuf); // jsarlo @@ -1288,7 +1288,21 @@ void canvas_undo_paste(t_canvas *x, void *z, int action) } } +void canvas_dirtyclimb(t_canvas *x, int n); +void clone_iterate(t_pd *z, t_canvas_iterator it, void* data); int clone_match(t_pd *z, t_symbol *name, t_symbol *dir); +int clone_isab(t_pd *z); +int clone_matchab(t_pd *z, t_ab_definition *source); + +/* packed data passing structure for glist_doreload */ +typedef struct _reload_data +{ + t_symbol *n; + t_symbol *d; + t_gobj *e; +} t_reload_data; + +static void glist_doreload_packed(t_canvas *x, t_reload_data *data); /* recursively check for abstractions to reload as result of a save. Don't reload the one we just saved ("except") though. */ @@ -1310,9 +1324,10 @@ static void glist_doreload(t_glist *gl, t_symbol *name, t_symbol *dir, /* remake the object if it's an abstraction that appears to have been loaded from the file we just saved */ remakeit = (g != except && pd_class(&g->g_pd) == canvas_class && - canvas_isabstraction((t_canvas *)g) && + canvas_isabstraction((t_canvas *)g) && !((t_canvas *)g)->gl_isab && ((t_canvas *)g)->gl_name == name && canvas_getdir((t_canvas *)g) == dir); + /* also remake it if it's a "clone" with that name */ if (pd_class(&g->g_pd) == clone_class && clone_match(&g->g_pd, name, dir)) @@ -1374,16 +1389,32 @@ static void glist_doreload(t_glist *gl, t_symbol *name, t_symbol *dir, if (g != except && pd_class(&g->g_pd) == canvas_class && (!canvas_isabstraction((t_canvas *)g) || + ((t_canvas *)g)->gl_isab || ((t_canvas *)g)->gl_name != name || canvas_getdir((t_canvas *)g) != dir) ) glist_doreload((t_canvas *)g, name, dir, except); + + /* also reload the instances within ab-based clone objects + *COMMENT: missing recursive case for abstraction-based clone + objects that don't match with the one we are reloading? */ + if(pd_class(&g->g_pd) == clone_class && clone_isab(&g->g_pd)) + { + t_reload_data d; + d.n = name; d.d = dir; d.e = except; + clone_iterate(&g->g_pd, glist_doreload_packed, &d); + } g = g->g_next; } if (!hadwindow && gl->gl_havewindow) canvas_vis(glist_getcanvas(gl), 0); } +static void glist_doreload_packed(t_canvas *x, t_reload_data *data) +{ + glist_doreload(x, data->n, data->d, data->e); +} + /* this flag stops canvases from being marked "dirty" if we have to touch them to reload an abstraction; also suppress window list update */ int glist_amreloadingabstractions = 0; @@ -1401,6 +1432,89 @@ void canvas_reload(t_symbol *name, t_symbol *dir, t_gobj *except) canvas_resume_dsp(dspwas); } +/* packed data passing structure for glist_doreload_ab */ +typedef struct _reload_ab_data +{ + t_ab_definition *a; + t_gobj *e; +} t_reload_ab_data; + +static void glist_doreload_ab_packed(t_canvas *x, t_reload_ab_data *data); + +/* recursive ab reload method */ +static void glist_doreload_ab(t_canvas *x, t_ab_definition *a, t_gobj *e) +{ + t_gobj *g; + int i, nobj = glist_getindex(x, 0); + int found = 0, remakeit = 0; + + for (g = x->gl_list, i = 0; g && i < nobj; i++) + { + remakeit = (g != e && pd_class(&g->g_pd) == canvas_class && canvas_isabstraction((t_canvas *)g) + && ((t_canvas *)g)->gl_isab && ((t_canvas *)g)->gl_absource == a); + + remakeit = remakeit || (pd_class(&g->g_pd) == clone_class && clone_matchab(&g->g_pd, a)); + + if(remakeit) + { + canvas_create_editor(x); + if (!found) + { + glist_noselect(x); + found = 1; + } + glist_select(x, g); + } + /* since this one won't be reloaded, we need to trigger initbang manually */ + else if(g == e) + canvas_initbang((t_canvas *)g); + g = g->g_next; + } + if (found) + { + canvas_cut(x); + canvas_undo_undo(x); + glist_noselect(x); + } + + for (g = x->gl_list, i = 0; g && i < nobj; i++) + { + if(pd_class(&g->g_pd) == canvas_class && (!canvas_isabstraction((t_canvas *)g) + || (((t_canvas *)g)->gl_isab && (((t_canvas *)g)->gl_absource != a)))) + glist_doreload_ab((t_canvas *)g, a, e); + + /* also reload the instances within ab-based clone objects */ + if(pd_class(&g->g_pd) == clone_class + && clone_isab(&g->g_pd) && !clone_matchab(&g->g_pd, a)) + { + t_reload_ab_data d; + d.a = a; d.e = e; + clone_iterate(&g->g_pd, glist_doreload_ab_packed, &d); + } + g = g->g_next; + } +} + +static void glist_doreload_ab_packed(t_canvas *x, t_reload_ab_data *data) +{ + glist_doreload_ab(x, data->a, data->e); +} + +/* reload ab instances */ +void canvas_reload_ab(t_canvas *x) +{ + t_canvas *c = canvas_getrootfor_ab(x); + int dspwas = canvas_suspend_dsp(); + glist_amreloadingabstractions = 1; + glist_doreload_ab(c, x->gl_absource, &x->gl_gobj); + glist_amreloadingabstractions = 0; + canvas_resume_dsp(dspwas); + /* we set the dirty flag of the root canvas (where the ab definitions + are stored) because its file contents (in this case, the definition + for an specific ab) has been edited */ + canvas_dirty(c, 1); +} + /* --------- 6. apply ----------- */ typedef struct _undo_apply @@ -1769,7 +1883,7 @@ void canvas_undo_canvas_apply(t_canvas *x, void *z, int action) t_int properties = gfxstub_haveproperties((void *)x); if (properties) { - //sys_vgui("destroy .gfxstub%lx\n", properties); + //sys_vgui("destroy .gfxstub%zx\n", properties); gfxstub_deleteforkey(x); } @@ -1852,31 +1966,31 @@ void canvas_undo_canvas_apply(t_canvas *x, void *z, int action) //update the properties with the previous window properties /*t_int properties = gfxstub_haveproperties((void *)x); if (properties) { - sys_vgui("pdtk_canvas_dialog_undo_update .gfxstub%lx %d %d\n", + sys_vgui("pdtk_canvas_dialog_undo_update .gfxstub%zx %d %d\n", properties, x->gl_isgraph, x->gl_hidetext); - sys_vgui(".gfxstub%lx.xscale.entry delete 0 end\n", properties); - sys_vgui(".gfxstub%lx.xrange.entry1 insert 0 %d\n", + sys_vgui(".gfxstub%zx.xscale.entry delete 0 end\n", properties); + sys_vgui(".gfxstub%zx.xrange.entry1 insert 0 %d\n", properties, x->gl_x1); - sys_vgui(".gfxstub%lx.yrange.entry1 delete 0 end\n", properties); - sys_vgui(".gfxstub%lx.yrange.entry1 insert 0 %d\n", + sys_vgui(".gfxstub%zx.yrange.entry1 delete 0 end\n", properties); + sys_vgui(".gfxstub%zx.yrange.entry1 insert 0 %d\n", properties, x->gl_y1); - sys_vgui(".gfxstub%lx.xrange.entry2 delete 0 end\n", properties); - sys_vgui(".gfxstub%lx.xrange.entry2 insert 0 %d\n", + sys_vgui(".gfxstub%zx.xrange.entry2 delete 0 end\n", properties); + sys_vgui(".gfxstub%zx.xrange.entry2 insert 0 %d\n", properties, x->gl_x2); - sys_vgui(".gfxstub%lx.yrange.entry2 delete 0 end\n", properties); - sys_vgui(".gfxstub%lx.yrange.entry2 insert 0 %d\n", + sys_vgui(".gfxstub%zx.yrange.entry2 delete 0 end\n", properties); + sys_vgui(".gfxstub%zx.yrange.entry2 insert 0 %d\n", properties, x->gl_y2); - sys_vgui(".gfxstub%lx.xrange.entry3 delete 0 end\n", properties); - sys_vgui(".gfxstub%lx.xrange.entry3 insert 0 %d\n", + sys_vgui(".gfxstub%zx.xrange.entry3 delete 0 end\n", properties); + sys_vgui(".gfxstub%zx.xrange.entry3 insert 0 %d\n", properties, x->gl_pixwidth); - sys_vgui(".gfxstub%lx.yrange.entry3 delete 0 end\n", properties); - sys_vgui(".gfxstub%lx.yrange.entry3 insert 0 %d\n", + sys_vgui(".gfxstub%zx.yrange.entry3 delete 0 end\n", properties); + sys_vgui(".gfxstub%zx.yrange.entry3 insert 0 %d\n", properties, x->gl_pixheight); - sys_vgui(".gfxstub%lx.xrange.entry4 delete 0 end\n", properties); - sys_vgui(".gfxstub%lx.xrange.entry4 insert 0 %d\n", + sys_vgui(".gfxstub%zx.xrange.entry4 delete 0 end\n", properties); + sys_vgui(".gfxstub%zx.xrange.entry4 insert 0 %d\n", properties, x->gl_xmargin); - sys_vgui(".gfxstub%lx.yrange.entry4 delete 0 end\n", properties); - sys_vgui(".gfxstub%lx.yrange.entry4 insert 0 %d\n", + sys_vgui(".gfxstub%zx.yrange.entry4 delete 0 end\n", properties); + sys_vgui(".gfxstub%zx.yrange.entry4 insert 0 %d\n", properties, x->gl_ymargin); }*/ @@ -1969,7 +2083,7 @@ void canvas_undo_create(t_canvas *x, void *z, int action) t_undo_create *buf = z; t_gobj *y; - //fprintf(stderr,"canvas = %lx buf->u_index = %d\n", + //fprintf(stderr,"canvas = %zx buf->u_index = %d\n", // (t_int)x, buf->u_index); if (action == UNDO_UNDO) @@ -2058,7 +2172,7 @@ void canvas_undo_recreate(t_canvas *x, void *z, int action) else if (action == UNDO_REDO) y = glist_nth(x, buf->u_index); - //fprintf(stderr,"canvas = %lx buf->u_index = %d\n", + //fprintf(stderr,"canvas = %zx buf->u_index = %d\n", // (t_int)x, buf->u_index); if (action == UNDO_UNDO || action == UNDO_REDO) @@ -2150,14 +2264,14 @@ void canvas_undo_font(t_canvas *x, void *z, int action) if (properties) { char tagbuf[MAXPDSTRING]; - sprintf(tagbuf, ".gfxstub%lx", (long unsigned int)properties); + sprintf(tagbuf, ".gfxstub%zx", (t_uint)properties); gui_vmess("gui_font_dialog_change_size", "si", tagbuf, u_f->font); } else { - //sys_vgui("dofont_apply .x%lx %d 1\n", x2, u_f->font); + //sys_vgui("dofont_apply .x%zx %d 1\n", x2, u_f->font); /* In pd.tk there is a global variable holding the last font size. So our dataflow is: 1) Pd -> GUI dofont_apply as above @@ -2179,6 +2293,253 @@ void canvas_undo_font(t_canvas *x, void *z, int action) } } +/* ------------------------------- abstract feature --------------------- */ + +static t_class *abstracthandler_class; + +typedef struct abstracthandler +{ + t_object x_obj; + t_symbol *sym; /* symbol bound to the object */ + t_canvas *dialog; /* canvas where the dialog will be displayed */ + t_canvas *tarjet; /* tarjet subpatch */ + char *path; /* abstraction path */ + t_binbuf *subpatch; /* subpatch contents */ +} t_abstracthandler; + +static void *abstracthandler_new(void) +{ + t_abstracthandler *x = (t_abstracthandler *)pd_new(abstracthandler_class); + char namebuf[80]; + sprintf(namebuf, "ah%lx", (t_int)x); + x->sym = gensym(namebuf); + pd_bind(&x->x_obj.ob_pd, x->sym); + return (x); +} + +static void abstracthandler_free(t_abstracthandler *x) +{ + freebytes(x->path, MAXPDSTRING); + binbuf_free(x->subpatch); + pd_unbind(&x->x_obj.ob_pd, x->sym); +} + +/* gobj_activate, canvas_addtobuf and canvas_buftotex toghether and simplified*/ +static void do_rename_light(t_gobj *z, t_glist *glist, const char *text) +{ + t_rtext *y = glist_findrtext(glist, (t_text *)z); + glist->gl_editor->e_textedfor = y; + char *buf = getbytes(strlen(text)+1); + strcpy(buf, text); + rtext_settext(y, buf, strlen(text)+1); + glist->gl_editor->e_textdirty = 1; + canvas_dirty(glist, 1); + glist->gl_editor->e_onmotion = MA_NONE; //necessary? +} + +int binbuf_match(t_binbuf *inbuf, t_binbuf *searchbuf, int wholeword); + +/* traverses the whole subtree of the given canvas/patch, replacing all subpatches identical to the + given one with an abstraction */ +static int do_replace_subpatches(t_canvas *x, const char* label, t_binbuf *original) +{ + t_selection *list = 0; + int edi = 0, num = 0; + /* editor is needed in order to do the operations below */ + if(label && !x->gl_editor) { canvas_create_editor(x); edi = 1; } + t_gobj *y, *yn; + canvas_undo_add(x, UNDO_SEQUENCE_START, "replace", "subpatch replacements have been redone. " + "All other possible replacements within other (sub)patches have not been affected"); + for(y = x->gl_list; y; y = yn) + { + yn = y->g_next; /* dirty hack, + 'canvas_stowconnections' inside 'glist_deselect' + rearranges the glist */ + if(pd_class(&y->g_pd) == canvas_class && + !canvas_isabstraction((t_canvas *)y)) + { + t_binbuf *tmp = binbuf_new(), *tmps = binbuf_new(); + gobj_save((t_gobj *)y, tmp); + int i = 0, j = binbuf_getnatom(tmp)-2; + t_atom *v = binbuf_getvec(tmp); + while(v[i].a_type != A_SEMI) i++; + i++; + while(v[j].a_type != A_SEMI) j--; + binbuf_restore(tmps, j-i+1, v+i); + binbuf_free(tmp); + if(binbuf_match(original, tmps, 0) && + binbuf_getnatom(original) == binbuf_getnatom(tmps)) + { + if(label) + { + binbuf_free(tmps); + glist_noselect(x); + glist_select(x, y); + do_rename_light(y, x, label); + glist_deselect(x, y); + } + else num++; + } + else + { + binbuf_free(tmps); + /* all the non-matching subpatches are stored in a list, */ + t_selection *new = (t_selection *)getbytes(sizeof(t_selection)); + new->sel_what = y; + new->sel_next = list; + list = new; + } + } + } + canvas_undo_add(x, UNDO_SEQUENCE_END, "replace", "subpatch replacements have been undone. " + "All other possible replacements within other (sub)patches have not been affected"); + if(edi) canvas_destroy_editor(x); + t_selection *z, *zn; + /* the function is called recursively on each non-matching canvas. + this has been left for last due to a visual bug that happens if + they are explored as soon as they are traversed*/ + for(z = list; z; z = zn) + { + zn = z->sel_next; + num += do_replace_subpatches((t_canvas *)z->sel_what, label, original); + freebytes(z, sizeof(t_selection)); + } + return num; +} + +static void abstracthandler_callback(t_abstracthandler *x, t_symbol *s) +{ + char fullpath[MAXPDSTRING], label[MAXPDSTRING], *dir, *filename, *o = s->s_name; + memset(fullpath, '\0', MAXPDSTRING); memset(label, '\0', MAXPDSTRING); + sys_unbashfilename(s->s_name, fullpath); + if(strlen(fullpath) < 3 || strcmp(fullpath+strlen(fullpath)-3, ".pd")) + strcat(fullpath, ".pd"); + filename = strrchr(fullpath, '/')+1; + fullpath[(int)filename-(int)fullpath-1] = '\0'; + dir = fullpath; + + int flag, prefix = 0; + if(flag = sys_relativizepath(canvas_getdir(canvas_getrootfor(x->tarjet))->s_name, dir, label)) + { + int len = strlen(label), creator, fd = -1; + if(len && label[len-1] != '/') label[len] = '/'; + strncat(label, filename, strlen(filename)-3); + /* check if there is a creator with the same name or if it's one of the built-in methods */ + t_symbol *sym = gensym(label); + creator = (sym == &s_bang || sym == &s_float || sym == &s_symbol || sym == &s_blob + || sym == &s_list || sym == &s_anything); + if(!len && creator) + { + prefix = (!len && creator); + creator = 0; + } + creator = (creator || zgetfn(&pd_objectmaker, sym)); + + /* check if there in an abstraction with the same name in the search path */ + if(!creator) + { + char opendir[MAXPDSTRING], *filenameptr; + fd = canvas_open(canvas_getrootfor(x->tarjet), label, ".pd", opendir, + &filenameptr, MAXPDSTRING, 0); //high load + if(fd > 0) + { + sys_close(fd); + /* check if we are overwriting the file */ + if(!strncmp(dir, opendir, (int)filenameptr-(int)opendir-1)) fd = -1; + } + } + flag = !(creator || (fd > 0)); + + if(flag && prefix) + { + strcpy(label, "./"); + strncat(label, filename, strlen(filename)-3); + } + else if(!flag) + error("warning: couldn't use relative path, there is a coincidence in the creator list or the search path"); + } + if(!flag) /* absolute path is required */ + { + memset(label, '\0', MAXPDSTRING); + strcpy(label, dir); + strcat(label, "/"); + strncat(label, filename, strlen(filename)-3); + /* should check if 'filename' is one of the built-in special methods + in order to inform the user about the nameclash problem */ + } + x->path = (char *)getbytes(MAXPDSTRING); + strcpy(x->path, label); + + /* save the subpatch into a separated pd file */ + t_atom at[3]; + SETSYMBOL(at, gensym(filename)); SETSYMBOL(at+1, gensym(dir)); SETFLOAT(at+2, 0.f); + x->tarjet->gl_env = dummy_canvas_env(dir); /* gl_env is set to non-zero in order to save the subcanvas as a root canvas */ + typedmess(&x->tarjet->gl_pd, gensym("savetofile"), 3, at); + x->tarjet->gl_env = 0; + + t_binbuf *tmp = binbuf_new(), *tmps = binbuf_new(); + gobj_save((t_gobj *)x->tarjet, tmp); + /* only the internals are kept, the position on the parent canvas may differ */ + int i = 0, j = binbuf_getnatom(tmp)-2, matches; + t_atom *v = binbuf_getvec(tmp); + while(v[i].a_type != A_SEMI) i++; + i++; + while(v[j].a_type != A_SEMI) j--; + binbuf_restore(tmps, j-i+1, v+i); + binbuf_free(tmp); + matches = do_replace_subpatches(canvas_getrootfor(x->tarjet), 0, tmps); + x->subpatch = tmps; + + /* trigger the frontend dialog for replacing options */ + gui_vmess("gui_canvas_abstract", "xsi", + x->dialog, + x->sym->s_name, + matches); +} + +static void abstracthandler_dialog(t_abstracthandler *x, t_floatarg val) +{ + if(x->tarjet == x->dialog) canvas_vis(x->dialog, 0); + t_canvas *owner = x->tarjet->gl_owner, *root = canvas_getrootfor(x->tarjet); + int all = val; + if(!all) + { + /* change the text of the subpatch object to create the abstraction, + emulating the procedure done by the user. could be simplified */ + int edi = 0; + if(!owner->gl_editor) { canvas_create_editor(owner); edi = 1; } + glist_noselect(owner); + glist_select(owner, &x->tarjet->gl_gobj); + do_rename_light(&x->tarjet->gl_gobj, owner, x->path); + glist_deselect(owner, &x->tarjet->gl_gobj); + if(edi) canvas_destroy_editor(owner); + + /* select '[args]' slice + canvas_editmode(owner, 1); + t_gobj *abst = glist_nth(owner, glist_getindex(owner, 0)-1); + int len = strlen(x->path); + glist_select(owner, abst); + gobj_activate(abst, owner, (0b1 << 31) | (((len+1) & 0x7FFF) << 16) | ((len+7) & 0xFFFF)); */ + } + else + { + do_replace_subpatches(root, x->path, x->subpatch); + } + pd_free(&x->x_obj.ob_pd); +} + +void abstracthandler_setup(void) +{ + abstracthandler_class = class_new(gensym("abstracthandler"), 0, + (t_method)abstracthandler_free, + sizeof(t_abstracthandler), + CLASS_NOINLET, 0); + class_addmethod(abstracthandler_class, (t_method)abstracthandler_callback, + gensym("callback"), A_SYMBOL, 0); + class_addmethod(abstracthandler_class, (t_method)abstracthandler_dialog, + gensym("dialog"), A_FLOAT, 0); +} + /* ------------------------ event handling ------------------------ */ static char *cursorlist[] = { @@ -2271,7 +2632,7 @@ static void canvas_rightclick(t_canvas *x, int xpos, int ypos, t_gobj *y_sel) { //fprintf(stderr,"e_onmotion=%d\n",x->gl_editor->e_onmotion); if (x->gl_editor->e_onmotion != MA_NONE) return; - int canprop, canopen, isobject; + int canprop, canopen, isobject, cansaveas; t_gobj *y = NULL; int x1, y1, x2, y2, scalar_has_canvas = 0; if (x->gl_editor->e_selection) @@ -2328,12 +2689,19 @@ static void canvas_rightclick(t_canvas *x, int xpos, int ypos, t_gobj *y_sel) // LATER: consider enabling help and perhaps even limited properties... return; } - gui_vmess("gui_canvas_popup", "xiiiii", + /* saveas option, only if it's a canvas and it isn't an abstraction */ + cansaveas = (canopen && pd_class(&y->g_pd) == canvas_class && + !canvas_isabstraction((t_canvas *)y)); + /* or if it is the background of a subpatch */ + cansaveas = (cansaveas || (!y && canvas_getrootfor(x) != x && + !canvas_isabstraction((t_canvas *)x))); + gui_vmess("gui_canvas_popup", "xiiiiii", x, xpos, ypos, canprop, canopen, + cansaveas, isobject); } @@ -2346,7 +2714,7 @@ static t_editor *editor_new(t_glist *owner) x->e_connectbuf = binbuf_new(); x->e_deleted = binbuf_new(); x->e_glist = owner; - sprintf(buf, "x%.6lx", (t_int)owner); + sprintf(buf, "x%.6zx", (t_uint)owner); x->e_guiconnect = guiconnect_new(&owner->gl_pd, gensym(buf)); x->gl_magic_glass = magicGlass_new(owner); x->canvas_cnct_inlet_tag[0] = 0; @@ -2375,7 +2743,7 @@ static void editor_free(t_editor *x, t_glist *y) sub-glists, as long as they aren't toplevels. */ void canvas_create_editor(t_glist *x) { - //fprintf(stderr,"create_editor %lx\n", x); + //fprintf(stderr,"create_editor %zx\n", x); t_gobj *y; t_object *ob; if (!x->gl_editor) @@ -2389,7 +2757,7 @@ void canvas_create_editor(t_glist *x) void canvas_destroy_editor(t_glist *x) { - //fprintf(stderr,"destroy_editor %lx\n", x); + //fprintf(stderr,"destroy_editor %zx\n", x); t_gobj *y; t_object *ob; glist_noselect(x); @@ -2423,9 +2791,17 @@ void canvas_map(t_canvas *x, t_floatarg f); //extern t_rtext *glist_findrtext(t_glist *gl, t_text *who); //extern void rtext_gettext(t_rtext *x, char **buf, int *bufsize); +// ico@vt.edu 2020-08-24: update initial menu settings +void canvas_init_menu(t_canvas *x) +{ + //post("g_editor.c canvas_init_menu %d", x->gl_font); + // ico@vt.edu 2020-08-24: we now need this to init the menu font size + gui_vmess("gui_menu_font_set_initial_size", "xi", x, x->gl_font); +} + void canvas_vis(t_canvas *x, t_floatarg f) { - //fprintf(stderr,"canvas_vis .x%lx %f\n", (t_int)x, f); + //fprintf(stderr,"canvas_vis .x%zx %f\n", (t_int)x, f); char geobuf[MAXPDSTRING]; char argsbuf[MAXPDSTRING]; sprintf(geobuf, "+%d+%d", @@ -2433,6 +2809,7 @@ void canvas_vis(t_canvas *x, t_floatarg f) t_gobj *g; t_int properties; + extern int sys_grid; int flag = (f != 0); if (flag) @@ -2444,9 +2821,9 @@ void canvas_vis(t_canvas *x, t_floatarg f) if (x->gl_editor && x->gl_havewindow && glist_isvisible(x)) { /* just put us in front */ //fprintf(stderr,"existing\n"); - //sys_vgui("raise .x%lx\n", x); - //sys_vgui("focus .x%lx.c\n", x); - //sys_vgui("wm deiconify .x%lx\n", x); + //sys_vgui("raise .x%zx\n", x); + //sys_vgui("focus .x%zx.c\n", x); + //sys_vgui("wm deiconify .x%zx\n", x); gui_vmess("gui_raise_window", "x", x); } else @@ -2474,7 +2851,7 @@ void canvas_vis(t_canvas *x, t_floatarg f) } else { - sys_vgui("focus .x%lx\n", (t_int)x); + sys_vgui("focus .x%zx\n", (t_uint)x); } } else @@ -2488,16 +2865,20 @@ void canvas_vis(t_canvas *x, t_floatarg f) We may need to expand this to include scalars, as well. */ canvas_create_editor(x); canvas_args_to_string(argsbuf, x); - gui_vmess("gui_canvas_new", "xiisiissiiiis", + gui_vmess("gui_canvas_new", "xiisiiissiiiiis", x, (int)(x->gl_screenx2 - x->gl_screenx1), (int)(x->gl_screeny2 - x->gl_screeny1), geobuf, + sys_grid, x->gl_zoom, x->gl_edit, x->gl_name->s_name, canvas_getdir(x)->s_name, x->gl_dirty, + (x->gl_dirties > 1 ? + (x->gl_dirty ? 2 : 1) + : (x->gl_dirties ? !x->gl_dirty : 0)), x->gl_noscroll, x->gl_nomenu, canvas_hasarray(x), @@ -2505,7 +2886,7 @@ void canvas_vis(t_canvas *x, t_floatarg f) /* It looks like this font size call is no longer needed, but I'm not sure why it was needed in the first place... */ - //sys_vgui("pdtk_canvas_set_font .x%lx %d\n", x, x->gl_font); + //sys_vgui("pdtk_canvas_set_font .x%zx %d\n", x, x->gl_font); //canvas_reflecttitle(x); x->gl_havewindow = 1; @@ -2552,7 +2933,7 @@ void canvas_vis(t_canvas *x, t_floatarg f) properties = gfxstub_haveproperties((void *)g); if (properties) { - //sys_vgui("destroy .gfxstub%lx\n", properties); + //sys_vgui("destroy .gfxstub%zx\n", properties); gfxstub_deleteforkey((void *)g); } g = g->g_next; @@ -2565,7 +2946,7 @@ void canvas_vis(t_canvas *x, t_floatarg f) properties = gfxstub_haveproperties((void *)x); if (properties) { - //sys_vgui("destroy .gfxstub%lx\n", properties); + //sys_vgui("destroy .gfxstub%zx\n", properties); gfxstub_deleteforkey((void *)x); } } @@ -2974,7 +3355,7 @@ void canvas_done_popup(t_canvas *x, t_float which, t_float xpos, t_float ypos) { //fprintf(stderr,"x->gl_edit=%d\n", x->gl_edit); - //fprintf(stderr,"canvas_done_pupup %lx\n", (t_int)x); + //fprintf(stderr,"canvas_done_pupup %zx\n", (t_int)x); char namebuf[FILENAME_MAX]; t_gobj *y=NULL, *oldy=NULL, *oldy_prev=NULL, *oldy_next=NULL, *y_begin, *y_end=NULL; @@ -3078,6 +3459,24 @@ void canvas_done_popup(t_canvas *x, t_float which, t_float xpos, vmess(&y->g_pd, gensym("menu-open"), ""); return; } + else if(which == 5) /* saveas */ + { + t_abstracthandler *ah = abstracthandler_new(); + ah->tarjet = (t_canvas *)y; + ah->dialog = x; + + char buf[MAXPDSTRING]; + sprintf(buf, "%s/%s.pd", + canvas_getdir(canvas_getrootfor((t_canvas *)y))->s_name, + ((t_canvas *)y)->gl_name->s_name); + + gui_vmess("gui_savepanel", "xss", + x, + ah->sym->s_name, + buf); + + return; + } else if (which == 2) /* help */ { char *dir; @@ -3146,6 +3545,21 @@ void canvas_done_popup(t_canvas *x, t_float which, t_float xpos, } else if (which == 2) open_via_helppath("intro.pd", canvas_getdir((t_canvas *)x)->s_name); + + if (which == 5) + { + t_abstracthandler *ah = abstracthandler_new(); + ah->tarjet = x; + ah->dialog = x; + + char buf[MAXPDSTRING]; + sprintf(buf, "%s/%s.pd", canvas_getdir(canvas_getrootfor(x))->s_name, ((t_canvas *)x)->gl_name->s_name); + + gui_vmess("gui_savepanel", "xss", + x, + ah->sym->s_name, + buf); + } } extern t_class *my_canvas_class; // for ignoring runtime clicks and resizing @@ -3175,7 +3589,7 @@ static int text_resizing_hotspot(t_canvas *x, t_object *ob, int xpos, int ypos, /* gop canvases, gop red rectangle, scope, grid, iemguis except [cnv] */ if ((ob->te_iemgui && ob->ob_pd != my_canvas_class) || - ob->ob_pd == canvas_class || + (ob->ob_pd == canvas_class && ((t_canvas *)ob)->gl_isgraph) || ob->ob_pd->c_name == gensym("Scope~") || ob->ob_pd->c_name == gensym("grid")) { @@ -3221,6 +3635,8 @@ static double canvas_upclicktime; static int canvas_upx, canvas_upy; #define DCLICKINTERVAL 0.25 +static int ctrl_runmode_warned; + /* mouse click */ void canvas_doclick(t_canvas *x, int xpos, int ypos, int which, int mod, int doit) @@ -3233,7 +3649,7 @@ void canvas_doclick(t_canvas *x, int xpos, int ypos, int which, //post("canvas_doclick %d", doit); t_gobj *y; - int shiftmod, runmode, altmod, doublemod = 0, rightclick, + int shiftmod, runmode, ctrlmod, altmod, doublemod = 0, rightclick, in_text_resizing_hotspot, default_type; int x1=0, y1=0, x2=0, y2=0, clickreturned = 0; t_gobj *yclick = NULL; @@ -3252,8 +3668,9 @@ void canvas_doclick(t_canvas *x, int xpos, int ypos, int which, // read key and mouse button states shiftmod = (mod & SHIFTMOD); - runmode = ((mod & CTRLMOD) || (!x->gl_edit)); + ctrlmod = (mod & CTRLMOD); altmod = (mod & ALTMOD); + runmode = (altmod || (!x->gl_edit)); rightclick = (mod & RIGHTCLICK); // set global left mouse click variable @@ -3273,7 +3690,7 @@ void canvas_doclick(t_canvas *x, int xpos, int ypos, int which, if (doit && x->gl_editor->e_grab && x->gl_editor->e_keyfn) { (* x->gl_editor->e_keyfn) (x->gl_editor->e_grab, 0); - glist_grab(x, 0, 0, 0, 0, 0); + glist_grab(x, 0, 0, 0, 0, 0, 0); } if (doit && !runmode && xpos == canvas_upx && ypos == canvas_upy && @@ -3345,7 +3762,7 @@ void canvas_doclick(t_canvas *x, int xpos, int ypos, int which, if (yclick) { clickreturned = gobj_click(yclick, x, xpos, ypos, - shiftmod, ((mod & CTRLMOD) && (!x->gl_edit)) || altmod, + shiftmod, (altmod && (!x->gl_edit)) || ctrlmod, 0, doit); //fprintf(stderr, " MAIN clicking\n"); } @@ -3391,6 +3808,14 @@ void canvas_doclick(t_canvas *x, int xpos, int ypos, int which, if (y) { + /* check for ctrlmod click and give a warning once in the console that + the hotkey for temporary runmode has changed */ + if (!ctrl_runmode_warned && ctrlmod && !rightclick && doit) { + post("\nwarning: The hotkey for temporary run mode has changed. " + "Please press Alt instead of Ctrl to enable it.\n"); + ctrl_runmode_warned = 1; + } + // if we are right-clicking if (rightclick) canvas_rightclick(x, xpos, ypos, y); @@ -3523,7 +3948,7 @@ void canvas_doclick(t_canvas *x, int xpos, int ypos, int which, x->gl_editor->e_xwas = hotspot + IOWIDTH / 2; x->gl_editor->e_ywas = y2 - 2; /* This repetition of args needs to be pruned below */ - gui_vmess("gui_canvas_line", "xssiiiiiiiiii", + gui_vmess("gui_canvas_line", "xssiiiiiiiiiii", x, "newcord", (issignal ? "signal" : "control"), @@ -3679,9 +4104,9 @@ void canvas_doclick(t_canvas *x, int xpos, int ypos, int which, canvas_check_nlet_highlights(x); } //toggle_moving = 1; - //sys_vgui("pdtk_update_xy_tooltip .x%lx %d %d\n", + //sys_vgui("pdtk_update_xy_tooltip .x%zx %d %d\n", // x, (int)xpos, (int)ypos); - //sys_vgui("pdtk_toggle_xy_tooltip .x%lx %d\n", x, 1); + //sys_vgui("pdtk_toggle_xy_tooltip .x%zx %d\n", x, 1); x->gl_editor->e_onmotion = MA_MOVE; /* once the code for creating a new object looks sane we'll leave rendering the tooltips to the GUI. */ @@ -3764,7 +4189,7 @@ void canvas_doclick(t_canvas *x, int xpos, int ypos, int which, return; } /* having failed to find a box, we try lines now. */ - if (!runmode && !altmod && !shiftmod) + if (!runmode && !ctrlmod && !shiftmod) { t_linetraverser t; t_outconnect *oc; @@ -4026,8 +4451,8 @@ void canvas_drawconnection(t_canvas *x, int lx1, int ly1, int lx2, int ly2, ymax = 20; } if (yoff > ymax) yoff = ymax; - sprintf(tagbuf, "l%lx", (long unsigned int)tag); - gui_vmess("gui_canvas_line", "xssiiiiiiiiii", + sprintf(tagbuf, "l%zx", (t_int)tag); + gui_vmess("gui_canvas_line", "xssiiiiiiiiiii", x, tagbuf, (issignal ? "signal" : "control"), @@ -4040,7 +4465,8 @@ void canvas_drawconnection(t_canvas *x, int lx1, int ly1, int lx2, int ly2, lx2, ly2 - yoff, lx2, - ly2); + ly2, + 0); } void canvas_updateconnection(t_canvas *x, int lx1, int ly1, int lx2, int ly2, @@ -4075,7 +4501,7 @@ void canvas_updateconnection(t_canvas *x, int lx1, int ly1, int lx2, int ly2, if (yoff > ymax) yoff = ymax; if (tag) { - sprintf(cord_tag, "l%lx", (long unsigned int)tag); + sprintf(cord_tag, "l%zx", (t_int)tag); gui_vmess("gui_canvas_update_line", "xsiiiii", x, cord_tag, @@ -4715,7 +5141,7 @@ void canvas_doconnect(t_canvas *x, int xpos, int ypos, int which, int doit) { canvas_updateconnection(x, x->gl_editor->e_xwas, x->gl_editor->e_ywas, xpos, ypos, 0); - //sys_vgui("pdtk_check_scroll_on_motion .x%lx.c 0\n", x); + //sys_vgui("pdtk_check_scroll_on_motion .x%zx.c 0\n", x); /* tried canvas_getscroll here instead, but it doesn't seem to add much value. Can revisit later if need be... */ //canvas_getscroll(x); @@ -4880,7 +5306,7 @@ void canvas_mouseup(t_canvas *x, { //if (toggle_moving == 1) { // toggle_moving = 0; - // sys_vgui("pdtk_toggle_xy_tooltip .x%lx %d\n", x, 0); + // sys_vgui("pdtk_toggle_xy_tooltip .x%zx %d\n", x, 0); //} int xpos = fxpos, ypos = fypos, which = fwhich; /* post("mouseup %d %d %d", xpos, ypos, which); */ @@ -4903,17 +5329,17 @@ void canvas_mouseup(t_canvas *x, { /* after motion or resizing, if there's only one text item selected, activate the text */ + scrollbar_synchronous_update(x); if (x->gl_editor->e_selection && !(x->gl_editor->e_selection->sel_next)) { gobj_activate(x->gl_editor->e_selection->sel_what, x, 1); } - scrollbar_update(x); } else if (x->gl_editor->e_onmotion == MA_SCROLL) { /* Let's try to do this exclusively in the GUI... */ - //sys_vgui("pdtk_canvas_scroll_xy_click .x%lx %d %d 0\n", + //sys_vgui("pdtk_canvas_scroll_xy_click .x%zx %d %d 0\n", // (t_int)x, (int)fxpos, (int)fypos); x->gl_editor->e_onmotion = MA_NONE; canvas_setcursor(x, CURSOR_EDITMODE_NOTHING); @@ -4977,7 +5403,7 @@ void canvas_mousedown_middle(t_canvas *x, t_floatarg xpos, t_floatarg ypos, } else { - //sys_vgui("pdtk_canvas_scroll_xy_click .x%lx %d %d 3\n", + //sys_vgui("pdtk_canvas_scroll_xy_click .x%zx %d %d 3\n", // (t_int)x, (int)xpos, (int)ypos); x->gl_editor->e_onmotion = MA_SCROLL; canvas_setcursor(x, CURSOR_SCROLL); @@ -5159,38 +5585,43 @@ void canvas_key(t_canvas *x, t_symbol *s, int ac, t_atom *av) else if (keynum == 29) keynum = 0, gotkeysym = gensym("Right"); #endif - // set the shared variable for broadcasting of keypresses to key et al. objectss + // set the shared variable for broadcasting of keypresses to key et al. objects t_atom at[2]; // now broadcast key press to key et al. objects - if (!autorepeat) + // ico@vt.edu 20200918: only do so if we do not have an object + // that has grabbed the keyboard, such as gatom or iemgui numbox + if (!x || !x->gl_editor || !x->gl_editor->e_grab) { - if (keynumsym->s_thing && down) - pd_float(keynumsym->s_thing, (t_float)keynum); - if (keyupsym->s_thing && !down) - pd_float(keyupsym->s_thing, (t_float)keynum); - if (keynamesym->s_thing) + if (!autorepeat) + { + if (keynumsym->s_thing && down) + pd_float(keynumsym->s_thing, (t_float)keynum); + if (keyupsym->s_thing && !down) + pd_float(keyupsym->s_thing, (t_float)keynum); + if (keynamesym->s_thing) + { + at[0] = av[0]; + SETFLOAT(at, down); + SETSYMBOL(at+1, gotkeysym); + pd_list(keynamesym->s_thing, 0, 2, at); + } + } + + // now do the same for autorepeat-enabled objects (key et al. alternative behavior) + if (keynumsym_a->s_thing && down) + pd_float(keynumsym_a->s_thing, (t_float)keynum); + if (keyupsym_a->s_thing && !down) + pd_float(keyupsym_a->s_thing, (t_float)keynum); + if (keynamesym_a->s_thing) { at[0] = av[0]; SETFLOAT(at, down); SETSYMBOL(at+1, gotkeysym); - pd_list(keynamesym->s_thing, 0, 2, at); + pd_list(keynamesym_a->s_thing, 0, 2, at); } } - // now do the same for autorepeat-enabled objects (key et al. alternative behavior) - if (keynumsym_a->s_thing && down) - pd_float(keynumsym_a->s_thing, (t_float)keynum); - if (keyupsym_a->s_thing && !down) - pd_float(keyupsym_a->s_thing, (t_float)keynum); - if (keynamesym_a->s_thing) - { - at[0] = av[0]; - SETFLOAT(at, down); - SETSYMBOL(at+1, gotkeysym); - pd_list(keynamesym_a->s_thing, 0, 2, at); - } - if (!x || !x->gl_editor) return; if (x && down) @@ -5199,10 +5630,19 @@ void canvas_key(t_canvas *x, t_symbol *s, int ac, t_atom *av) if (x->gl_editor->e_onmotion == MA_MOVE) x->gl_editor->e_onmotion = MA_NONE; /* if an object has "grabbed" keys just send them on */ - if (x->gl_editor->e_grab - && x->gl_editor->e_keyfn && keynum && focus) + if (x->gl_editor->e_grab) + { + if (x->gl_editor->e_keyfn && keynum && focus) (* x->gl_editor->e_keyfn) (x->gl_editor->e_grab, (t_float)keynum); + if (x->gl_editor->e_keynameafn && gotkeysym && focus) + { + at[0] = av[0]; + SETFLOAT(at, down); + SETSYMBOL(at+1, gotkeysym); + (* x->gl_editor->e_keynameafn) (x->gl_editor->e_grab, 0, 2, at); + } + } /* if a text editor is open send the key on, as long as it is either "real" (has a key number) or else is an arrow key. */ else if (x->gl_editor->e_textedfor && focus && (keynum @@ -5278,31 +5718,34 @@ void canvas_key(t_canvas *x, t_symbol *s, int ac, t_atom *av) } if (x && keynum == 0 && x->gl_edit && - !strncmp(gotkeysym->s_name, "Alt", 3)) + !strncmp(gotkeysym->s_name, "Control", 7)) { - glob_alt = down; + glob_ctrl = down; } - /* if control key goes up or down, and if we're in edit mode, change + /* if alt key goes up or down, and if we're in edit mode, change cursor to indicate how the click action changes NEW: do so only if not doing anything else in edit mode */ if (x && keynum == 0 && - !strncmp(gotkeysym->s_name, "Control", 7)) + !strncmp(gotkeysym->s_name, "Alt", 3)) { //fprintf(stderr,"ctrl\n"); - glob_ctrl = down; - //post("glob_ctrl=%d", down); + glob_alt = down; + //post("glob_alt=%d", down); /* ico@vt.edu: commenting MA_NONE part as that prevents the patch from assuming editmode after it has had an object added via a ctrl+(1-5) shortcut while not in edit mode */ - if (x->gl_edit /*&& x->gl_editor->e_onmotion == MA_NONE*/) + if (x->gl_edit /*&& x->gl_editor->e_onmotion == MA_NONE*/ || + x->gl_edit_save) { canvas_setcursor(x, down ? CURSOR_RUNMODE_NOTHING : CURSOR_EDITMODE_NOTHING); + x->gl_edit = down ? 0 : 1; + x->gl_edit_save = !x->gl_edit; gui_vmess("gui_canvas_set_editmode", "xi", x, - down ? 0 : 1); + x->gl_edit); if(x->gl_editor && x->gl_editor->gl_magic_glass) { if (down) @@ -5324,6 +5767,17 @@ void canvas_key(t_canvas *x, t_symbol *s, int ac, t_atom *av) extern void graph_checkgop_rect(t_gobj *z, t_glist *glist, int *xp1, int *yp1, int *xp2, int *yp2); + + +static void delay_move(t_canvas *x) +{ + canvas_displaceselection(x, + x->gl_editor->e_xnew - x->gl_editor->e_xwas, + x->gl_editor->e_ynew - x->gl_editor->e_ywas); + x->gl_editor->e_xwas = x->gl_editor->e_xnew; + x->gl_editor->e_ywas = x->gl_editor->e_ynew; +} + void canvas_motion(t_canvas *x, t_floatarg xpos, t_floatarg ypos, t_floatarg fmod) { @@ -5350,19 +5804,19 @@ void canvas_motion(t_canvas *x, t_floatarg xpos, t_floatarg ypos, { //fprintf(stderr,"x-was=%g y-was=%g xwas=%d ywas=%d x=%g y=%g\n", xpos - x->gl_editor->e_xwas, // ypos - x->gl_editor->e_ywas, x->gl_editor->e_xwas, x->gl_editor->e_ywas, xpos, ypos); - canvas_displaceselection(x, - xpos - x->gl_editor->e_xwas, ypos - x->gl_editor->e_ywas); - x->gl_editor->e_xwas = xpos; - x->gl_editor->e_ywas = ypos; + if (!x->gl_editor->e_clock) + x->gl_editor->e_clock = clock_new(x, (t_method)delay_move); + clock_unset(x->gl_editor->e_clock); + clock_delay(x->gl_editor->e_clock, 5); x->gl_editor->e_xnew = xpos; x->gl_editor->e_ynew = ypos; // scrollbar_update(x); - //sys_vgui("pdtk_check_scroll_on_motion .x%lx.c 20\n", x); + //sys_vgui("pdtk_check_scroll_on_motion .x%zx.c 20\n", x); } else if (x->gl_editor->e_onmotion == MA_REGION) { canvas_doregion(x, xpos, ypos, 0); - //sys_vgui("pdtk_check_scroll_on_motion .x%lx.c 0\n", x); + //sys_vgui("pdtk_check_scroll_on_motion .x%zx.c 0\n", x); /* This turns out not to be very useful so it's commented. Can revisit later... */ //canvas_getscroll(x); @@ -5407,7 +5861,7 @@ void canvas_motion(t_canvas *x, t_floatarg xpos, t_floatarg ypos, // object vis function should check if the object is still // selected, so as to draw the outline in the right color // it should also tag all aspects with selected tag - // fprintf(stderr,"MA_RESIZE gobj=%lx\n", y1); + // fprintf(stderr,"MA_RESIZE gobj=%zx\n", y1); canvas_dirty(x, 1); } else if (ob && ob->ob_pd == canvas_class) @@ -5453,7 +5907,7 @@ void canvas_motion(t_canvas *x, t_floatarg xpos, t_floatarg ypos, // (double)xpos, (double)ypos, 0, (double)mod); } //if (toggle_moving == 1) { - // sys_vgui("pdtk_update_xy_tooltip .x%lx %d %d\n", + // sys_vgui("pdtk_update_xy_tooltip .x%zx %d %d\n", // x, (int)xpos, (int)ypos); //} x->gl_editor->e_lastmoved = 1; @@ -5505,7 +5959,7 @@ void canvas_print(t_canvas *x, t_symbol *s) 3) Replace with an svg export menu item 4) Nothing */ - //sys_vgui(".x%lx.c postscript -file %s\n", x, + //sys_vgui(".x%zx.c postscript -file %s\n", x, // *s->s_name ? s->s_name : "x.ps"); } @@ -5573,7 +6027,7 @@ void glob_verifyquit(void *dummy, t_floatarg f) 3); } //canvas_vis(g2, 1); - //sys_vgui("pdtk_canvas_menuclose .x%lx {.x%lx menuclose 3;\n}\n", + //sys_vgui("pdtk_canvas_menuclose .x%zx {.x%zx menuclose 3;\n}\n", // canvas_getrootfor(g2), g2); return; } @@ -5605,7 +6059,7 @@ void glob_verifyquit(void *dummy, t_floatarg f) */ void canvas_menuclose(t_canvas *x, t_floatarg fforce) { - //fprintf(stderr,"canvas_menuclose %lx %f\n", (t_int)x, fforce); + //fprintf(stderr,"canvas_menuclose %zx %f\n", (t_int)x, fforce); int force = fforce; t_glist *g; if ((x->gl_owner || x->gl_isclone) && (force == 0 || force == 1)) @@ -5652,8 +6106,8 @@ void canvas_menuclose(t_canvas *x, t_floatarg fforce) } else if (force == 1) { - //sys_vgui("pd {.x%lx menuclose -1;}\n", x); - //sys_vgui("menu_close .x%lx\n", x); + //sys_vgui("pd {.x%zx menuclose -1;}\n", x); + //sys_vgui("menu_close .x%zx\n", x); //sys_queuegui(x, x, canvas_dofree); //canvas_vis(x, 0); //canvas_free(x); @@ -5695,12 +6149,12 @@ void canvas_menuclose(t_canvas *x, t_floatarg fforce) g, 2); } - //sys_vgui("pdtk_canvas_menuclose .x%lx {.x%lx menuclose 2;\n}\n", + //sys_vgui("pdtk_canvas_menuclose .x%zx {.x%zx menuclose 2;\n}\n", // canvas_getrootfor(x), g); return; } else pd_free(&x->gl_pd); - //sys_vgui("pd {.x%lx menuclose -1;}\n", x); + //sys_vgui("pd {.x%zx menuclose -1;}\n", x); //sys_queuegui(x, x, canvas_dofree); //clock_delay(x->gl_destroy, 0); } @@ -5712,20 +6166,26 @@ void canvas_menuclose(t_canvas *x, t_floatarg fforce) } /* put up a dialog which may call canvas_font back to do the work */ -static void canvas_menufont(t_canvas *x) +static void canvas_menufont(t_canvas *x, t_floatarg newsize) { t_canvas *x2 = canvas_getrootfor(x); - gfxstub_deleteforkey(x2); - char *gfxstub = gfxstub_new2(&x2->gl_pd, &x2->gl_pd); - gui_vmess("gui_font_dialog", "xsi", - x2, - gfxstub, - x2->gl_font); + //gfxstub_deleteforkey(x2); + //char *gfxstub = gfxstub_new2(&x2->gl_pd, &x2->gl_pd); + if (newsize != x2->gl_font) + { + // additional args copied from dialog_font.html + canvas_font(x2, newsize, x2->gl_font, 100.0, 0.0); + } + /*{ + gui_vmess("gui_font_dialog", "xi", + x2, + //gfxstub, + x2->gl_font); + }*/ } static int canvas_find_index1, canvas_find_index2, canvas_find_wholeword; static t_binbuf *canvas_findbuf; -int binbuf_match(t_binbuf *inbuf, t_binbuf *searchbuf, int wholeword); /* find an atom or string of atoms */ static int canvas_dofind(t_canvas *x, int *myindex1p) @@ -5828,6 +6288,27 @@ static void canvas_find_parent(t_canvas *x, t_floatarg f) } } + /* tell the gui to bring a gobj into view, possibly with an animation */ +static void gobj_emphasize(t_glist *g, t_gobj *x) +{ + t_rtext *y = glist_findrtext(g, (t_text *)x); + gui_vmess("gui_gobj_emphasize", "xs", g, rtext_gettag(y)); +} + + /* tell the gui to mark a gobj as dirty (change border color) */ +void gobj_dirty(t_gobj *x, t_glist *g, int state) +{ + t_rtext *y = glist_findrtext(g, (t_text *)x); + gui_vmess("gui_gobj_dirty", "xsi", g, rtext_gettag(y), state); +} + + /* tell the gui to display a specific message in the + top right corner */ +void canvas_warning(t_canvas *x, int warid) +{ + gui_vmess("gui_canvas_warning", "xi", x, warid); +} + static int glist_dofinderror(t_glist *gl, void *error_object) { t_gobj *g; @@ -5840,6 +6321,7 @@ static int glist_dofinderror(t_glist *gl, void *error_object) canvas_vis(glist_getcanvas(gl), 1); canvas_editmode(glist_getcanvas(gl), 1.); glist_select(gl, g); + gobj_emphasize(gl, g); return (1); } else if (g->g_pd == canvas_class) @@ -5860,11 +6342,10 @@ void canvas_finderror(void *error_object) if ((void *)x == error_object) { /* If the error is associated with a toplevel canvas, we - do a quick-and-dirty unvis and vis to give some basic - visual feedback to the user */ + we raise it to the top and do a quick-and-dirty background + animation for visual feedback to the user */ glist_noselect(x); - canvas_vis(glist_getcanvas(x), 0); - canvas_vis(glist_getcanvas(x), 1); + gui_vmess("gui_canvas_emphasize", "x", glist_getcanvas(x)); return; } if (glist_dofinderror(x, error_object)) @@ -6118,14 +6599,14 @@ static void canvas_copy(t_canvas *x) /* Ok, this makes no sense-- if we return above when there's no e_selection, then how could the following possibly be true? */ - //sys_vgui("pdtk_canvas_update_edit_menu .x%lx 0\n", x); + //sys_vgui("pdtk_canvas_update_edit_menu .x%zx 0\n", x); } else { /* Still not exactly sure what this is doing. If it's just disabling menu items related to the clipboard I think we can do without it. */ - //sys_vgui("pdtk_canvas_update_edit_menu .x%lx 1\n", x); + //sys_vgui("pdtk_canvas_update_edit_menu .x%zx 1\n", x); } paste_xyoffset = 1; if (x->gl_editor->e_textedfor) @@ -6214,7 +6695,7 @@ static void canvas_doclear(t_canvas *x) /* now destroy the object */ glist_delete(x, y); #if 0 - if (y2) post("cut 5 %lx %lx", y2, y2->g_next); + if (y2) post("cut 5 %zx %zx", y2, y2->g_next); else post("cut 6"); #endif goto next; @@ -6244,7 +6725,7 @@ static void canvas_cut(t_canvas *x) if (!bufsize) return; canvas_copy(x); - rtext_key(x->gl_editor->e_textedfor, 127, &s_); + //rtext_key(x->gl_editor->e_textedfor, 127, &s_); canvas_fixlinesfor(x,(t_text*) x->gl_editor->e_selection->sel_what); canvas_dirty(x, 1); } @@ -6262,6 +6743,271 @@ static void canvas_cut(t_canvas *x) } } +/* ------------------------- encapsulate ------------------------ */ + +typedef struct _xletholder +{ + void *xlh_addr; + int xlh_seln; + int xlh_xletn; + int xlh_type; + int xlh_x; + int xlh_y; + t_binbuf *xlh_conn; + struct _xletholder *xlh_next; +} t_xletholder; + +#define X_PLAOFF 40 +#define Y_PLAOFF 80 +#define XLETSGAP 10 + +static void canvas_dofancycopy(t_canvas *x, t_binbuf **object, t_binbuf **connections) +{ + t_gobj *y; + t_linetraverser t; + t_outconnect *oc; + t_binbuf *b = binbuf_new(); + int maxx, maxy, minx, miny, numobj = 0; + + binbuf_addv(b, "ssiiiisi;", gensym("#N"), gensym("canvas"), + 0, 0, 450, 300, gensym("subpatch"), 0); + + gobj_getrect(x->gl_editor->e_selection->sel_what, x, + &minx, &miny, &maxx, &maxy); + + /* compute global rect */ + for (y = x->gl_list; y; y = y->g_next) + { + if (glist_isselected(x, y)) + { + int tminx, tmaxx, tminy, tmaxy; + gobj_getrect(y, x, &tminx, &tminy, &tmaxx, &tmaxy); + if(tminx < minx) minx = tminx; + if(tmaxx > maxx) maxx = tmaxx; + if(tminy < miny) miny = tminy; + if(tmaxy > maxy) maxy = tmaxy; + } + } + + /* save selected objects into binbbuf */ + for (y = x->gl_list; y; y = y->g_next) + { + if (glist_isselected(x, y)) + { + gobj_displace(y, x, X_PLAOFF-minx, Y_PLAOFF-miny); + gobj_save(y, b); + gobj_displace(y, x, minx-X_PLAOFF, miny-Y_PLAOFF); + numobj++; + } + } + + /* traverse all the lines */ + t_xletholder *inlets = 0, *outlets = 0, *lastoutlet = 0; + linetraverser_start(&t, x); + while (oc = linetraverser_next(&t)) + { + int s1 = glist_isselected(x, &t.tr_ob->ob_g); + int s2 = glist_isselected(x, &t.tr_ob2->ob_g); + /* if inner connection */ + if (s1 && s2) + { + binbuf_addv(b, "ssiiii;", gensym("#X"), gensym("connect"), + glist_selectionindex(x, &t.tr_ob->ob_g, 1), t.tr_outno, + glist_selectionindex(x, &t.tr_ob2->ob_g, 1), t.tr_inno); + } + /* if outer outlet connection */ + else if(s1 && !s2) + { + /* if we continue in the same outlet, we add the object and inlet number to the list and skip */ + if (lastoutlet && lastoutlet->xlh_addr == (void *)t.tr_outlet) + { + binbuf_addv(lastoutlet->xlh_conn, "ii", glist_selectionindex(x, &t.tr_ob2->ob_g, 0), t.tr_inno); + continue; + } + + /* create and fill outlet handling structure */ + t_xletholder *newoutlet = (t_xletholder *)getbytes(sizeof(t_xletholder)); + newoutlet->xlh_addr = (void *)t.tr_outlet; + newoutlet->xlh_seln = glist_selectionindex(x, &t.tr_ob->ob_g, 1); + newoutlet->xlh_xletn = t.tr_outno; + newoutlet->xlh_type = obj_issignaloutlet(t.tr_ob, t.tr_outno); + newoutlet->xlh_x = t.tr_lx1; + newoutlet->xlh_y = t.tr_ly1; + newoutlet->xlh_conn = binbuf_new(); + binbuf_addv(newoutlet->xlh_conn, "ii", glist_selectionindex(x, &t.tr_ob2->ob_g, 0), t.tr_inno); + /* insert structure regarding its coords */ + t_xletholder *prev = 0, *curr = outlets; + while(curr && (t.tr_lx1 > curr->xlh_x || (t.tr_lx1 == curr->xlh_x && t.tr_ly1 > curr->xlh_y))) + { + prev = curr; + curr = curr->xlh_next; + } + if(prev) prev->xlh_next = newoutlet; + else outlets = newoutlet; + newoutlet->xlh_next = curr; + + lastoutlet = newoutlet; + } + /* if outer inlet connection */ + else if(!s1 && s2) + { + /* check if inlet is already visited */ + int alr = 0; + t_xletholder *it; + for(it = inlets; it && !alr; ) + { + alr = ((t.tr_inno ? (void *)t.tr_inlet : (void *)t.tr_ob2) == it->xlh_addr); + if(!alr) it = it->xlh_next; + } + + int type = obj_issignaloutlet(t.tr_ob, t.tr_outno); + /* if so, we add the object and outlet number to the list and skip */ + if(alr) + { + binbuf_addv(it->xlh_conn, "ii", glist_selectionindex(x, &t.tr_ob->ob_g, 0), t.tr_outno); + if(it->xlh_type >= 0 && it->xlh_type != type) it->xlh_type = -1; + continue; + } + + /* create and fill inlet handling structure */ + t_xletholder *newinlet = (t_xletholder *)getbytes(sizeof(t_xletholder)); + newinlet->xlh_addr = (t.tr_inno ? (void *)t.tr_inlet : (void *)t.tr_ob2); + newinlet->xlh_seln = glist_selectionindex(x, &t.tr_ob2->ob_g, 1); + newinlet->xlh_xletn = t.tr_inno; + newinlet->xlh_type = type; + newinlet->xlh_x = t.tr_lx2; + newinlet->xlh_y = t.tr_ly2; + newinlet->xlh_conn = binbuf_new(); + binbuf_addv(newinlet->xlh_conn, "ii", glist_selectionindex(x, &t.tr_ob->ob_g, 0), t.tr_outno); + /* insert structure regarding its coords */ + t_xletholder *prev = 0, *curr = inlets; + while(curr && (t.tr_lx2 > curr->xlh_x || (t.tr_lx2 == curr->xlh_x && t.tr_ly2 > curr->xlh_y))) + { + prev = curr; + curr = curr->xlh_next; + } + if(prev) prev->xlh_next = newinlet; + else inlets = newinlet; + newinlet->xlh_next = curr; + } + } + + /* store outer connections in a binbuf */ + t_binbuf *conns = binbuf_new(); + int subnum = glist_selectionindex(x, 0, 0), nin = 0, nout = 0, xplac = 0; + while(inlets) + { + if(inlets->xlh_type >= 0) + { + binbuf_addv(b, "ssiis;", gensym("#X"), gensym("obj"), + X_PLAOFF/3 + xplac, Y_PLAOFF/3, (inlets->xlh_type ? gensym("inlet~") : gensym("inlet"))); + + xplac += (inlets->xlh_type ? 46 : 40) + XLETSGAP; //hardcoded + } + else + { + binbuf_addv(b, "ssiiss;", gensym("#X"), gensym("obj"), + X_PLAOFF/3 + xplac, Y_PLAOFF/3, gensym("inlet~"), gensym("fwd")); + + xplac += 64 + XLETSGAP; //hardcoded + + binbuf_addv(b, "ssiiii;", gensym("#X"), gensym("connect"), + numobj+nin, 1, + inlets->xlh_seln, inlets->xlh_xletn); + } + + binbuf_addv(b, "ssiiii;", gensym("#X"), gensym("connect"), + numobj+nin, 0, + inlets->xlh_seln, inlets->xlh_xletn); + + + int nvec = binbuf_getnatom(inlets->xlh_conn); + t_atom *vec = binbuf_getvec(inlets->xlh_conn); + for(int i = 0; i < nvec/2; i++) + { + binbuf_addv(conns, "ssffii;", gensym("#X"), gensym("connect"), + atom_getfloat(vec+(2*i)), atom_getfloat(vec+(2*i+1)), subnum, nin); + } + binbuf_free(inlets->xlh_conn); + t_xletholder *tmp = inlets->xlh_next; + freebytes(inlets, sizeof(t_xletholder)); + inlets = tmp; + nin++; + } + xplac = 0; + while(outlets) + { + binbuf_addv(b, "ssiis;", gensym("#X"), gensym("obj"), + X_PLAOFF/3 + xplac, (maxy-miny) + Y_PLAOFF*5/3, (outlets->xlh_type ? gensym("outlet~") : gensym("outlet"))); + + xplac += (outlets->xlh_type ? 52 : 46) + XLETSGAP; //hardcoded + + binbuf_addv(b, "ssiiii;", gensym("#X"), gensym("connect"), + outlets->xlh_seln, outlets->xlh_xletn, + numobj+nin+nout, 0); + + int nvec = binbuf_getnatom(outlets->xlh_conn); + t_atom *vec = binbuf_getvec(outlets->xlh_conn); + for(int i = 0; i < nvec/2; i++) + { + binbuf_addv(conns, "ssiiff;", gensym("#X"), gensym("connect"), + subnum, nout, atom_getfloat(vec+(2*i)), atom_getfloat(vec+(2*i+1))); + } + binbuf_free(outlets->xlh_conn); + t_xletholder *tmp = outlets->xlh_next; + freebytes(outlets, sizeof(t_xletholder)); + outlets = tmp; + nout++; + } + + int m = (nin > nout ? nin : nout); + int width = (IOWIDTH * m) * 2 - IOWIDTH; + + binbuf_addv(b, "ssiiss;", gensym("#X"), gensym("restore"), + (minx+maxx)/2 - width/2, (miny+maxy)/2, gensym("pd"), gensym("[name]")); + + *object = b; + *connections = conns; +} + +static void canvas_encapsulate(t_canvas *x) +{ + /* check preconditions */ + // num selected objects > 0 + if (!x->gl_editor || !x->gl_editor->e_selection) + return; + + canvas_undo_add(x, UNDO_SEQUENCE_START, "encapsulate", 0); + /* cut selected objects using special copy method, based on canvas_cut */ + t_binbuf *object, *connections; + int centx, centy; + canvas_undo_add(x, UNDO_CUT, "cut", canvas_undo_set_cut(x, UCUT_CUT)); + canvas_dofancycopy(x, &object, &connections); + canvas_doclear(x); + glob_preset_node_list_check_loc_and_update(); + scrollbar_update(x); + + /* subcanvas creation */ + canvas_dopaste(x, object); + /* trace connections between unselectd objects and patch object */ + pd_bind(&x->gl_pd, gensym("#X")); + binbuf_eval(connections, 0, 0, 0); + pd_unbind(&x->gl_pd, gensym("#X")); + + canvas_undo_add(x, UNDO_CREATE, "create", canvas_undo_set_create(x)); + + binbuf_free(object); + binbuf_free(connections); + + /* select subpatch object */ + t_gobj *sub = glist_nth(x, glist_getindex(x, 0)-1); + gobj_activate(sub, x, (0b1 << 31) | (0x0003 << 16) | 0x0009); + + canvas_undo_add(x, UNDO_SEQUENCE_END, "encapsulate", 0); +} + +/* ------------------------------------------------- */ + static int paste_onset; static t_canvas *paste_canvas; @@ -6411,7 +7157,7 @@ static void canvas_dopaste(t_canvas *x, t_binbuf *b) // hardwired stretchval and whichstretch // until we figure out proper resizing canvas_dofont(x, copiedfont, 1, 1); - //sys_vgui("pdtk_canvas_checkgeometry .x%lx\n", x); + //sys_vgui("pdtk_canvas_checkgeometry .x%zx\n", x); canvas_redraw(x); } } @@ -6819,8 +7565,8 @@ void canvas_connect(t_canvas *x, t_floatarg fwhoout, t_floatarg foutno, { //fprintf(stderr,"draw line\n"); canvas_drawconnection(x, 0, 0, 0, 0, (t_int)oc, obj_issignaloutlet(objsrc, outno)); - /*sys_vgui(".x%lx.c create polyline %d %d %d %d -strokewidth %s " - "-stroke %s -tags {l%lx all_cords}\n", + /*sys_vgui(".x%zx.c create polyline %d %d %d %d -strokewidth %s " + "-stroke %s -tags {l%zx all_cords}\n", glist_getcanvas(x), 0, 0, 0, 0, (obj_issignaloutlet(objsrc, outno) ? "$pd_colors(signal_cord_width)" : @@ -7383,7 +8129,10 @@ void canvas_editmode(t_canvas *x, t_floatarg fyesplease) //fprintf(stderr,"canvas_editmode %f\n", fyesplease); /* first check if this is a canvas hosting an array and if so - refuse to add any further objects */ + refuse to add any further objects. we allow edit mode on the + subpatches that have only scalars, as that allows for their + repositioning/deletion/etc. + */ if (canvas_hasarray(x)) return; int yesplease = fyesplease; @@ -7394,6 +8143,8 @@ void canvas_editmode(t_canvas *x, t_floatarg fyesplease) return; } x->gl_edit = !x->gl_edit; + // make sure to exit temporary run mode here + x->gl_edit_save = 0; if (x->gl_edit && glist_isvisible(x) && glist_istoplevel(x)){ //dpsaha@vt.edu add the resize blobs on GOP t_gobj *g; @@ -7417,7 +8168,7 @@ void canvas_editmode(t_canvas *x, t_floatarg fyesplease) canvas_setcursor(x, CURSOR_RUNMODE_NOTHING); /* Don't need this anymore, as we can control comment appearance with CSS. */ - //sys_vgui(".x%lx.c delete commentbar\n", glist_getcanvas(x)); + //sys_vgui(".x%zx.c delete commentbar\n", glist_getcanvas(x)); // jsarlo if (x->gl_editor->canvas_cnct_inlet_tag[0] != 0) { @@ -7443,13 +8194,21 @@ void canvas_editmode(t_canvas *x, t_floatarg fyesplease) } if (glist_isvisible(x)) { - int edit = !glob_ctrl && x->gl_edit; + int edit = /*!glob_ctrl && */x->gl_edit; gui_vmess("gui_canvas_set_editmode", "xi", glist_getcanvas(x), edit); } } +void canvas_query_editmode(t_canvas *x) +{ + int edit = /*!glob_ctrl && */x->gl_edit; + gui_vmess("gui_canvas_set_editmode", "xi", + glist_getcanvas(x), + edit); +} + // jsarlo void canvas_magicglass(t_canvas *x, t_floatarg fyesplease) { @@ -7492,7 +8251,7 @@ void canvas_tooltips(t_canvas *x, t_floatarg fyesplease) tooltips = 0; tooltip_erase(x); } - //sys_vgui("pdtk_canvas_tooltips .x%lx %d\n", + //sys_vgui("pdtk_canvas_tooltips .x%zx %d\n", // x, tooltips); } @@ -7502,11 +8261,11 @@ static void canvas_dofont(t_canvas *x, t_floatarg font, t_floatarg xresize, { t_gobj *y; x->gl_font = font; - if (x->gl_isgraph && !canvas_isabstraction(x) && + /*if (x->gl_isgraph && !canvas_isabstraction(x) && (xresize != 1 || yresize != 1) && !glist_istoplevel(x)) { vmess(&x->gl_pd, gensym("menu-open"), ""); - } + }*/ if (xresize != 1 || yresize != 1) { for (y = x->gl_list; y; y = y->g_next) @@ -7517,7 +8276,7 @@ static void canvas_dofont(t_canvas *x, t_floatarg font, t_floatarg xresize, ny1 = y1 * yresize + 0.5; if (pd_class(&y->g_pd) != scalar_class) { - //fprintf(stderr,"dofont gobj displace %lx %d %d %d %d : " + //fprintf(stderr,"dofont gobj displace %zx %d %d %d %d : " // "%f %f : %d %d\n", // y, x1, x2, y1, y2, xresize, yresize, nx1, ny1); gobj_displace(y, x, nx1-x1, ny1-y1); @@ -7526,7 +8285,7 @@ static void canvas_dofont(t_canvas *x, t_floatarg font, t_floatarg xresize, } if (glist_isvisible(x)) { - //fprintf(stderr,"glist_redraw %lx\n", x); + //fprintf(stderr,"glist_redraw %zx\n", x); if (x->gl_editor && magicGlass_isOn(x->gl_editor->gl_magic_glass)) magicGlass_hide(x->gl_editor->gl_magic_glass); glist_redraw(x); @@ -7629,7 +8388,7 @@ static void canvas_enterobj(t_canvas *x, t_symbol *item, t_floatarg xpos, //helpname = g->g_pd->c_helpname; //dir = g->g_pd->c_externdir; } - //sys_vgui("pdtk_gettip .x%lx.c %s %d " + //sys_vgui("pdtk_gettip .x%zx.c %s %d " //"[list %s] [list %s] [list %s]\n", //x, item->s_name, (int)xletno, //name->s_name, helpname->s_name, dir->s_name); @@ -7645,7 +8404,7 @@ static void canvas_tip(t_canvas *x, t_symbol *s, int argc, t_atom *argv) error("canvas_tip: bad argument"); else { - //sys_vgui("pdtk_tip .x%lx.c 1", x); + //sys_vgui("pdtk_tip .x%zx.c 1", x); //t_atom *at = argv; int i; for (i=0; i<argc; i++) @@ -7755,6 +8514,8 @@ void g_editor_setup(void) gensym("redo"), A_NULL); class_addmethod(canvas_class, (t_method)canvas_tidy, gensym("tidy"), A_NULL); + class_addmethod(canvas_class, (t_method)canvas_encapsulate, + gensym("encapsulate"), A_NULL); //class_addmethod(canvas_class, (t_method)canvas_texteditor, // gensym("texteditor"), A_NULL); class_addmethod(canvas_class, (t_method)canvas_editmode, @@ -7768,7 +8529,9 @@ void g_editor_setup(void) class_addmethod(canvas_class, (t_method)canvas_print, gensym("print"), A_SYMBOL, A_NULL); class_addmethod(canvas_class, (t_method)canvas_menufont, - gensym("menufont"), A_NULL); + gensym("menufont"), A_FLOAT, A_NULL); + class_addmethod(canvas_class, (t_method)canvas_init_menu, + gensym("updatemenu"), A_NULL); class_addmethod(canvas_class, (t_method)canvas_font, gensym("font"), A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_NULL); class_addmethod(canvas_class, (t_method)canvas_zoom, @@ -7797,6 +8560,8 @@ void g_editor_setup(void) gensym("disconnect"), A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_NULL); /* -------------- copy buffer ------------------ */ copy_binbuf = binbuf_new(); + + abstracthandler_setup(); } void canvas_editor_for_class(t_class *c) diff --git a/pd/src/g_graph.c b/pd/src/g_graph.c index 7f806a721942d12811177f6bdba77f15b2e558a6..8691141adfa76d481997ed4d22d23e14731b0050 100644 --- a/pd/src/g_graph.c +++ b/pd/src/g_graph.c @@ -60,9 +60,82 @@ int canvas_isgroup(t_canvas *x) extern t_template *canvas_findtemplate(t_canvas *c); extern t_canvas *canvas_templatecanvas_forgroup(t_canvas *c); + +/* ico@vt.edu 2020-08-24: +check if canvas consists of only scalars and returns 2. if the canvas only +has the last object as a non-scalar (e.g. a new object has just been created, +then we return 1, otherwise return 0. this is used to prevent creation of new +objects in an GOP window that only has scalars inside it or scalars with one +newly created object that is yet to be typed into and therefore properly +instantiated */ +int canvas_has_scalars_only(t_canvas *x) +{ + t_gobj *g = x->gl_list; + int hasonlyscalars = 2; + while (g) + { + //post("g..."); + if (pd_class(&g->g_pd) != scalar_class) + { + /* + post("...scalar=NO %s %s", + (pd_class(&g->g_pd) == text_class ? "text_class" : "NOT_text_class"), + (((t_text *)g)->te_type == T_TEXT) ? "T_TEXT" : "NOT_T_TEXT"); + */ + + /* ico@vt.edu 2020-08-24: + if we have one more object or the last object is not newly + instantiated text object + to distinguish between a comment and a text object that is + yet to be instantiated we use: + 1) comment is text_class and its te_type is T_TEXT + 2) blank object one is typing into is text_class but is NOT T_TEXT + 3) instantiated object is something other than text_class (unless) + it is a comment + 4) object that has failed to create is same as blank object + */ + if (g->g_next || (pd_class(&g->g_pd) != text_class || ((t_text *)g)->te_type == T_TEXT)) + hasonlyscalars = 0; + else + hasonlyscalars = 1; + break; + } + //post("...scalar, comment, or uninitialized object=yes"); + g = g->g_next; + } + //post("has scalars only=%d", hasonlyscalars); + return(hasonlyscalars); +} + +/* ico@vt.edu 2020-08-24: this draws or erases redrect on a gop window + and is being refactored due to complex logic involving subpatches with + scalars only that should not have a redrect until a non-scalar object + has been instantiated (this does not include empty objects that are + yet to be typed into, as this is one way how one can instantiate new + scalar inside a subpatch) +*/ +void glist_update_redrect(t_glist *x) +{ + t_gobj *y = x->gl_list; + while(y->g_next) y = y->g_next; + + if (x->gl_editor && x->gl_isgraph && !x->gl_goprect + && pd_checkobject(&y->g_pd) && !canvas_has_scalars_only(x)) + { + //post("glist_add drawredrect %d", canvas_has_scalars_only(x)); + x->gl_goprect = 1; + canvas_drawredrect(x, 1); + } + else if (canvas_has_scalars_only(x) && x->gl_goprect) + { + x->gl_goprect = 0; + canvas_drawredrect(x, 0); + } +} + void glist_add(t_glist *x, t_gobj *y) { - //fprintf(stderr,"glist_add %lx %d\n", (t_int)x, (x->gl_editor ? 1 : 0)); + //fprintf(stderr,"glist_add %zx %d\n", (t_uint)x, (x->gl_editor ? 1 : 0)); t_object *ob; y->g_next = 0; int index = 0; @@ -84,12 +157,7 @@ void glist_add(t_glist *x, t_gobj *y) // canvas_undo_set_create(x, index), "create"); //glist_noselect(x); } - if (x->gl_editor && x->gl_isgraph && !x->gl_goprect - && pd_checkobject(&y->g_pd)) - { - x->gl_goprect = 1; - canvas_drawredrect(x, 1); - } + glist_update_redrect(x); if (glist_isvisible(x)) gobj_vis(y, x, 1); if (class_isdrawcommand(y->g_pd)) @@ -134,10 +202,12 @@ int canvas_hasarray(t_canvas *x) /* JMZ: emit a closebang message */ void canvas_closebang(t_canvas *x); +void canvas_dirtyclimb(t_canvas *x, int n); + /* delete an object from a glist and free it */ void glist_delete(t_glist *x, t_gobj *y) { - //fprintf(stderr,"glist_delete y=%lx x=%lx glist_getcanvas=%lx\n", y, x, glist_getcanvas(x)); + //fprintf(stderr,"glist_delete y=%zx x=%zx glist_getcanvas=%zx\n", y, x, glist_getcanvas(x)); if (x->gl_list) { //fprintf(stderr,"glist_delete YES\n"); @@ -162,6 +232,9 @@ void glist_delete(t_glist *x, t_gobj *y) /* if we are a group, let's call ourselves a drawcommand */ if (((t_canvas *)y)->gl_svg) drawcommand = 1; + + if(((t_canvas *)y)->gl_dirty) + canvas_dirtyclimb((t_canvas *)y, 0); } wasdeleting = canvas_setdeleting(canvas, 1); @@ -184,7 +257,7 @@ void glist_delete(t_glist *x, t_gobj *y) if (gl->gl_isgraph) { char tag[80]; - //sprintf(tag, "graph%lx", (t_int)gl); + //sprintf(tag, "graph%zx", (t_uint)gl); //t_glist *yy = (t_glist *)y; sprintf(tag, "%s", rtext_gettag(glist_findrtext(x, &gl->gl_obj))); @@ -213,7 +286,7 @@ void glist_delete(t_glist *x, t_gobj *y) } if (glist_isvisible(canvas)) { - //fprintf(stderr,"...deleting %lx %lx\n", x, glist_getcanvas(x)); + //fprintf(stderr,"...deleting %zx %zx\n", x, glist_getcanvas(x)); gobj_vis(y, x, 0); } if (x->gl_editor && (ob = pd_checkobject(&y->g_pd))) @@ -257,6 +330,8 @@ void glist_delete(t_glist *x, t_gobj *y) //fprintf(stderr,"glist_delete late_rtext_free\n"); rtext_free(rt); } + + if (x->gl_list) glist_update_redrect(x); } } @@ -293,8 +368,8 @@ void glist_retext(t_glist *glist, t_text *y) } } -void glist_grab(t_glist *x, t_gobj *y, t_glistmotionfn motionfn, - t_glistkeyfn keyfn, int xpos, int ypos) +void glist_grab(t_glist *x, t_gobj *y, t_glistmotionfn motionfn, t_glistkeyfn keyfn, + t_glistkeynameafn keynameafn, int xpos, int ypos) { //fprintf(stderr,"glist_grab\n"); t_glist *x2 = glist_getcanvas(x); @@ -304,6 +379,7 @@ void glist_grab(t_glist *x, t_gobj *y, t_glistmotionfn motionfn, x2->gl_editor->e_grab = y; x2->gl_editor->e_motionfn = motionfn; x2->gl_editor->e_keyfn = keyfn; + x2->gl_editor->e_keynameafn = keynameafn; x2->gl_editor->e_xwas = xpos; x2->gl_editor->e_ywas = ypos; } @@ -313,7 +389,7 @@ t_canvas *glist_getcanvas(t_glist *x) //fprintf(stderr,"glist_getcanvas\n"); while (x->gl_owner && !x->gl_havewindow && x->gl_isgraph) { - //fprintf(stderr,"x=%lx x->gl_owner=%d x->gl_havewindow=%d " + //fprintf(stderr,"x=%zx x->gl_owner=%d x->gl_havewindow=%d " // "x->gl_isgraph=%d gobj_shouldvis=%d\n", // x, (x->gl_owner ? 1:0), x->gl_havewindow, x->gl_isgraph, // gobj_shouldvis(&x->gl_gobj, x->gl_owner)); @@ -418,7 +494,7 @@ void glist_sort(t_glist *x) t_inlet *canvas_addinlet(t_canvas *x, t_pd *who, t_symbol *s) { - //fprintf(stderr,"canvas_addinlet %d %lx %d\n", x->gl_loading, x->gl_owner, glist_isvisible(x->gl_owner)); + //fprintf(stderr,"canvas_addinlet %d %zx %d\n", x->gl_loading, x->gl_owner, glist_isvisible(x->gl_owner)); t_inlet *ip = inlet_new(&x->gl_obj, who, s, 0); if (!x->gl_loading && x->gl_owner && glist_isvisible(x->gl_owner)) { @@ -490,7 +566,7 @@ void canvas_resortinlets(t_canvas *x) { canvas_fixlinesfor(x->gl_owner, &x->gl_obj); //fprintf(stderr,"good place to fix redrawing of inlets " - // ".x%lx owner=.x%lx %d (parent)%d\n", + // ".x%zx owner=.x%zx %d (parent)%d\n", // x, x->gl_owner, x->gl_loading, x->gl_owner->gl_loading); /* @@ -907,7 +983,7 @@ void glist_redraw(t_glist *x) linetraverser_start(&t, x); while (oc = linetraverser_next(&t)) canvas_updateconnection(glist_getcanvas(x), t.tr_lx1, t.tr_ly1, t.tr_lx2, t.tr_ly2, (t_int)oc); - //sys_vgui(".x%lx.c coords l%lx %d %d %d %d\n", + //sys_vgui(".x%zx.c coords l%zx %d %d %d %d\n", // glist_getcanvas(x), oc, // t.tr_lx1, t.tr_ly1, t.tr_lx2, t.tr_ly2); canvas_drawredrect(x, 0); @@ -944,10 +1020,10 @@ t_symbol *garray_getlabelcolor(t_garray *x); static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis) { t_glist *x = (t_glist *)gr; - //fprintf(stderr,"graph vis canvas=%lx gobj=%lx %d\n", + //fprintf(stderr,"graph vis canvas=%zx gobj=%zx %d\n", // (t_int)parent_glist, (t_int)gr, vis); - //fprintf(stderr, "graph_vis gr=.x%lx parent_glist=.x%lx " - // "glist_getcanvas(x->gl_owner)=.x%lx vis=%d\n", + //fprintf(stderr, "graph_vis gr=.x%zx parent_glist=.x%zx " + // "glist_getcanvas(x->gl_owner)=.x%zx vis=%d\n", // (t_int)gr, (t_int)parent_glist, // (t_int)glist_getcanvas(x->gl_owner), vis); char tag[50]; @@ -962,6 +1038,7 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis) } /* Sanity check */ + //post("parent_glist=%lx x->gl_obj=%lx", parent_glist, &x->gl_obj); rtext = glist_findrtext(parent_glist, &x->gl_obj); if (!rtext) { @@ -977,17 +1054,17 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis) // tgt = parent_glist; // exception = 1; //} - //fprintf(stderr,"tgt=.x%lx %d\n", (t_int)tgt, exception); + //fprintf(stderr,"tgt=.x%zx %d\n", (t_uint)tgt, exception); if (vis & gobj_shouldvis(gr, parent_glist)) { int xpix, ypix; xpix = text_xpix(&x->gl_obj, parent_glist); ypix = text_ypix(&x->gl_obj, parent_glist); - gui_vmess("gui_gobj_new", "xssiii", + gui_vmess("gui_gobj_new", "xssiiii", glist_getcanvas(x->gl_owner), tag, "graph", xpix, ypix, - parent_glist == glist_getcanvas(x->gl_owner) ? 1 : 0); + parent_glist == glist_getcanvas(x->gl_owner) ? 1 : 0, 0); if (canvas_showtext(x)) rtext_draw(glist_findrtext(parent_glist, &x->gl_obj)); } @@ -1008,8 +1085,8 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis) if (!vis) rtext_erase(glist_findrtext(parent_glist, &x->gl_obj)); - //sprintf(tag, "graph%lx", (t_int)x); - //fprintf(stderr, "gettag=%s, tag=graph%lx\n", + //sprintf(tag, "graph%zx", (t_uint)x); + //fprintf(stderr, "gettag=%s, tag=graph%zx\n", // rtext_gettag(glist_findrtext(parent_glist, &x->gl_obj)),(t_int)x); /* if we look like a graph but have been moved to a toplevel, just show the bounding rectangle */ @@ -1028,6 +1105,16 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis) gui_vmess("gui_graph_fill_border", "xsi", glist_getcanvas(x->gl_owner), tag); + /* ico@vt.edu: do we need to redraw scalars here? */ + for (g = x->gl_list; g; g = g->g_next) + { + gop_redraw = 1; + //fprintf(stderr,"drawing gop objects\n"); + if (g->g_pd == scalar_class) + gobj_vis(g, x, 1); + //fprintf(stderr,"done\n"); + gop_redraw = 0; + } } else if (gobj_shouldvis(gr, parent_glist)) { @@ -1089,7 +1176,7 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis) gui_end_array(); } } - /* Finally, end the final array as wel as the call to the GUI */ + /* Finally, end the final array as well as the call to the GUI */ gui_end_array(); gui_end_vmess(); @@ -1434,9 +1521,9 @@ static void graph_displace(t_gobj *z, t_glist *glist, int dx, int dy) sprintf(tag, "%s", rtext_gettag( glist_findrtext((x->gl_owner ? x->gl_owner: x), &x->gl_obj))); - sys_vgui(".x%lx.c move %s %d %d\n", + sys_vgui(".x%zx.c move %s %d %d\n", glist_getcanvas(x->gl_owner), tag, dx, dy); - sys_vgui(".x%lx.c move %sR %d %d\n", + sys_vgui(".x%zx.c move %sR %d %d\n", glist_getcanvas(x->gl_owner), tag, dx, dy);*/ if (!do_not_redraw) { @@ -1508,7 +1595,7 @@ static void graph_displace_withtag(t_gobj *z, t_glist *glist, int dx, int dy) static void graph_select(t_gobj *z, t_glist *glist, int state) { - //fprintf(stderr,"graph_select .x%lx .x%lx %d...\n", + //fprintf(stderr,"graph_select .x%zx .x%zx %d...\n", // (t_int)z, (t_int)glist, state); t_glist *x = (t_glist *)z; if (!x->gl_isgraph) @@ -1516,7 +1603,7 @@ static void graph_select(t_gobj *z, t_glist *glist, int state) else //if(glist_istoplevel(glist)) { //fprintf(stderr,"...yes\n"); - //fprintf(stderr,"%lx %lx %lx\n", glist_getcanvas(glist), glist, x); + //fprintf(stderr,"%zx %zx %zx\n", glist_getcanvas(glist), glist, x); t_rtext *y = glist_findrtext(glist, &x->gl_obj); if (canvas_showtext(x)) { @@ -1561,7 +1648,7 @@ static void graph_select(t_gobj *z, t_glist *glist, int state) } // Don't yet understand the purpose of this call, so not deleting // it just yet... - //sys_vgui("pdtk_select_all_gop_widgets .x%lx %s %d\n", + //sys_vgui("pdtk_select_all_gop_widgets .x%zx %s %d\n", // canvas, rtext_gettag(glist_findrtext(glist, &x->gl_obj)), state); } } @@ -1585,7 +1672,7 @@ static void graph_delete(t_gobj *z, t_glist *glist) while (y = x->gl_list) glist_delete(x, y); #if 0 /* I think this was just wrong. */ if (glist_isvisible(x)) - sys_vgui(".x%lx.c delete graph%lx\n", glist_getcanvas(glist), x); + sys_vgui(".x%zx.c delete graph%zx\n", glist_getcanvas(glist), x); #endif } } @@ -1656,7 +1743,7 @@ static int graph_click(t_gobj *z, struct _glist *glist, } if (!doit) { - //fprintf(stderr," not clicking %lx %d\n", + //fprintf(stderr," not clicking %zx %d\n", // (t_int)clickme, clickreturned); if (clickme != NULL) { diff --git a/pd/src/g_io.c b/pd/src/g_io.c index c7330bf635d50c5c9f7c86743b3a0b8047b80653..6b1184241411538abd788a24c568e7833c5b7e19 100644 --- a/pd/src/g_io.c +++ b/pd/src/g_io.c @@ -36,8 +36,8 @@ typedef struct _vinlet /* if not reblocking, the next slot communicates the parent's inlet signal from the prolog to the DSP routine: */ t_signal *x_directsignal; - - t_resample x_updown; + t_resample x_updown; + t_outlet *x_fwdout; /* optional outlet for forwarding messages to inlet~ */ } t_vinlet; static void *vinlet_new(t_symbol *s) @@ -106,8 +106,8 @@ t_int *vinlet_perform(t_int *w) int n = (int)(w[3]); t_float *in = x->x_read; #if 0 - if (tot < 5) post("-in %lx out %lx n %d", in, out, n); - if (tot < 5) post("-buf %lx endbuf %lx", x->x_buf, x->x_endbuf); + if (tot < 5) post("-in %zx out %zx n %d", in, out, n); + if (tot < 5) post("-buf %zx endbuf %zx", x->x_buf, x->x_endbuf); if (tot < 5) post("in[0] %f in[1] %f in[2] %f", in[0], in[1], in[2]); #endif while (n--) *out++ = *in++; @@ -116,6 +116,19 @@ t_int *vinlet_perform(t_int *w) return (w+4); } +static void vinlet_fwd(t_vinlet *x, t_symbol *s, int argc, t_atom *argv) +{ + if(x->x_fwdout) /* inlet~ fwd */ + outlet_anything(x->x_fwdout, s, argc, argv); + else if(x->x_buf == 0) /* inlet, need to forward message because we want + it to accept fwd selector */ + outlet_anything(x->x_obj.ob_outlet, s, argc, argv); + else /* inlet~ without fwd */ + pd_error(x->x_canvas, "inlet~: expected 'signal' but got '%s' " + "(Note: [inlet~] does not forward non-signal messages unless " + "argument 'fwd' is defined)", s->s_name); +} + static void vinlet_dsp(t_vinlet *x, t_signal **sp) { t_signal *outsig; @@ -149,7 +162,7 @@ t_int *vinlet_doprolog(t_int *w) while (nshift--) *f1++ = *f2++; } #if 0 - if (tot < 5) post("in %lx out %lx n %lx", in, out, n), tot++; + if (tot < 5) post("in %zx out %zx n %zx", in, out, n), tot++; if (tot < 5) post("in[0] %f in[1] %f in[2] %f", in[0], in[1], in[2]); #endif @@ -251,8 +264,10 @@ static void *vinlet_newsig(t_symbol *s) x->x_endbuf = x->x_buf = (t_float *)getbytes(0); x->x_bufsize = 0; x->x_directsignal = 0; + x->x_fwdout = 0; outlet_new(&x->x_obj, &s_signal); - + /* this line was in pd vanilla but I don't think it is necessary + inlet_new(&x->x_obj, (t_pd *)x->x_inlet, 0, 0); */ resample_init(&x->x_updown); /* this should be thought over: @@ -265,6 +280,8 @@ static void *vinlet_newsig(t_symbol *s) else if (s == gensym("lin"))x->x_updown.method=2; /* up: linear interpolation */ else x->x_updown.method=0; /* up: zero-padding */ + if (s == gensym("fwd")) /* turn on forwarding */ + x->x_fwdout = outlet_new(&x->x_obj, 0); return (x); } @@ -279,6 +296,8 @@ static void vinlet_setup(void) class_addsymbol(vinlet_class, vinlet_symbol); class_addlist(vinlet_class, vinlet_list); class_addanything(vinlet_class, vinlet_anything); + class_addmethod(vinlet_class,(t_method)vinlet_fwd, gensym("fwd"), + A_GIMME, 0); class_addmethod(vinlet_class, (t_method)vinlet_dsp, gensym("dsp"), A_CANT, 0); class_sethelpsymbol(vinlet_class, gensym("pd")); @@ -377,8 +396,8 @@ t_int *voutlet_perform(t_int *w) int n = (int)(w[3]); t_sample *out = x->x_write, *outwas = out; #if 0 - if (tot < 5) post("-in %lx out %lx n %d", in, out, n); - if (tot < 5) post("-buf %lx endbuf %lx", x->x_buf, x->x_endbuf); + if (tot < 5) post("-in %zx out %zx n %d", in, out, n); + if (tot < 5) post("-buf %zx endbuf %zx", x->x_buf, x->x_endbuf); #endif while (n--) { @@ -403,7 +422,7 @@ static t_int *voutlet_doepilog(t_int *w) out = x->x_updown.s_vec; #if 0 - if (tot < 5) post("outlet in %lx out %lx n %lx", in, out, n), tot++; + if (tot < 5) post("outlet in %zx out %zx n %zx", in, out, n), tot++; #endif for (; n--; in++) *out++ = *in, *in = 0; if (in == x->x_endbuf) in = x->x_buf; @@ -419,7 +438,7 @@ static t_int *voutlet_doepilog_resampling(t_int *w) t_sample *out = x->x_updown.s_vec; #if 0 - if (tot < 5) post("outlet in %lx out %lx n %lx", in, out, n), tot++; + if (tot < 5) post("outlet in %zx out %zx n %zx", in, out, n), tot++; #endif for (; n--; in++) *out++ = *in, *in = 0; if (in == x->x_endbuf) in = x->x_buf; diff --git a/pd/src/g_magicglass.c b/pd/src/g_magicglass.c index 999bc55e959254b64b29899b133da3a572f067d8..70bfd4b612192a8cee458f155cc47d5b853f20b6 100644 --- a/pd/src/g_magicglass.c +++ b/pd/src/g_magicglass.c @@ -19,7 +19,7 @@ void magicGlass_clearText(t_magicGlass *x); void magicGlass_bind(t_magicGlass *x, t_object *obj, int outno) { - //fprintf(stderr,"magicglass_bind %lx\n", (t_int)x); + //fprintf(stderr,"magicglass_bind %zx\n", (t_uint)x); if (x->x_connectedObj != obj) { if (x->x_connectedObj) @@ -39,7 +39,7 @@ void magicGlass_bind(t_magicGlass *x, t_object *obj, int outno) void magicGlass_unbind(t_magicGlass *x) { - //fprintf(stderr,"magicglass_unbind %lx\n", (t_int)x); + //fprintf(stderr,"magicglass_unbind %zx\n", (t_uint)x); if (x->x_connectedObj) { obj_disconnect(x->x_connectedObj, @@ -108,8 +108,8 @@ void magicGlass_updateText(t_magicGlass *x, int moved) void magicGlass_drawNew(t_magicGlass *x) { - gui_vmess("gui_gobj_new", "xssiii", - x->x_c, "cord_inspector", "cord_inspector", 0, 0, 0); + gui_vmess("gui_gobj_new", "xssiiii", + x->x_c, "cord_inspector", "cord_inspector", 0, 0, 0, 0); gui_vmess("gui_cord_inspector_new", "xi", x->x_c, x->x_display_font); magicGlass_updateText(x, 0); @@ -387,7 +387,7 @@ void *magicGlass_new(t_glist *c) void magicGlass_free(t_magicGlass *x) { - //fprintf(stderr,"magicglass_free %lx\n", (t_int)x); + //fprintf(stderr,"magicglass_free %zx\n", (t_uint)x); magicGlass_unbind(x); x->x_dspOn = 0; clock_free(x->x_clearClock); diff --git a/pd/src/g_mycanvas.c b/pd/src/g_mycanvas.c index 638ef318d84a3e594b745ea57cb570b7686748f0..c964be131377c07358bcea125d8493fe35b42910 100644 --- a/pd/src/g_mycanvas.c +++ b/pd/src/g_mycanvas.c @@ -27,8 +27,8 @@ void my_canvas_draw_new(t_my_canvas *x, t_glist *glist) char cbuf[8]; sprintf(cbuf, "#%6.6x", x->x_gui.x_bcol); - gui_vmess("gui_gobj_new", "xxsiii", canvas, - x, "iemgui", x1, y1, glist_istoplevel(glist)); + gui_vmess("gui_gobj_new", "xxsiiii", canvas, + x, "iemgui", x1, y1, glist_istoplevel(glist), 0); gui_vmess("gui_mycanvas_new", "xxsiiiiii", canvas, x, cbuf, x1, y1, x1+x->x_vis_w, y1+x->x_vis_h, x1+x->x_gui.x_w, y1+x->x_gui.x_h); @@ -151,10 +151,10 @@ static void my_canvas_getrect(t_gobj *z, t_glist *glist, static void my_canvas_save(t_gobj *z, t_binbuf *b) { t_my_canvas *x = (t_my_canvas *)z; - int bflcol[3]; + t_symbol *bflcol[3]; t_symbol *srl[3]; iemgui_save(&x->x_gui, srl, bflcol); - binbuf_addv(b, "ssiisiiisssiiiiiii;", gensym("#X"),gensym("obj"), + binbuf_addv(b, "ssiisiiisssiiiissi;", gensym("#X"),gensym("obj"), (int)x->x_gui.x_obj.te_xpix, (int)x->x_gui.x_obj.te_ypix, gensym("cnv"), x->x_gui.x_w, x->x_vis_w, x->x_vis_h, srl[0], srl[1], srl[2], x->x_gui.x_ldx, x->x_gui.x_ldy, @@ -277,7 +277,6 @@ static void my_canvas_vis_size(t_my_canvas *x, t_symbol *s, int ac, t_atom *av) static void *my_canvas_new(t_symbol *s, int argc, t_atom *argv) { t_my_canvas *x = (t_my_canvas *)pd_new(my_canvas_class); - int bflcol[]={-233017, -1, -66577}; int a=IEM_GUI_DEFAULTSIZE, w=100, h=60; int ldx=20, ldy=12, i=0; int fs=14; @@ -285,6 +284,10 @@ static void *my_canvas_new(t_symbol *s, int argc, t_atom *argv) iem_inttosymargs(&x->x_gui, 0); iem_inttofstyle(&x->x_gui, 0); + x->x_gui.x_bcol = 0xE0E0E0; + x->x_gui.x_fcol = 0x00; + x->x_gui.x_lcol = 0x404040; + if(((argc >= 10)&&(argc <= 13)) &&IS_A_FLOAT(argv,0)&&IS_A_FLOAT(argv,1)&&IS_A_FLOAT(argv,2)) { @@ -308,8 +311,7 @@ static void *my_canvas_new(t_symbol *s, int argc, t_atom *argv) if(((argc >= 10)&&(argc <= 13)) &&(IS_A_SYMBOL(argv,i+3)||IS_A_FLOAT(argv,i+3))&&IS_A_FLOAT(argv,i+4) &&IS_A_FLOAT(argv,i+5)&&IS_A_FLOAT(argv,i+6) - &&IS_A_FLOAT(argv,i+7)&&IS_A_FLOAT(argv,i+8) - &&IS_A_FLOAT(argv,i+9)) + &&IS_A_FLOAT(argv,i+7)) { /* disastrously, the "label" sits in a different part of the message. So we have to track its location separately (in @@ -320,8 +322,7 @@ static void *my_canvas_new(t_symbol *s, int argc, t_atom *argv) ldy = atom_getintarg(i+5, argc, argv); iem_inttofstyle(&x->x_gui, atom_getintarg(i+6, argc, argv)); fs = atom_getintarg(i+7, argc, argv); - bflcol[0] = atom_getintarg(i+8, argc, argv); - bflcol[2] = atom_getintarg(i+9, argc, argv); + iemgui_all_loadcolors(&x->x_gui, argv+i+8, 0, argv+i+9); } if((argc == 13)&&IS_A_FLOAT(argv,i+10)) { @@ -340,7 +341,6 @@ static void *my_canvas_new(t_symbol *s, int argc, t_atom *argv) if(fs < 4) fs = 4; x->x_gui.x_fontsize = fs; - iemgui_all_colfromload(&x->x_gui, bflcol); x->x_at[0].a_type = A_FLOAT; x->x_at[1].a_type = A_FLOAT; iemgui_verify_snd_ne_rcv(&x->x_gui); diff --git a/pd/src/g_numbox.c b/pd/src/g_numbox.c index 96976df41813cf127e5da2aa48d3b60c5c55e394..9dc258226757ae759fe5e8f0600767b259256b94 100644 --- a/pd/src/g_numbox.c +++ b/pd/src/g_numbox.c @@ -26,23 +26,48 @@ static void my_numbox_draw_update(t_gobj *client, t_glist *glist); t_widgetbehavior my_numbox_widgetbehavior; /*static*/ t_class *my_numbox_class; +// forward declarations +static void my_numbox_set_change(t_my_numbox *x, t_floatarg f); +static void my_numbox_ftoa(t_my_numbox *x , int append); +static void my_numbox_list(t_my_numbox *x, t_symbol *s, int ac, t_atom *av); + +static t_symbol *numbox_keyname_sym_a; + static void my_numbox_tick_reset(t_my_numbox *x) { - //printf("tick_reset\n"); + //post("tick_reset\n"); if(x->x_gui.x_change && x->x_gui.x_glist) { - //printf(" success\n"); - x->x_gui.x_change = 0; + //post(" success\n"); + my_numbox_set_change(x, 0); + my_numbox_ftoa(x, 0); sys_queuegui(x, x->x_gui.x_glist, my_numbox_draw_update); } + glist_grab(x->x_gui.x_glist, 0, 0, 0, 0, 0, 0); + x->x_focused = 0; } static void my_numbox_tick_wait(t_my_numbox *x) { - //printf("tick_wait\n"); + //post("tick_wait\n"); sys_queuegui(x, x->x_gui.x_glist, my_numbox_draw_update); } +// to enable ability to change values using arrow keys (only when focused) +static void my_numbox_set_change(t_my_numbox *x, t_floatarg f) +{ + if (f == 0 && x->x_gui.x_change != 0) + { + x->x_gui.x_change = 0; + pd_unbind(&x->x_gui.x_obj.ob_pd, numbox_keyname_sym_a); + } + else if (f == 1 && x->x_gui.x_change != 1) + { + x->x_gui.x_change = 1; + pd_bind(&x->x_gui.x_obj.ob_pd, numbox_keyname_sym_a); + } +} + void my_numbox_clip(t_my_numbox *x) { if(x->x_val < x->x_min) @@ -53,19 +78,21 @@ void my_numbox_clip(t_my_numbox *x) int my_numbox_calc_fontwidth2(t_my_numbox *x, int w, int h, int fontsize) { - int f=31; - if (x->x_gui.x_font_style == 1) f = 27; - else if(x->x_gui.x_font_style == 2) f = 25; + int f=25; + // ico@vt.edu 20200917: below options are disabled for the value + // inside the numbox since we ignore those in 2.x + //if (x->x_gui.x_font_style == 1) f = 27; + //else if(x->x_gui.x_font_style == 2) f = 25; return (fontsize * f * w) / 36 + (h / 2) + 4; } int my_numbox_calc_fontwidth(t_my_numbox *x) { return my_numbox_calc_fontwidth2(x,x->x_gui.x_w,x->x_gui.x_h, - x->x_gui.x_fontsize); + x->x_num_fontsize); } -void my_numbox_ftoa(t_my_numbox *x) +static void my_numbox_ftoa(t_my_numbox *x, int append) { double f=x->x_val; int bufsize, is_exp=0, i, idecimal; @@ -82,7 +109,7 @@ void my_numbox_ftoa(t_my_numbox *x) { if(is_exp) { - if(x->x_gui.x_w <= 5) + if(!append && x->x_gui.x_w <= 5) { x->x_buf[0] = (f < 0.0 ? '-' : '+'); x->x_buf[1] = 0; @@ -91,7 +118,7 @@ void my_numbox_ftoa(t_my_numbox *x) for(idecimal=0; idecimal < i; idecimal++) if(x->x_buf[idecimal] == '.') break; - if(idecimal > (x->x_gui.x_w - 4)) + if(!append && idecimal > (x->x_gui.x_w - 4)) { x->x_buf[0] = (f < 0.0 ? '-' : '+'); x->x_buf[1] = 0; @@ -111,12 +138,12 @@ void my_numbox_ftoa(t_my_numbox *x) for(idecimal=0; idecimal < bufsize; idecimal++) if(x->x_buf[idecimal] == '.') break; - if(idecimal > x->x_gui.x_w) + if(!append && idecimal > x->x_gui.x_w) { x->x_buf[0] = (f < 0.0 ? '-' : '+'); x->x_buf[1] = 0; } - else + else if (!append) x->x_buf[x->x_gui.x_w] = 0; } } @@ -136,26 +163,51 @@ static void my_numbox_draw_update(t_gobj *client, t_glist *glist) if (!glist_isvisible(glist)) return; if(x->x_gui.x_change && x->x_buf[0]) { - //printf("draw_update 1\n"); + //post("draw_update 1 : focused=%d", x->x_focused); char *cp=x->x_buf; int sl = strlen(x->x_buf); - x->x_buf[sl] = '>'; - x->x_buf[sl+1] = 0; + if (x->x_focused == 1) + { + x->x_buf[sl] = '>'; + x->x_buf[sl+1] = 0; + } else if (x->x_focused == 2) { + // this is triggered when one presses return while retaining the focus of the number + // so, we make sure to subtract the '>' that has disappeared and adjust visible digits + // accordingly below + x->x_buf[sl] = 0; + sl--; + } if(sl >= x->x_gui.x_w) cp += sl - x->x_gui.x_w + 1; - gui_vmess("gui_text_set", "xxs", + gui_vmess("gui_text_set_mynumbox", "xxsi", glist_getcanvas(glist), x, - cp); - x->x_buf[sl] = 0; + cp, + 1); + // here we check that we are not in the focused mode 2 that has this already taken care of above + if (x->x_focused != 2) + x->x_buf[sl] = 0; } else { - my_numbox_ftoa(x); /* mmm... side-effects */ - gui_vmess("gui_text_set", "xxs", + //if (!x->x_focused || x->x_focused == 2) + //post("draw_update 2: x->x_buf=<%s> focused=%d change=%d", x->x_buf, x->x_focused, x->x_gui.x_change); + if (!x->x_buf[0] && x->x_focused == 1 && x->x_gui.x_change == 1) + { + x->x_buf[0] = '>'; + x->x_buf[1] = 0; + } + else + { + my_numbox_ftoa(x, 0); /* mmm... side-effects */ + } + gui_vmess("gui_text_set_mynumbox", "xxsi", glist_getcanvas(glist), x, - x->x_buf); + x->x_buf, + x->x_gui.x_selected == glist_getcanvas(glist) && + !x->x_gui.x_change && x->x_gui.x_glist == glist_getcanvas(glist) ? + 2 : (x->x_gui.x_change ? 1 : 0)); x->x_buf[0] = 0; /* mmm... more side-effects... no clue why we'd need to mutate a struct member in order to draw stuff */ } @@ -166,11 +218,12 @@ static void my_numbox_draw_new(t_my_numbox *x, t_glist *glist) t_canvas *canvas=glist_getcanvas(glist); char cbuf[8]; sprintf(cbuf, "#%6.6x", x->x_gui.x_bcol); - int half=x->x_gui.x_h/2, d=1+x->x_gui.x_h/34; + int half=x->x_gui.x_h/2; + t_float d=1+x->x_gui.x_h/34.0; int x1=text_xpix(&x->x_gui.x_obj, glist), x2=x1+x->x_numwidth; int y1=text_ypix(&x->x_gui.x_obj, glist), y2=y1+x->x_gui.x_h; - gui_vmess("gui_numbox_new", "xxsiiiii", + gui_vmess("gui_numbox_new", "xxsiiiiii", canvas, x, cbuf, @@ -178,23 +231,16 @@ static void my_numbox_draw_new(t_my_numbox *x, t_glist *glist) y1, x2 - x1, y2 - y1, + x->x_drawstyle, glist_istoplevel(glist)); - /* Not sure when it is necessary to hide the frame... perhaps for - k12? */ - if (!x->x_hide_frame || x->x_hide_frame == 2) - { - //sys_vgui(".x%lx.c create polyline %d %d %d %d %d %d -stroke #%6.6x " - // "-tags {%lxBASE2 x%lx text iemgui}\n", - // canvas, x1, y1, x1 + half, y1 + half, x1, y2, - // x->x_gui.x_fcol, x, x); - } - my_numbox_ftoa(x); + + my_numbox_ftoa(x, 0); sprintf(cbuf, "#%6.6x", x->x_gui.x_fcol); - gui_vmess("gui_numbox_draw_text", "xxsisiiii", + gui_vmess("gui_numbox_draw_text", "xxsisifii", canvas, x, x->x_buf, - x->x_gui.x_fontsize, + x->x_num_fontsize, cbuf, x1+half+2, y1+half+d, x1, y1); } @@ -210,11 +256,11 @@ static void my_numbox_draw_move(t_my_numbox *x, t_glist *glist) iemgui_base_draw_move(&x->x_gui); - if (x->x_hide_frame <= 1) + if (x->x_drawstyle <= 1) iemgui_io_draw_move(&x->x_gui); - if (!x->x_hide_frame || x->x_hide_frame == 2) + if (!x->x_drawstyle || x->x_drawstyle == 2) { - //sys_vgui(".x%lx.c coords %lxBASE2 %d %d %d %d %d %d\n", + //sys_vgui(".x%zx.c coords %zxBASE2 %d %d %d %d %d %d\n", // canvas, x, x1, y1, x1 + half, y1 + half, x1, y2); } @@ -237,11 +283,12 @@ static void my_numbox_draw_config(t_my_numbox* x,t_glist* glist) char fg[8], bg[8]; sprintf(fg, "#%6.6x", x->x_gui.x_fcol); sprintf(bg, "#%6.6x", x->x_gui.x_bcol); - gui_vmess("gui_numbox_update", "xxsssii", + gui_vmess("gui_numbox_update", "xxssisii", canvas, x, fg, bg, + x->x_num_fontsize, iemgui_typeface((t_iemgui *)x), x->x_gui.x_fontsize, sys_fontweight); @@ -253,7 +300,7 @@ static void my_numbox_draw_select(t_my_numbox *x, t_glist *glist) int issel = x->x_gui.x_selected == canvas && x->x_gui.x_glist == canvas; if(x->x_gui.x_selected && x->x_gui.x_change) { - x->x_gui.x_change = 0; + my_numbox_set_change(x, 0); clock_unset(x->x_clock_reset); x->x_buf[0] = 0; sys_queuegui(x, x->x_gui.x_glist, my_numbox_draw_update); @@ -262,11 +309,11 @@ static void my_numbox_draw_select(t_my_numbox *x, t_glist *glist) char bcol[8]; sprintf(bcol, "#%6.6x", x->x_gui.x_bcol); // The logic in these sys_vgui calls is being taken care // of in the gui now... - //sys_vgui(".x%lx.c itemconfigure %lxBASE1 -stroke %s\n", canvas, x, + //sys_vgui(".x%zx.c itemconfigure %zxBASE1 -stroke %s\n", canvas, x, // issel ? selection_color : x->x_hide_frame <= 1 ? "$pd_colors(iemgui_border)" : bcol); - //sys_vgui(".x%lx.c itemconfigure %lxBASE2 -stroke %s\n", canvas, x, + //sys_vgui(".x%zx.c itemconfigure %zxBASE2 -stroke %s\n", canvas, x, // issel ? selection_color : fcol); - //sys_vgui(".x%lx.c itemconfigure %lxNUMBER -fill %s\n", canvas, x, + //sys_vgui(".x%zx.c itemconfigure %zxNUMBER -fill %s\n", canvas, x, // issel ? selection_color : fcol); if(issel) scalehandle_draw_select2(&x->x_gui); @@ -282,6 +329,7 @@ static void my_numbox__clickhook(t_scalehandle *sh, int newstate) canvas_apply_setundo(x->x_gui.x_glist, (t_gobj *)x); if (!sh->h_scale) scalehandle_click_label(sh); + x->x_yresize_x = 0; } /* not sure if we need this */ sh->h_dragon = newstate; @@ -293,24 +341,34 @@ static void my_numbox__motionhook(t_scalehandle *sh, if (sh->h_scale) { t_my_numbox *x = (t_my_numbox *)(sh->h_master); + x->x_focused = 2; //int dx = (int)mouse_x - sh->h_offset_x; - int dy = (int)mouse_y - sh->h_offset_y; + int dy = (sh->h_constrain == CURSOR_EDITMODE_RESIZE_X) ? 0 : + (int)mouse_y - sh->h_offset_y; + + if (sh->h_constrain == CURSOR_EDITMODE_RESIZE_Y && x->x_yresize_x == 0) + { + x->x_yresize_x = mouse_x; + } /* first calculate y */ int newy = maxi(x->x_gui.x_obj.te_ypix + x->x_gui.x_h + dy, x->x_gui.x_obj.te_ypix + SCALE_NUM_MINHEIGHT); /* then readjust fontsize */ - x->x_tmpfontsize = maxi((newy - x->x_gui.x_obj.te_ypix) * 0.8, + x->x_tmpfontsize = maxi((newy - x->x_gui.x_obj.te_ypix) * 0.9, IEM_FONT_MINSIZE); - int f = 31; - if (x->x_gui.x_font_style == 1) f = 27; - else if(x->x_gui.x_font_style == 2) f = 25; + int f = 25; + // ico@vt.edu 20200917: below options are disabled for the value + // inside the numbox since we ignore those in 2.x + //if (x->x_gui.x_font_style == 1) f = 27; + //else if(x->x_gui.x_font_style == 2) f = 25; int char_w = (x->x_tmpfontsize * f) / 36; /* get the new total width */ - int new_total_width = x->x_numwidth + (int)mouse_x - + int new_total_width = x->x_numwidth + + (sh->h_constrain == CURSOR_EDITMODE_RESIZE_Y ? x->x_yresize_x : (int)mouse_x) - (text_xpix(&x->x_gui.x_obj, x->x_gui.x_glist) + x->x_numwidth); /* now figure out what does this translate into in terms of @@ -331,7 +389,7 @@ static void my_numbox__motionhook(t_scalehandle *sh, // dx,dy,x->x_scalewidth,x->x_scaleheight,numwidth,sh->h_dragx); scalehandle_drag_scale(sh); - x->x_gui.x_fontsize = x->x_tmpfontsize; + x->x_num_fontsize = x->x_tmpfontsize; x->x_gui.x_w = new_char_len; x->x_gui.x_h = x->x_scaleheight; x->x_numwidth = my_numbox_calc_fontwidth(x); @@ -354,7 +412,7 @@ static void my_numbox__motionhook(t_scalehandle *sh, { properties_set_field_int(properties,"width",x->x_scalewidth); properties_set_field_int(properties,"height",x->x_scaleheight); - properties_set_field_int(properties,"font_size",x->x_tmpfontsize); + //properties_set_field_int(properties,"font_size",x->x_tmpfontsize); } } scalehandle_dragon_label(sh,mouse_x, mouse_y); @@ -387,18 +445,18 @@ static void my_numbox_getrect(t_gobj *z, t_glist *glist, static void my_numbox_save(t_gobj *z, t_binbuf *b) { t_my_numbox *x = (t_my_numbox *)z; - int bflcol[3]; + t_symbol *bflcol[3]; t_symbol *srl[3]; iemgui_save(&x->x_gui, srl, bflcol); if(x->x_gui.x_change) { - x->x_gui.x_change = 0; + my_numbox_set_change(x, 0); clock_unset(x->x_clock_reset); x->x_gui.x_changed = 1; sys_queuegui(x, x->x_gui.x_glist, my_numbox_draw_update); } - binbuf_addv(b, "ssiisiiffiisssiiiiiiifii;", gensym("#X"),gensym("obj"), + binbuf_addv(b, "ssiisiiffiisssiiiisssfii;", gensym("#X"),gensym("obj"), (int)x->x_gui.x_obj.te_xpix, (int)x->x_gui.x_obj.te_ypix, gensym("nbx"), x->x_gui.x_w, x->x_gui.x_h, (t_float)x->x_min, (t_float)x->x_max, @@ -406,7 +464,7 @@ static void my_numbox_save(t_gobj *z, t_binbuf *b) srl[0], srl[1], srl[2], x->x_gui.x_ldx, x->x_gui.x_ldy, iem_fstyletoint(&x->x_gui), x->x_gui.x_fontsize, bflcol[0], bflcol[1], bflcol[2], - x->x_val, x->x_log_height, x->x_hide_frame); + x->x_val, x->x_log_height, x->x_drawstyle); } int my_numbox_check_minmax(t_my_numbox *x, double min, double max) @@ -456,7 +514,7 @@ static void my_numbox_properties(t_gobj *z, t_glist *owner) iemgui_properties(&x->x_gui, srl); if(x->x_gui.x_change) { - x->x_gui.x_change = 0; + my_numbox_set_change(x, 0); clock_unset(x->x_clock_reset); x->x_gui.x_changed = 1; sys_queuegui(x, x->x_gui.x_glist, my_numbox_draw_update); @@ -467,7 +525,7 @@ static void my_numbox_properties(t_gobj *z, t_glist *owner) -----------output-range:----------- %g min: %g max: %d \ %d lin log %d %d log-height: %d {%s} {%s} {%s} %d %d %d %d %d %d %d\n", x->x_gui.x_w, 1, x->x_gui.x_h, 8, x->x_min, x->x_max, - x->x_hide_frame, /*EXCEPTION: x_hide_frame instead of schedule*/ + x->x_drawstyle, /*EXCEPTION: x_drawstyle instead of schedule*/ x->x_lin0_log1, x->x_gui.x_loadinit, -1, x->x_log_height, /*no multi, but iem-characteristic*/ srl[0]->s_name, srl[1]->s_name, srl[2]->s_name, @@ -498,7 +556,7 @@ static void my_numbox_properties(t_gobj *z, t_glist *owner) gui_s("background_color"); gui_i(0xffffff & x->x_gui.x_bcol); gui_s("foreground_color"); gui_i(0xffffff & x->x_gui.x_fcol); gui_s("label_color"); gui_i(0xffffff & x->x_gui.x_lcol); - gui_s("hide_frame"); gui_i(x->x_hide_frame); + gui_s("draw_style"); gui_i(x->x_drawstyle); gui_end_array(); gui_end_vmess(); } @@ -519,14 +577,15 @@ static void my_numbox_dialog(t_my_numbox *x, t_symbol *s, int argc, double max = atom_getfloatarg(3, argc, argv); x->x_lin0_log1 = !!atom_getintarg(4, argc, argv); x->x_log_height = maxi(atom_getintarg(6, argc, argv),10); - if (argc > 17) - x->x_hide_frame = (int)atom_getintarg(18, argc, argv); + x->x_drawstyle = (int)atom_getintarg(18, argc, argv); iemgui_dialog(&x->x_gui, argc, argv); x->x_numwidth = my_numbox_calc_fontwidth(x); my_numbox_check_minmax(x, min, max); + // automatically adjust the number font size + x->x_num_fontsize = maxi(x->x_gui.x_h * 0.9, IEM_FONT_MINSIZE); // normally, you'd do move+config, but here you have to do erase+new - // because iemgui_draw_io does not support changes to x_hide_frame. + // because iemgui_draw_io does not support changes to x_drawstyle. iemgui_draw_erase(&x->x_gui); iemgui_draw_new(&x->x_gui); //iemgui_draw_move(&x->x_gui); @@ -540,6 +599,7 @@ static void my_numbox_dialog(t_my_numbox *x, t_symbol *s, int argc, static void my_numbox_motion(t_my_numbox *x, t_floatarg dx, t_floatarg dy) { + x->x_focused = 2; double k2=1.0; int old = x->x_val; @@ -553,52 +613,62 @@ static void my_numbox_motion(t_my_numbox *x, t_floatarg dx, t_floatarg dy) if (old != x->x_val) { x->x_gui.x_changed = 1; + my_numbox_ftoa(x, 0); sys_queuegui(x, x->x_gui.x_glist, my_numbox_draw_update); my_numbox_bang(x); } clock_unset(x->x_clock_reset); + clock_delay(x->x_clock_reset, 3000); } static void my_numbox_click(t_my_numbox *x, t_floatarg xpos, t_floatarg ypos, t_floatarg shift, t_floatarg ctrl, t_floatarg alt) { glist_grab(x->x_gui.x_glist, &x->x_gui.x_obj.te_g, - (t_glistmotionfn)my_numbox_motion, my_numbox_key, xpos, ypos); + (t_glistmotionfn)my_numbox_motion, my_numbox_key, my_numbox_list, xpos, ypos); } static int my_numbox_newclick(t_gobj *z, struct _glist *glist, int xpix, int ypix, int shift, int alt, int dbl, int doit) { t_my_numbox* x = (t_my_numbox *)z; - if(doit) { //printf("newclick doit\n"); my_numbox_click( x, (t_floatarg)xpix, (t_floatarg)ypix, (t_floatarg)shift, 0, (t_floatarg)alt); if(shift) + { x->x_gui.x_finemoved = 1; + } else x->x_gui.x_finemoved = 0; if(!x->x_gui.x_change) { - //printf(" change=0\n"); clock_delay(x->x_clock_wait, 50); - x->x_gui.x_change = 1; + my_numbox_set_change(x, 1); clock_delay(x->x_clock_reset, 3000); - x->x_buf[0] = 0; + if (shift) + my_numbox_ftoa(x, 1); + else + x->x_buf[0] = 0; + x->x_focused = 2; + sys_queuegui(x, x->x_gui.x_glist, my_numbox_draw_update); } else { - //printf(" change=1\n"); - x->x_gui.x_change = 0; + my_numbox_set_change(x, 0); clock_unset(x->x_clock_reset); x->x_buf[0] = 0; x->x_gui.x_changed = 1; sys_queuegui(x, x->x_gui.x_glist, my_numbox_draw_update); } } + else + { + //x->x_focused = 1; + } return (1); } @@ -624,13 +694,13 @@ static void my_numbox_log_height(t_my_numbox *x, t_floatarg lh) x->x_k = 1.0; } -static void my_numbox_hide_frame(t_my_numbox *x, t_floatarg lh) +static void my_numbox_drawstyle(t_my_numbox *x, t_floatarg lh) { if(lh < 0.0) lh = 0.0; if (lh > 3.0) lh = 3.0; - x->x_hide_frame = (int)lh; + x->x_drawstyle = (int)lh; my_numbox_draw(x, x->x_gui.x_glist, 4); my_numbox_draw(x, x->x_gui.x_glist, 2); } @@ -700,15 +770,31 @@ static void my_numbox_loadbang(t_my_numbox *x, t_floatarg action) static void my_numbox_key(void *z, t_floatarg fkey) { t_my_numbox *x = z; + if (fkey != 0) + x->x_focused = 1; + + // this is used for arrow up and down + if (fkey == -1) + { + clock_unset(x->x_clock_reset); + x->x_gui.x_changed = 1; + sys_queuegui(x, x->x_gui.x_glist, my_numbox_draw_update); + clock_delay(x->x_clock_reset, 3000); + return; + } + char c=fkey; char buf[3]; buf[1] = 0; + // this is what is triggered when one clicks outside the numbox + // and therefore loses focus if (c == 0) { - x->x_gui.x_change = 0; + my_numbox_set_change(x, 0); clock_unset(x->x_clock_reset); x->x_gui.x_changed = 1; + clock_delay(x->x_clock_reset, 0); sys_queuegui(x, x->x_gui.x_glist, my_numbox_draw_update); return; } @@ -725,7 +811,11 @@ static void my_numbox_key(void *z, t_floatarg fkey) } else if((c=='\b')||(c==127)) { - int sl=strlen(x->x_buf)-1; + int sl; + if (x->x_gui.x_finemoved) + sl = 0; + else + sl=strlen(x->x_buf)-1; if(sl < 0) sl = 0; @@ -736,36 +826,107 @@ static void my_numbox_key(void *z, t_floatarg fkey) else if((c=='\n')||(c==13)) { x->x_val = atof(x->x_buf); - x->x_buf[0] = 0; - x->x_gui.x_change = 0; + //x->x_buf[0] = 0; + my_numbox_set_change(x, 1); clock_unset(x->x_clock_reset); my_numbox_clip(x); my_numbox_bang(x); x->x_gui.x_changed = 1; + x->x_focused = 2; sys_queuegui(x, x->x_gui.x_glist, my_numbox_draw_update); } - clock_delay(x->x_clock_reset, 3000); + + if(c==27) + { + clock_unset(x->x_clock_reset); + my_numbox_tick_reset(x); + } + else + clock_delay(x->x_clock_reset, 3000); } static void my_numbox_list(t_my_numbox *x, t_symbol *s, int ac, t_atom *av) { - if (IS_A_FLOAT(av,0)) + int i; + int isKey = 0; + t_floatarg val; + + for (i=0; i < ac; i++) + { + if (!IS_A_FLOAT(av,i)) + { + isKey = 1; + break; + } + } + if (!isKey) { my_numbox_set(x, atom_getfloatarg(0, ac, av)); my_numbox_bang(x); } + else if (ac == 2 && x->x_gui.x_change == 1 && IS_A_FLOAT(av,0) && IS_A_SYMBOL(av,1)) + { + //fprintf(stderr,"got keyname %s while grabbed\n", av[1].a_w.w_symbol->s_name); + if (!strcmp("Shift", av[1].a_w.w_symbol->s_name)) + { + x->x_gui.x_finemoved = (int)av[0].a_w.w_float; + //post("...Shift %d", x->a_shift); + } + if (av[0].a_w.w_float == 1) + { + if (!strcmp("Up", av[1].a_w.w_symbol->s_name)) + { + //fprintf(stderr,"...Up\n"); + if((x->x_buf[0] == 0 || x->x_buf == '>') && x->x_val != 0) + sprintf(x->x_buf, "%g", x->x_val+1); + else + sprintf(x->x_buf, "%g", atof(x->x_buf) + 1); + my_numbox_key((void *)x, -1); + } + else if (!strcmp("ShiftUp", av[1].a_w.w_symbol->s_name)) + { + //fprintf(stderr,"...ShiftUp\n"); + if((x->x_buf[0] == 0 || x->x_buf == '>') && x->x_val != 0) + sprintf(x->x_buf, "%g", x->x_val+0.01); + else + sprintf(x->x_buf, "%g", atof(x->x_buf) + 0.01); + my_numbox_key((void *)x, -1); + } + else if (!strcmp("Down", av[1].a_w.w_symbol->s_name)) + { + //fprintf(stderr,"...Down\n"); + if((x->x_buf[0] == 0 || x->x_buf == '>') && x->x_val != 0) + sprintf(x->x_buf, "%g", x->x_val-1); + else + sprintf(x->x_buf, "%g", atof(x->x_buf) - 1); + my_numbox_key((void *)x, -1); + } + else if (!strcmp("ShiftDown", av[1].a_w.w_symbol->s_name)) + { + //fprintf(stderr,"...ShiftDown\n"); + if((x->x_buf[0] == 0 || x->x_buf == '>') && x->x_val != 0) + sprintf(x->x_buf, "%g", x->x_val-0.01); + else + sprintf(x->x_buf, "%g", atof(x->x_buf) - 0.01); + my_numbox_key((void *)x, -1); + } + } + } } static void *my_numbox_new(t_symbol *s, int argc, t_atom *argv) { t_my_numbox *x = (t_my_numbox *)pd_new(my_numbox_class); - int bflcol[]={-262144, -1, -1}; int w=5, h=14; int lilo=0, ldx=0, ldy=-8; int fs=10; int log_height=256; double min=-1.0e+37, max=1.0e+37,v=0.0; + x->x_gui.x_bcol = 0xFCFCFC; + x->x_gui.x_fcol = 0x00; + x->x_gui.x_lcol = 0x00; + if((argc >= 17)&&IS_A_FLOAT(argv,0)&&IS_A_FLOAT(argv,1) &&IS_A_FLOAT(argv,2)&&IS_A_FLOAT(argv,3) &&IS_A_FLOAT(argv,4)&&IS_A_FLOAT(argv,5) @@ -773,8 +934,7 @@ static void *my_numbox_new(t_symbol *s, int argc, t_atom *argv) &&(IS_A_SYMBOL(argv,7)||IS_A_FLOAT(argv,7)) &&(IS_A_SYMBOL(argv,8)||IS_A_FLOAT(argv,8)) &&IS_A_FLOAT(argv,9)&&IS_A_FLOAT(argv,10) - &&IS_A_FLOAT(argv,11)&&IS_A_FLOAT(argv,12)&&IS_A_FLOAT(argv,13) - &&IS_A_FLOAT(argv,14)&&IS_A_FLOAT(argv,15)&&IS_A_FLOAT(argv,16)) + &&IS_A_FLOAT(argv,11)&&IS_A_FLOAT(argv,12)&&IS_A_FLOAT(argv,16)) { w = maxi(atom_getintarg(0, argc, argv),1); h = maxi(atom_getintarg(1, argc, argv),8); @@ -787,17 +947,15 @@ static void *my_numbox_new(t_symbol *s, int argc, t_atom *argv) ldy = atom_getintarg(10, argc, argv); iem_inttofstyle(&x->x_gui, atom_getintarg(11, argc, argv)); fs = maxi(atom_getintarg(12, argc, argv),4); - bflcol[0] = atom_getintarg(13, argc, argv); - bflcol[1] = atom_getintarg(14, argc, argv); - bflcol[2] = atom_getintarg(15, argc, argv); + iemgui_all_loadcolors(&x->x_gui, argv+13, argv+14, argv+15); v = atom_getfloatarg(16, argc, argv); } else iemgui_new_getnames(&x->x_gui, 6, 0); if((argc == 18)&&IS_A_FLOAT(argv,17)) log_height = maxi(atom_getintarg(17, argc, argv),10); - x->x_hide_frame = 0; // default behavior + x->x_drawstyle = 0; // default behavior if((argc == 19)&&IS_A_FLOAT(argv,18)) - x->x_hide_frame = (int)atom_getintarg(18, argc, argv); + x->x_drawstyle = (int)atom_getintarg(18, argc, argv); x->x_gui.x_draw = (t_iemfunptr)my_numbox_draw; x->x_gui.x_glist = (t_glist *)canvas_getcurrent(); x->x_val = x->x_gui.x_loadinit ? v : 0.0; @@ -812,9 +970,11 @@ static void *my_numbox_new(t_symbol *s, int argc, t_atom *argv) x->x_gui.x_w = w; x->x_gui.x_h = h; x->x_buf[0] = 0; + // default font size that will then automatically adjust + // based on width and height + x->x_num_fontsize = maxi(x->x_gui.x_h * 0.9, IEM_FONT_MINSIZE); x->x_numwidth = my_numbox_calc_fontwidth(x); my_numbox_check_minmax(x, min, max); - iemgui_all_colfromload(&x->x_gui, bflcol); iemgui_verify_snd_ne_rcv(&x->x_gui); x->x_clock_reset = clock_new(x, (t_method)my_numbox_tick_reset); x->x_clock_wait = clock_new(x, (t_method)my_numbox_tick_wait); @@ -826,12 +986,16 @@ static void *my_numbox_new(t_symbol *s, int argc, t_atom *argv) x->x_scalewidth = 0; x->x_scaleheight = 0; x->x_tmpfontsize = 0; + x->x_gui.x_obj.te_iemgui = 1; x->x_gui.x_changed = 0; x->x_gui.legacy_x = 0; x->x_gui.legacy_y = 1; + x->x_focused = 0; + x->x_yresize_x = 0; + return (x); } @@ -839,6 +1003,7 @@ static void my_numbox_free(t_my_numbox *x) { if(iemgui_has_rcv(&x->x_gui)) pd_unbind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv); + my_numbox_set_change(x, 0); clock_free(x->x_clock_reset); clock_free(x->x_clock_wait); gfxstub_deleteforkey(x); @@ -879,8 +1044,10 @@ void g_numbox_setup(void) gensym("init"), A_FLOAT, 0); class_addmethod(my_numbox_class, (t_method)my_numbox_log_height, gensym("log_height"), A_FLOAT, 0); - class_addmethod(my_numbox_class, (t_method)my_numbox_hide_frame, - gensym("hide_frame"), A_FLOAT, 0); + class_addmethod(my_numbox_class, (t_method)my_numbox_drawstyle, + gensym("drawstyle"), A_FLOAT, 0); + + numbox_keyname_sym_a = gensym("#keyname_a"); wb_init(&my_numbox_widgetbehavior,my_numbox_getrect,my_numbox_newclick); class_setwidget(my_numbox_class, &my_numbox_widgetbehavior); diff --git a/pd/src/g_radio.c b/pd/src/g_radio.c index eaf924e87b4e7ef64de1b24d68a0ab7c2882e931..6ff63f9cdb5ecbc166a0b6594ce2201b978de2b0 100644 --- a/pd/src/g_radio.c +++ b/pd/src/g_radio.c @@ -115,7 +115,7 @@ void radio_draw_config(t_radio *x, t_glist *glist) iemgui_base_draw_config(&x->x_gui); for (i=0; i<n; i++) { - //sys_vgui(".x%lx.c itemconfigure %lxBUT%d -fill #%6.6x -stroke #%6.6x\n", + //sys_vgui(".x%zx.c itemconfigure %zxBUT%d -fill #%6.6x -stroke #%6.6x\n", // canvas, x, i, // (x->x_on==i) ? x->x_gui.x_fcol : x->x_gui.x_bcol, // (x->x_on==i) ? x->x_gui.x_fcol : x->x_gui.x_bcol); @@ -203,7 +203,7 @@ static void radio_getrect(t_gobj *z, t_glist *glist, int *xp1, int *yp1, static void radio_save(t_gobj *z, t_binbuf *b) { t_radio *x = (t_radio *)z; - int bflcol[3]; + t_symbol *bflcol[3]; t_symbol *srl[3]; t_class *c = pd_class((t_pd *)x); t_symbol *cname = @@ -212,7 +212,7 @@ static void radio_save(t_gobj *z, t_binbuf *b) x->x_orient ? gensym("vradio") : gensym("hradio"); iemgui_save(&x->x_gui, srl, bflcol); - binbuf_addv(b, "ssiisiiiisssiiiiiiii", gensym("#X"),gensym("obj"), + binbuf_addv(b, "ssiisiiiisssiiiisssi", gensym("#X"),gensym("obj"), (int)x->x_gui.x_obj.te_xpix, (int)x->x_gui.x_obj.te_ypix, cname, x->x_gui.x_w, x->x_change, iem_symargstoint(&x->x_gui), x->x_number, @@ -458,19 +458,21 @@ static void *radio_new(t_symbol *s, int argc, t_atom *argv) s==gensym("vdl") ? vradio_old_class : s==gensym("vradio") ? vradio_class : hradio_class); x->x_orient = s==gensym("vdl") || s==gensym("vradio"); - int bflcol[]={-262144, -1, -1}; int a=IEM_GUI_DEFAULTSIZE, on=0, ldx=0, ldy=-8, chg=1, num=8, fs=10; iem_inttosymargs(&x->x_gui, 0); iem_inttofstyle(&x->x_gui, 0); + x->x_gui.x_bcol = 0xFCFCFC; + x->x_gui.x_fcol = 0x00; + x->x_gui.x_lcol = 0x00; + if((argc == 15)&&IS_A_FLOAT(argv,0)&&IS_A_FLOAT(argv,1)&&IS_A_FLOAT(argv,2) &&IS_A_FLOAT(argv,3) &&(IS_A_SYMBOL(argv,4)||IS_A_FLOAT(argv,4)) &&(IS_A_SYMBOL(argv,5)||IS_A_FLOAT(argv,5)) &&(IS_A_SYMBOL(argv,6)||IS_A_FLOAT(argv,6)) &&IS_A_FLOAT(argv,7)&&IS_A_FLOAT(argv,8) - &&IS_A_FLOAT(argv,9)&&IS_A_FLOAT(argv,10)&&IS_A_FLOAT(argv,11) - &&IS_A_FLOAT(argv,12)&&IS_A_FLOAT(argv,13)&&IS_A_FLOAT(argv,14)) + &&IS_A_FLOAT(argv,9)&&IS_A_FLOAT(argv,10)&&IS_A_FLOAT(argv,14)) { a = atom_getintarg(0, argc, argv); chg = atom_getintarg(1, argc, argv); @@ -481,9 +483,7 @@ static void *radio_new(t_symbol *s, int argc, t_atom *argv) ldy = atom_getintarg(8, argc, argv); iem_inttofstyle(&x->x_gui, atom_getintarg(9, argc, argv)); fs = maxi(atom_getintarg(10, argc, argv),4); - bflcol[0] = atom_getintarg(11, argc, argv); - bflcol[1] = atom_getintarg(12, argc, argv); - bflcol[2] = atom_getintarg(13, argc, argv); + iemgui_all_loadcolors(&x->x_gui, argv+11, argv+12, argv+13); on = mini(maxi(atom_getintarg(14, argc, argv),0),num-1); } else iemgui_new_getnames(&x->x_gui, 4, 0); @@ -502,7 +502,6 @@ static void *radio_new(t_symbol *s, int argc, t_atom *argv) x->x_gui.x_w = iemgui_clip_size(a); x->x_gui.x_h = x->x_gui.x_w; iemgui_verify_snd_ne_rcv(&x->x_gui); - iemgui_all_colfromload(&x->x_gui, bflcol); outlet_new(&x->x_gui.x_obj, &s_list); x->x_gui.x_handle = scalehandle_new((t_object *)x,x->x_gui.x_glist,1,radio__clickhook,radio__motionhook); diff --git a/pd/src/g_readwrite.c b/pd/src/g_readwrite.c index a3affb88f8ac10b4cd97e6e523a18e420c7387e3..007dcc0ee3f156ce1a686233496b4a1154912ac8 100644 --- a/pd/src/g_readwrite.c +++ b/pd/src/g_readwrite.c @@ -17,7 +17,93 @@ file format as in the dialog window for data. #include "g_canvas.h" #include <string.h> +/* object to assist in saving state by abstractions */ +static t_class *savestate_class; + +typedef struct _savestate +{ + t_object x_obj; + t_outlet *x_stateout; + t_outlet *x_bangout; + t_binbuf *x_savetobuf; +} t_savestate; + +static void *savestate_new(void) +{ + t_savestate *x = (t_savestate *)pd_new(savestate_class); + x->x_stateout = outlet_new(&x->x_obj, &s_list); + x->x_bangout = outlet_new(&x->x_obj, &s_bang); + x->x_savetobuf = 0; + return (x); +} + + /* call this when the owning abstraction's parent patch is saved so we + * can add state-restoring messages to binbuf */ +static void savestate_doit(t_savestate *x, t_binbuf *b) +{ + x->x_savetobuf = b; + outlet_bang(x->x_bangout); + x->x_savetobuf = 0; +} + + /* called by abstraction in response to savestate_doit(); lists received + here are added to the parent patch's save buffer after the line that will + create the abstraction, addressed to "#A" which will be this patch after + it is recreated by reopening the parent patch, pasting, or "undo". */ +static void savestate_list(t_savestate *x, t_symbol *s, int argc, t_atom *argv) +{ + if (x->x_savetobuf) + { + binbuf_addv(x->x_savetobuf, "ss", gensym("#A"), gensym("saved")); + binbuf_add(x->x_savetobuf, argc, argv); + binbuf_addv(x->x_savetobuf, ";"); + } + else pd_error(x, "savestate: ignoring message sent when not saving parent"); +} + +static void savestate_setup(void) +{ + savestate_class = class_new(gensym("savestate"), + (t_newmethod)savestate_new, 0, sizeof(t_savestate), 0, 0); + class_addlist(savestate_class, savestate_list); +} + +void canvas_statesavers_doit(t_glist *x, t_binbuf *b) +{ + t_gobj *g; + for (g = x->gl_list; g; g = g->g_next) + { + if (g->g_pd == savestate_class) + { + savestate_doit((t_savestate *)g, b); + } + else if (g->g_pd == canvas_class && + !canvas_isabstraction((t_canvas *)g)) + { + canvas_statesavers_doit((t_glist *)g, b); + } + } +} + +void canvas_saved(t_glist *x, t_symbol *s, int argc, t_atom *argv) +{ + t_gobj *g; + for (g = x->gl_list; g; g = g->g_next) + { + if (g->g_pd == savestate_class) + { + outlet_list(((t_savestate *)g)->x_stateout, 0, argc, argv); + } + else if (g->g_pd == canvas_class && + !canvas_isabstraction((t_canvas *)g)) + { + canvas_saved((t_glist *)g, s, argc, argv); + } + } +} + void canvas_savedeclarationsto(t_canvas *x, t_binbuf *b); +void canvas_saveabdefinitionsto(t_canvas *x, t_binbuf *b); /* the following routines read "scalars" from a file into a canvas. */ @@ -745,6 +831,9 @@ static void canvas_saveto(t_canvas *x, t_binbuf *b) } canvas_savedeclarationsto(x, b); } + + canvas_saveabdefinitionsto(x, b); + for (y = x->gl_list; y; y = y->g_next) gobj_save(y, b); @@ -891,26 +980,55 @@ static void canvas_savetofile(t_canvas *x, t_symbol *filename, t_symbol *dir, binbuf_free(b); } +void canvas_reload_ab(t_canvas *x); + +/* updates the shared ab definition and reloads all instances */ +static void canvas_save_ab(t_canvas *x, t_floatarg fdestroy) +{ + if(!x->gl_absource) bug("canvas_save_ab"); + + t_binbuf *b = binbuf_new(); + canvas_savetemplatesto(x, b, 1); + canvas_saveto(x, b); + + binbuf_free(x->gl_absource->ad_source); + x->gl_absource->ad_source = b; + + canvas_dirty(x, 0); + canvas_reload_ab(x); + + if (fdestroy != 0) //necessary? + vmess(&x->gl_pd, gensym("menuclose"), "f", 1.); +} + static void canvas_menusaveas(t_canvas *x, t_floatarg fdestroy) { t_canvas *x2 = canvas_getrootfor(x); - gui_vmess("gui_canvas_saveas", "xssi", - x2, - (strncmp(x2->gl_name->s_name, "Untitled", 8) ? - x2->gl_name->s_name : "title"), - canvas_getdir(x2)->s_name, - fdestroy != 0); + if(!x->gl_isab) + gui_vmess("gui_canvas_saveas", "xssi", + x2, + (strncmp(x2->gl_name->s_name, "Untitled", 8) ? + x2->gl_name->s_name : "title"), + canvas_getdir(x2)->s_name, + fdestroy != 0); + else if(x->gl_dirty) + canvas_save_ab(x2, fdestroy); } static void canvas_menusave(t_canvas *x, t_floatarg fdestroy) { t_canvas *x2 = canvas_getrootfor(x); char *name = x2->gl_name->s_name; - if (*name && strncmp(name, "Untitled", 8) - && (strlen(name) < 4 || strcmp(name + strlen(name)-4, ".pat") - || strcmp(name + strlen(name)-4, ".mxt"))) - canvas_savetofile(x2, x2->gl_name, canvas_getdir(x2), fdestroy); - else canvas_menusaveas(x2, fdestroy); + if(!x->gl_isab) + { + if (*name && strncmp(name, "Untitled", 8) + && (strlen(name) < 4 || strcmp(name + strlen(name)-4, ".pat") + || strcmp(name + strlen(name)-4, ".mxt"))) + canvas_savetofile(x2, x2->gl_name, canvas_getdir(x2), fdestroy); + else canvas_menusaveas(x2, fdestroy); + } + else if(x->gl_dirty) + canvas_save_ab(x2, fdestroy); } static void canvas_menuprint(t_canvas *x) @@ -921,6 +1039,7 @@ static void canvas_menuprint(t_canvas *x) void g_readwrite_setup(void) { + savestate_setup(); class_addmethod(canvas_class, (t_method)glist_write, gensym("write"), A_SYMBOL, A_DEFSYM, A_NULL); class_addmethod(canvas_class, (t_method)glist_read, @@ -931,6 +1050,8 @@ void g_readwrite_setup(void) gensym("savetofile"), A_SYMBOL, A_SYMBOL, A_DEFFLOAT, 0); class_addmethod(canvas_class, (t_method)canvas_saveto, gensym("saveto"), A_CANT, 0); + class_addmethod(canvas_class, (t_method)canvas_saved, + gensym("saved"), A_GIMME, 0); /* ------------------ from the menu ------------------------- */ class_addmethod(canvas_class, (t_method)canvas_menusave, gensym("menusave"), A_DEFFLOAT, 0); diff --git a/pd/src/g_rtext.c b/pd/src/g_rtext.c index b82f34701c7dc14e0206fdb1a7f91b4af8ce0f86..0d7e4ba2b9810610f2ec436f7d587aa701962439 100644 --- a/pd/src/g_rtext.c +++ b/pd/src/g_rtext.c @@ -65,7 +65,7 @@ t_rtext *rtext_new(t_glist *glist, t_text *who) // supposed to be there (they don't belong to that canvas). See // in pd.tk pdtk_select_all_gop_widgets function and how it affects // draw data structures that are displayed via gop (Ico 20140831) - sprintf(x->x_tag, ".x%lx.t%lx", (t_int)glist_getcanvas(x->x_glist), + sprintf(x->x_tag, ".x%zx.t%zx", (t_uint)glist_getcanvas(x->x_glist), (t_int)x); return (x); } @@ -361,7 +361,7 @@ static void rtext_senditup(t_rtext *x, int action, int *widthp, int *heightp, } if (action == SEND_FIRST) { - //fprintf(stderr,"send_first rtext=%lx t_text=%lx\n", x, x->x_text); + //fprintf(stderr,"send_first rtext=%zx t_text=%zx\n", x, x->x_text); gui_vmess("gui_text_new", "xssiiisi", canvas, x->x_tag, rtext_gettype(x)->s_name, glist_isselected(x->x_glist, ((t_gobj*)x->x_text)), @@ -394,19 +394,19 @@ static void rtext_senditup(t_rtext *x, int action, int *widthp, int *heightp, { if (selend_b > selstart_b) { - //sys_vgui(".x%lx.c select from %s %d\n", canvas, + //sys_vgui(".x%zx.c select from %s %d\n", canvas, // x->x_tag, u8_charnum(tempbuf, selstart_b)); - //sys_vgui(".x%lx.c select to %s %d\n", canvas, + //sys_vgui(".x%zx.c select to %s %d\n", canvas, // x->x_tag, u8_charnum(tempbuf, selend_b) // + (sys_oldtclversion ? 0 : -1)); - //sys_vgui(".x%lx.c focus \"\"\n", canvas); + //sys_vgui(".x%zx.c focus \"\"\n", canvas); } else { - //sys_vgui(".x%lx.c select clear\n", canvas); - //sys_vgui(".x%lx.c icursor %s %d\n", canvas, x->x_tag, + //sys_vgui(".x%zx.c select clear\n", canvas); + //sys_vgui(".x%zx.c icursor %s %d\n", canvas, x->x_tag, // u8_charnum(tempbuf, selstart_b)); - //sys_vgui(".x%lx.c focus %s\n", canvas, x->x_tag); + //sys_vgui(".x%zx.c focus %s\n", canvas, x->x_tag); } } } @@ -524,13 +524,13 @@ void rtext_draw(t_rtext *x) void rtext_erase(t_rtext *x) { //if (x && x->x_glist) - // sys_vgui(".x%lx.c delete %s\n", glist_getcanvas(x->x_glist), x->x_tag); + // sys_vgui(".x%zx.c delete %s\n", glist_getcanvas(x->x_glist), x->x_tag); } -/* Not needed since the rtext gets erased along with the parent gobj group */ +/* Not needed since the rtext gets displaced along with the parent gobj group */ void rtext_displace(t_rtext *x, int dx, int dy) { - //sys_vgui(".x%lx.c move %s %d %d\n", glist_getcanvas(x->x_glist), + //sys_vgui(".x%zx.c move %s %d %d\n", glist_getcanvas(x->x_glist), // x->x_tag, dx, dy); } @@ -541,15 +541,15 @@ void rtext_select(t_rtext *x, int state) //t_glist *glist = x->x_glist; //t_canvas *canvas = glist_getcanvas(glist); //if (glist_istoplevel(glist)) - // sys_vgui(".x%lx.c itemconfigure %s -fill %s\n", canvas, + // sys_vgui(".x%zx.c itemconfigure %s -fill %s\n", canvas, // x->x_tag, (state? "$pd_colors(selection)" : "$pd_colors(text)")); //if (x->x_text->te_pd->c_wb && x->x_text->te_pd->c_wb->w_displacefnwtag) //{ // if (state) - // sys_vgui(".x%lx.c addtag selected withtag %s\n", + // sys_vgui(".x%zx.c addtag selected withtag %s\n", // glist_getcanvas(glist), x->x_tag); // else - // sys_vgui(".x%lx.c dtag %s selected\n", + // sys_vgui(".x%zx.c dtag %s selected\n", // glist_getcanvas(glist), x->x_tag); //} /* Not sure the following is needed anymore either-- commenting it @@ -560,18 +560,22 @@ void rtext_select(t_rtext *x, int state) void rtext_activate(t_rtext *x, int state) { //fprintf(stderr,"rtext_activate state=%d\n", state); - int w = 0, h = 0, widthspec, heightspec, indx, isgop; + int w = 0, h = 0, widthspec, heightspec, indx, isgop, + selstart = -1, selend = -1; char *tmpbuf; t_glist *glist = x->x_glist; t_canvas *canvas = glist_getcanvas(glist); - //if (state && x->x_active) printf("duplicate rtext_activate\n"); + if (state && x->x_active) { + //fprintf(stderr, "duplicate rtext_activate\n"); + return; + } // the following prevents from selecting all when inside an // object that is already being texted for... please *test* // "fixes" before committing them //if (state == x->x_active) return; // avoid excess calls if (state) { - //sys_vgui(".x%lx.c focus %s\n", canvas, x->x_tag); + //sys_vgui(".x%zx.c focus %s\n", canvas, x->x_tag); glist->gl_editor->e_textedfor = x; glist->gl_editor->e_textdirty = 0; x->x_selstart = 0; @@ -580,12 +584,16 @@ void rtext_activate(t_rtext *x, int state) } else { - //sys_vgui("selection clear .x%lx.c\n", canvas); - //sys_vgui(".x%lx.c focus \"\"\n", canvas); + //sys_vgui("selection clear .x%zx.c\n", canvas); + //sys_vgui(".x%zx.c focus \"\"\n", canvas); if (glist->gl_editor->e_textedfor == x) glist->gl_editor->e_textedfor = 0; x->x_active = 0; } + + /* check if it has a window */ + if(!glist->gl_havewindow) return; + rtext_senditup(x, SEND_UPDATE, &w, &h, &indx); /* hack... state = 0 no editing @@ -607,11 +615,23 @@ void rtext_activate(t_rtext *x, int state) } else { - widthspec = x->x_text->te_width; // width if any specified + int xmin, xmax, tmp; + gobj_getrect(&x->x_text->te_g, x->x_glist, &xmin, &tmp, &xmax, &tmp); + /* width if specified. If not, we send the bounding width as + a negative number */ + widthspec = (x->x_text->te_width ? x->x_text->te_width : -(xmax-xmin)); + /* signal with negative number that we don't have a heightspec */ heightspec = -1; // signal that we don't have a heightspec isgop = 0; } + if(state & (0b1 << 31)) /* arbitray selection */ + { + selstart = (state >> 16) & 0x7FFF; + selend = state & 0xFFFF; + state = 1; // set to editing state + } + /* we need to get scroll to make sure we've got the correct bbox for the svg */ canvas_getscroll(glist_getcanvas(canvas)); @@ -619,10 +639,10 @@ void rtext_activate(t_rtext *x, int state) null terminated. If this becomes a problem we can revisit it later */ tmpbuf = t_getbytes(x->x_bufsize + 1); - sprintf(tmpbuf, "%.*s", x->x_bufsize, x->x_buf); + sprintf(tmpbuf, "%.*s", (int)x->x_bufsize, x->x_buf); /* in case x_bufsize is 0... */ tmpbuf[x->x_bufsize] = '\0'; - gui_vmess("gui_textarea", "xssiiiisiii", + gui_vmess("gui_textarea", "xssiiiisiiiiiii", canvas, x->x_tag, (pd_class((t_pd *)x->x_text) == message_class ? "msg" : "obj"), @@ -632,8 +652,13 @@ void rtext_activate(t_rtext *x, int state) heightspec, tmpbuf, sys_hostfontsize(glist_getfont(glist)), + sys_fontwidth(glist_getfont(glist)), + sys_fontheight(glist_getfont(glist)), isgop, - state); + state, + selstart, + selend + ); freebytes(tmpbuf, x->x_bufsize + 1); } diff --git a/pd/src/g_scalar.c b/pd/src/g_scalar.c index 73c944ab5a00d108a6f3739ca979c0c4023a4c5a..703e3aa915a76421069ce57d00ec9b7acceaa155 100644 --- a/pd/src/g_scalar.c +++ b/pd/src/g_scalar.c @@ -104,7 +104,7 @@ void word_init(t_word *data, t_template *template, t_gpointer *gp) canvas_resume_dsp(dspstate); s__X.s_thing = boundx; - post("eval'd a canvas with addy x%lx", (long unsigned int) + post("eval'd a canvas with addy x%zx", (t_uint) wp->w_list); } else if (type == DT_TEXT) @@ -148,7 +148,7 @@ void word_restore(t_word *wp, t_template *template, argv++, argc--; } else f = 0; - wp->w_float = f; + wp->w_float = f; } else if (type == DT_SYMBOL) { @@ -547,7 +547,7 @@ static void scalar_getrect(t_gobj *z, t_glist *owner, void scalar_drawselectrect(t_scalar *x, t_glist *glist, int state) { char tagbuf[MAXPDSTRING]; - sprintf(tagbuf, "scalar%lx", (long unsigned int)x->sc_vec); + sprintf(tagbuf, "scalar%zx", (t_uint)x->sc_vec); //fprintf(stderr,"scalar_drawselecterect%d\n", state); if (state) @@ -611,7 +611,7 @@ void scalar_select(t_gobj *z, t_glist *owner, int state) t_scalar *x = (t_scalar *)z; char tagbuf[MAXPDSTRING]; - sprintf(tagbuf, "scalar%lx", (long unsigned int)x->sc_vec); + sprintf(tagbuf, "scalar%zx", (t_uint)x->sc_vec); t_template *tmpl; t_symbol *templatesym = x->sc_template; @@ -642,7 +642,7 @@ void scalar_select(t_gobj *z, t_glist *owner, int state) gui_vmess("gui_gobj_deselect", "xs", glist_getcanvas(owner), tagbuf); } - //sys_vgui("pdtk_select_all_gop_widgets .x%lx %lx %d\n", + //sys_vgui("pdtk_select_all_gop_widgets .x%zx %zx %d\n", // glist_getcanvas(owner), owner, state); scalar_drawselectrect(x, owner, state); } @@ -699,7 +699,7 @@ static void scalar_displace(t_gobj *z, t_glist *glist, int dx, int dy) */ static void scalar_displace_withtag(t_gobj *z, t_glist *glist, int dx, int dy) { - //fprintf(stderr,"scalar_displace_withtag %lx %d %d\n", (t_int)z, dx, dy); + //fprintf(stderr,"scalar_displace_withtag %zx %d %d\n", (t_uint)z, dx, dy); t_scalar *x = (t_scalar *)z; t_symbol *templatesym = x->sc_template; t_template *template = template_findbyname(templatesym); @@ -789,12 +789,12 @@ static void scalar_group_configure(t_scalar *x, t_glist *owner, { t_gobj *y; char tagbuf[MAXPDSTRING]; - sprintf(tagbuf, "dgroup%lx.%lx", (long unsigned int)gl, - (long unsigned int)data); + sprintf(tagbuf, "dgroup%zx.%zx", (t_uint)gl, + (t_int)data); char parentbuf[MAXPDSTRING]; - sprintf(parentbuf, "dgroup%lx.%lx", - (long unsigned int)parent, - (long unsigned int)data); + sprintf(parentbuf, "dgroup%zx.%zx", + (t_int)parent, + (t_int)data); gui_start_vmess("gui_draw_configure_all", "xs", glist_getcanvas(owner), tagbuf); svg_grouptogui(gl, template, data); @@ -823,7 +823,7 @@ void scalar_doconfigure(t_gobj *xgobj, t_glist *owner) int vis = glist_isvisible(owner); if (vis) { - //fprintf(stderr,"scalar_vis %d %lx\n", vis, (t_int)z); + //fprintf(stderr,"scalar_vis %d %zx\n", vis, (t_uint)z); x->sc_bboxcache = 0; t_template *template = template_findbyname(x->sc_template); @@ -837,7 +837,7 @@ void scalar_doconfigure(t_gobj *xgobj, t_glist *owner) t_float yscale = glist_ytopixels(owner, 1) - glist_ytopixels(owner, 0); char tagbuf[MAXPDSTRING]; - sprintf(tagbuf, "scalar%lx", (long unsigned int)x->sc_vec); + sprintf(tagbuf, "scalar%zx", (t_uint)x->sc_vec); gui_vmess("gui_scalar_configure_gobj", "xsiffffii", glist_getcanvas(owner), tagbuf, @@ -930,11 +930,11 @@ static void scalar_groupvis(t_scalar *x, t_glist *owner, t_template *template, if (vis) { char tagbuf[MAXPDSTRING]; - sprintf(tagbuf, "dgroup%lx.%lx", (long unsigned int)gl, - (long unsigned int)x->sc_vec); + sprintf(tagbuf, "dgroup%zx.%zx", (t_uint)gl, + (t_int)x->sc_vec); char parentbuf[MAXPDSTRING]; - sprintf(parentbuf, "dgroup%lx.%lx", (long unsigned int)parent, - (long unsigned int)x->sc_vec); + sprintf(parentbuf, "dgroup%zx.%zx", (t_uint)parent, + (t_int)x->sc_vec); gui_start_vmess("gui_scalar_draw_group", "xsss", glist_getcanvas(owner), tagbuf, parentbuf, group_gettype(gl)->s_name); @@ -960,20 +960,20 @@ static void scalar_groupvis(t_scalar *x, t_glist *owner, t_template *template, /* At present, scalars have a three-level hierarchy in the gui, with two levels accessible by the user from within Pd: - scalar - ".scalar%lx", x->sc_vec + scalar - ".scalar%zx", x->sc_vec | <g> with matrix derived from x/y fields, | gop basexy, and gop scaling values. This group is | not configurable by the user. This means that the | a [draw g] below can ignore basexy and gop junk | when computing the transform matrix. v - dgroup - ".dgroup%lx.%lx", templatecanvas, x->sc_vec + dgroup - ".dgroup%zx.%zx", templatecanvas, x->sc_vec | group used as parent for all the toplevel drawing | commands of the scalar (i.e., the ones located on | the same canvas as the [struct]). Its matrix and | options aren't accessible by the user. v - (draw - ".draw%lx.%lx", (t_draw *ptr), x->sc_vec + (draw - ".draw%zx.%zx", (t_draw *ptr), x->sc_vec | the actual drawing command: rectangle, path, g, etc. or Each has its own matrix and options which can set dgroup with messages to the corresponding [draw] object. @@ -988,10 +988,10 @@ static void scalar_groupvis(t_scalar *x, t_glist *owner, t_template *template, */ static void scalar_vis(t_gobj *z, t_glist *owner, int vis) { - //fprintf(stderr,"scalar_vis %d %lx\n", vis, (t_int)z); + //fprintf(stderr,"scalar_vis %d %zx\n", vis, (t_uint)z); t_scalar *x = (t_scalar *)z; char buf[50]; - sprintf(buf, "x%lx", (long unsigned int)x); + sprintf(buf, "x%zx", (t_uint)x); x->sc_bboxcache = 0; @@ -1011,8 +1011,8 @@ static void scalar_vis(t_gobj *z, t_glist *owner, int vis) don't have a template. Pd Vanilla draws a single pixel to represent them, so later we might want to do a simple shape for them... */ - //sys_vgui(".x%lx.c create prect %d %d %d %d " - // "-tags {blankscalar%lx %s}\n", + //sys_vgui(".x%zx.c create prect %d %d %d %d " + // "-tags {blankscalar%zx %s}\n", // glist_getcanvas(owner), x1-1, y1-1, x1+1, y1+1, x, // (glist_isselected(owner, &x->sc_gobj) ? // "scalar_selected" : "")); @@ -1020,12 +1020,12 @@ static void scalar_vis(t_gobj *z, t_glist *owner, int vis) else { /* No need to delete if we don't draw anything... */ - //sys_vgui(".x%lx.c delete blankscalar%lx\n", + //sys_vgui(".x%zx.c delete blankscalar%zx\n", // glist_getcanvas(owner), x); } return; } - //else sys_vgui(".x%lx.c delete blankscalar%lx\n", + //else sys_vgui(".x%zx.c delete blankscalar%zx\n", // glist_getcanvas(owner), x); if (vis) @@ -1043,7 +1043,7 @@ static void scalar_vis(t_gobj *z, t_glist *owner, int vis) } t_float xscale = ((glist_xtopixels(owner, 1) - glist_xtopixels(owner, 0))); t_float yscale = glist_ytopixels(owner, 1) - glist_ytopixels(owner, 0); - /* we translate the .scalar%lx group to displace it on the tk side. + /* we translate the .scalar%zx group to displace it on the tk side. This is the outermost group for the scalar, something like a poor man's viewport. Also: @@ -1051,10 +1051,10 @@ static void scalar_vis(t_gobj *z, t_glist *owner, int vis) * default fill is supposed to be black. * stroke-linejoin should be "miter", not "round" To fix these, we set the correct fill/stroke/strokelinjoin options - here on the .scalar%lx group. (Notice also that tkpath doesn't + here on the .scalar%zx group. (Notice also that tkpath doesn't understand "None"-- instead we must send an empty symbol.) */ char tagbuf[MAXPDSTRING]; - sprintf(tagbuf, "scalar%lx", (long unsigned int)x->sc_vec); + sprintf(tagbuf, "scalar%zx", (t_uint)x->sc_vec); gui_vmess("gui_scalar_new", "xsiffffffii", glist_getcanvas(owner), tagbuf, @@ -1067,9 +1067,9 @@ static void scalar_vis(t_gobj *z, t_glist *owner, int vis) char groupbuf[MAXPDSTRING]; // Quick hack to make gui_scalar_draw_group more general (so we // don't have to tack on "gobj" manually) - sprintf(tagbuf, "scalar%lxgobj", (long unsigned int)x->sc_vec); - sprintf(groupbuf, "dgroup%lx.%lx", (long unsigned int)templatecanvas, - (long unsigned int)x->sc_vec); + sprintf(tagbuf, "scalar%zxgobj", (t_uint)x->sc_vec); + sprintf(groupbuf, "dgroup%zx.%zx", (t_uint)templatecanvas, + (t_int)x->sc_vec); gui_vmess("gui_scalar_draw_group", "xsss", glist_getcanvas(owner), groupbuf, tagbuf, "g"); pd_bind(&x->sc_gobj.g_pd, gensym(buf)); @@ -1097,7 +1097,7 @@ static void scalar_vis(t_gobj *z, t_glist *owner, int vis) if (!vis) { char tagbuf[MAXPDSTRING]; - sprintf(tagbuf, "scalar%lx", (long unsigned int)x->sc_vec); + sprintf(tagbuf, "scalar%zx", (t_uint)x->sc_vec); gui_vmess("gui_scalar_erase", "xs", glist_getcanvas(owner), tagbuf); if (gensym(buf)->s_thing) @@ -1126,7 +1126,7 @@ static void scalar_doredraw(t_gobj *client, t_glist *glist) //fprintf(stderr,"yes\n"); /* I still don't understand what this does... should probably do some scalar gop tests to see if it is actually needed... */ - //sys_vgui("pdtk_select_all_gop_widgets .x%lx %lx %d\n", + //sys_vgui("pdtk_select_all_gop_widgets .x%zx %zx %d\n", // glist_getcanvas(glist), glist, 1); } canvas_getscroll(glist_getcanvas(glist)); diff --git a/pd/src/g_slider.c b/pd/src/g_slider.c index 320a45a99320d997f135484076d29538380e6a34..5caeaad6b75a80641980628d642fde2777bfe4a1 100644 --- a/pd/src/g_slider.c +++ b/pd/src/g_slider.c @@ -47,7 +47,7 @@ static void slider_draw_update(t_gobj *client, t_glist *glist) /* the indicator thickens when it's right in the middle... but it's pretty obscure, undocumented, and looks a bit like a bug if you're not expecting it */ - //sys_vgui(".x%lx.c itemconfigure %lxKNOB -strokewidth %d\n", + //sys_vgui(".x%zx.c itemconfigure %zxKNOB -strokewidth %d\n", // canvas, x, 4*x->x_thick+3); } } @@ -189,10 +189,10 @@ static void slider_getrect(t_gobj *z, t_glist *glist, static void slider_save(t_gobj *z, t_binbuf *b) { t_slider *x = (t_slider *)z; - int bflcol[3]; + t_symbol *bflcol[3]; t_symbol *srl[3]; iemgui_save(&x->x_gui, srl, bflcol); - binbuf_addv(b, "ssiisiiffiisssiiiiiiiii", gensym("#X"),gensym("obj"), + binbuf_addv(b, "ssiisiiffiisssiiiisssii", gensym("#X"),gensym("obj"), (int)x->x_gui.x_obj.te_xpix, (int)x->x_gui.x_obj.te_ypix, gensym(x->x_orient ? "vsl" : "hsl"), x->x_gui.x_w, x->x_gui.x_h, (t_float)x->x_min, (t_float)x->x_max, @@ -392,7 +392,7 @@ static void slider_click(t_slider *x, t_floatarg xpos, t_floatarg ypos, x->x_is_last_float=0; // does anyone know how this works with !steady && rcv==snd ? slider_bang(x); glist_grab(x->x_gui.x_glist, &x->x_gui.x_obj.te_g, - (t_glistmotionfn)slider_motion, 0, xpos, ypos); + (t_glistmotionfn)slider_motion, 0, 0, xpos, ypos); } static int slider_newclick(t_gobj *z, struct _glist *glist, @@ -489,7 +489,7 @@ static void *slider_new(t_symbol *s, int argc, t_atom *argv) int orient = s==gensym("vsl") || s==gensym("vslider"); t_slider *x = (t_slider *)pd_new(orient ? vslider_class : hslider_class); x->x_orient = orient; - int bflcol[]={-262144, -1, -1}; +// int bflcol[]={-262144, -1, -1}; int lilo=0; int w,h,ldx,ldy,fs=10, v=0, steady=1; if (orient) { @@ -502,6 +502,11 @@ static void *slider_new(t_symbol *s, int argc, t_atom *argv) iem_inttosymargs(&x->x_gui, 0); iem_inttofstyle(&x->x_gui, 0); + x->x_gui.x_bcol = 0xFCFCFC; + x->x_gui.x_fcol = 0x00; + x->x_gui.x_lcol = 0x00; + + if(((argc == 17)||(argc == 18))&&IS_A_FLOAT(argv,0)&&IS_A_FLOAT(argv,1) &&IS_A_FLOAT(argv,2)&&IS_A_FLOAT(argv,3) &&IS_A_FLOAT(argv,4)&&IS_A_FLOAT(argv,5) @@ -509,8 +514,7 @@ static void *slider_new(t_symbol *s, int argc, t_atom *argv) &&(IS_A_SYMBOL(argv,7)||IS_A_FLOAT(argv,7)) &&(IS_A_SYMBOL(argv,8)||IS_A_FLOAT(argv,8)) &&IS_A_FLOAT(argv,9)&&IS_A_FLOAT(argv,10) - &&IS_A_FLOAT(argv,11)&&IS_A_FLOAT(argv,12)&&IS_A_FLOAT(argv,13) - &&IS_A_FLOAT(argv,14)&&IS_A_FLOAT(argv,15)&&IS_A_FLOAT(argv,16)) + &&IS_A_FLOAT(argv,11)&&IS_A_FLOAT(argv,12)&&IS_A_FLOAT(argv,16)) { w = atom_getintarg(0, argc, argv); h = atom_getintarg(1, argc, argv); @@ -523,9 +527,10 @@ static void *slider_new(t_symbol *s, int argc, t_atom *argv) ldy = atom_getintarg(10, argc, argv); iem_inttofstyle(&x->x_gui, atom_getintarg(11, argc, argv)); fs = maxi(atom_getintarg(12, argc, argv),4); - bflcol[0] = (int)atom_getintarg(13, argc, argv); - bflcol[1] = (int)atom_getintarg(14, argc, argv); - bflcol[2] = (int)atom_getintarg(15, argc, argv); +// bflcol[0] = (int)atom_getintarg(13, argc, argv); +// bflcol[1] = (int)atom_getintarg(14, argc, argv); +// bflcol[2] = (int)atom_getintarg(15, argc, argv); + iemgui_all_loadcolors(&x->x_gui, argv+13, argv+14, argv+15); v = atom_getintarg(16, argc, argv); } else iemgui_new_getnames(&x->x_gui, 6, 0); @@ -554,7 +559,7 @@ static void *slider_new(t_symbol *s, int argc, t_atom *argv) slider_check_length(x, w); } slider_check_minmax(x, min, max); - iemgui_all_colfromload(&x->x_gui, bflcol); +// iemgui_all_colfromload(&x->x_gui, bflcol); x->x_thick = 0; iemgui_verify_snd_ne_rcv(&x->x_gui); outlet_new(&x->x_gui.x_obj, &s_float); @@ -573,7 +578,6 @@ static void *slider_new(t_symbol *s, int argc, t_atom *argv) x->x_gui.legacy_y = 1; } - return (x); } diff --git a/pd/src/g_template.c b/pd/src/g_template.c index 4bdd67f3ca9558c2f9185fd44cb0671700958abf..a37957dfcce526db87f7c49a3d50ad927b248900 100644 --- a/pd/src/g_template.c +++ b/pd/src/g_template.c @@ -67,7 +67,7 @@ static int dataslot_matches(t_dataslot *ds1, t_dataslot *ds2, t_template *template_new(t_symbol *templatesym, int argc, t_atom *argv) { t_template *x = (t_template *)pd_new(template_class); - //fprintf(stderr,"template_new %lx\n", x); + //fprintf(stderr,"template_new %zx\n", x); x->t_n = 0; x->t_transformable = 0; x->t_vec = (t_dataslot *)t_getbytes(0); @@ -1460,7 +1460,7 @@ void *svg_new(t_pd *parent, t_symbol *s, int argc, t_atom *argv) // Here we bind the parent object to the addy for // the svg. This way both [group] and [draw] will have // the same binding symbol - sprintf(buf, "x%lx", (long unsigned int)x); + sprintf(buf, "x%zx", (t_uint)x); pd_bind(parent, gensym(buf)); return (x); @@ -1749,15 +1749,15 @@ void svg_sendupdate(t_svg *x, t_canvas *c, t_symbol *s, index = -1; if (x->x_type == gensym("g") || x->x_type == gensym("svg")) { - sprintf(tag, "dgroup%lx.%lx", - (long unsigned int)x->x_parent, - (long unsigned int)data); + sprintf(tag, "dgroup%zx.%zx", + (t_int)x->x_parent, + (t_int)data); } else { - sprintf(tag, "draw%lx.%lx", - (long unsigned int)x->x_parent, - (long unsigned int)data); + sprintf(tag, "draw%zx.%zx", + (t_int)x->x_parent, + (t_int)data); } if (s == gensym("bbox")) *predraw_bbox = 1; @@ -1929,8 +1929,8 @@ void svg_sendupdate(t_svg *x, t_canvas *c, t_symbol *s, else if (s == gensym("d")) { char tagbuf[MAXPDSTRING]; - sprintf(tagbuf, "draw%lx.%lx", - (long unsigned int)parent, (long unsigned int)data); + sprintf(tagbuf, "draw%zx.%zx", + (t_int)parent, (t_int)data); gui_start_vmess("gui_draw_configure", "xss", glist_getcanvas(c), tagbuf, "d"); /* let's turn off bbox caching so we can recalculate the bbox */ @@ -1998,8 +1998,8 @@ void svg_sendupdate(t_svg *x, t_canvas *c, t_symbol *s, else if (s == gensym("points")) { char tagbuf[MAXPDSTRING]; - sprintf(tagbuf, "draw%lx.%lx", - (long unsigned int)parent, (long unsigned int)data); + sprintf(tagbuf, "draw%zx.%zx", + (t_int)parent, (t_int)data); gui_start_vmess("gui_draw_coords", "xss", glist_getcanvas(c), tagbuf, x->x_type->s_name); gui_start_array(); @@ -2174,20 +2174,20 @@ void svg_register_events(t_gobj *z, t_canvas *c, t_scalar *sc, if (pd_class(&z->g_pd) == canvas_class) { svg = (t_svg *)((t_glist *)z)->gl_svg; - sprintf(tagbuf, "dgroup%lx.%lx", (long unsigned int)z, - (long unsigned int)data); + sprintf(tagbuf, "dgroup%zx.%zx", (t_uint)z, + (t_int)data); } else if (pd_class(&z->g_pd) == draw_class) { svg = (t_svg *)((t_draw *)z)->x_attr; - sprintf(tagbuf, "draw%lx.%lx", (long unsigned int)z, - (long unsigned int)data); + sprintf(tagbuf, "draw%zx.%zx", (t_uint)z, + (t_int)data); } else if (pd_class(&z->g_pd) == drawimage_class) { svg = (t_svg *)((t_drawimage *)z)->x_attr; - sprintf(tagbuf, "draw%lx.%lx", (long unsigned int)z, - (long unsigned int)data); + sprintf(tagbuf, "draw%zx.%zx", (t_uint)z, + (t_int)data); } else /* legacy drawing commands: curve, drawnumber, etc. */ { @@ -4221,19 +4221,19 @@ static void draw_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, gui_start_array(); char parent_tagbuf[MAXPDSTRING]; - sprintf(parent_tagbuf, "dgroup%lx.%lx", + sprintf(parent_tagbuf, "dgroup%zx.%zx", (in_array ? - (long unsigned int)parentglist : - (long unsigned int)x->x_canvas), - (long unsigned int)data); + (t_int)parentglist : + (t_int)x->x_canvas), + (t_int)data); gui_s(parent_tagbuf); /* tags - one for this scalar (not sure why the double glist thingy) one for this specific draw item */ char tagbuf[MAXPDSTRING]; - sprintf(tagbuf, "draw%lx.%lx", - (long unsigned int)x, - (long unsigned int)data); + sprintf(tagbuf, "draw%zx.%zx", + (t_int)x, + (t_int)data); gui_s(tagbuf); gui_end_array(); gui_end_vmess(); @@ -4246,7 +4246,7 @@ static void draw_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, //glist_noselect(gl); //glist_select(gl, (t_gobj *)glist); char objtag[64]; - sprintf(objtag, ".x%lx.x%lx.template%lx", + sprintf(objtag, ".x%zx.x%zx.template%zx", (t_int)gl, (t_int)glist, (t_int)data); canvas_restore_original_position(gl, (t_gobj *)glist, objtag, -1); @@ -4260,8 +4260,8 @@ static void draw_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, if (n > 1) { char itemtagbuf[MAXPDSTRING]; - sprintf(itemtagbuf, "draw%lx.%lx", (long unsigned int)x, - (long unsigned int)data); + sprintf(itemtagbuf, "draw%zx.%zx", (t_uint)x, + (t_int)data); gui_vmess("gui_draw_erase_item", "xs", glist_getcanvas(glist), itemtagbuf); } @@ -4411,7 +4411,7 @@ static int draw_click(t_gobj *z, t_glist *glist, t_float basex, t_float basey, int xpix, int ypix, int shift, int alt, int dbl, int doit) { - //fprintf(stderr,"draw_click %f %f %d %d %g %g %lx\n", + //fprintf(stderr,"draw_click %f %f %d %d %g %g %zx\n", // basex, basey, xpix, ypix, glist_xtopixels(glist, basex), // glist_ytopixels(glist, basey), (t_int)data); t_draw *x = (t_draw *)z; @@ -4475,7 +4475,7 @@ static int draw_click(t_gobj *z, t_glist *glist, &draw_motion_scalar->sc_gobj); else gpointer_setarray(&draw_motion_gpointer, draw_motion_array, draw_motion_wp); - glist_grab(glist, z, draw_motion, 0, xpix, ypix); + glist_grab(glist, z, draw_motion, 0, 0, xpix, ypix); //outlet_anything(x->x_obj.ob_outlet, gensym("click"), 0, 0); } //draw_notifyforscalar(x, glist, sc, gensym("mousedown"), 5, at); @@ -4566,8 +4566,8 @@ void draw_notify(t_canvas *x, t_symbol *s, int argc, t_atom *argv) "from gui arrived"); return; } - long word_candidate = 0; /* from glob_findinstance */ - if (!sscanf(array_sym->s_name, "x%lx", &word_candidate)) + uint64_t word_candidate = 0; /* from glob_findinstance */ + if (!sscanf(array_sym->s_name, "x%zx", &word_candidate)) { pd_error(sc, "scalar: couldn't read array datum from GUI"); return; @@ -4585,7 +4585,7 @@ void draw_notify(t_canvas *x, t_symbol *s, int argc, t_atom *argv) a canvas field. If there's any in existence, forward the event notification. pd_bind takes care of the details of this-- if there are multiple [event] objects it will dispatch to each */ - sprintf(canvas_field_namebuf, "%lx_event", (long unsigned int)sc->sc_vec); + sprintf(canvas_field_namebuf, "%zx_event", (t_uint)sc->sc_vec); canvas_field_event = gensym(canvas_field_namebuf); t_pd *target = canvas_field_event->s_thing; if (target) @@ -4625,7 +4625,7 @@ static int draw_click(t_gobj *z, t_glist *glist, int xpix, int ypix, int shift, int alt, int dbl, int doit) { post("hello?"); - //fprintf(stderr,"draw_click %f %f %d %d %lx\n", + //fprintf(stderr,"draw_click %f %f %d %d %zx\n", // basex, basey, xpix, ypix, (t_int)data); t_draw *x = (t_draw *)z; t_svg *sa = (t_svg *)x->x_attr; @@ -4693,7 +4693,7 @@ static int draw_click(t_gobj *z, t_glist *glist, &draw_motion_scalar->sc_gobj); else gpointer_setarray(&draw_motion_gpointer, draw_motion_array, draw_motion_wp); - glist_grab(glist, z, draw_motion, 0, xpix, ypix); + glist_grab(glist, z, draw_motion, 0, 0, xpix, ypix); } post("we got clicked"); outlet_anything(x->x_obj.ob_outlet, gensym("click"), 0, 0); @@ -4748,7 +4748,7 @@ static void svg_free(t_svg *x) t_freebytes(x->x_nargs_per_cmd, x->x_npathcmds * sizeof(*x->x_nargs_per_cmd)); } char buf[50]; - sprintf(buf, "x%lx", (long unsigned int)x); + sprintf(buf, "x%zx", (t_uint)x); pd_unbind((t_pd *)x->x_parent, gensym(buf)); } @@ -4894,7 +4894,7 @@ static void *event_new(void) t_canvas *c = canvas_getrootfor(canvas_getcurrent()); if (c->gl_vec) { - sprintf(namebuf, "%lx_event", (long unsigned int)c->gl_vec); + sprintf(namebuf, "%zx_event", (t_uint)c->gl_vec); x->x_bindsym = gensym(namebuf); pd_bind(&x->x_obj.ob_pd, x->x_bindsym); } @@ -5115,7 +5115,7 @@ static void curve_getrect(t_gobj *z, t_glist *glist, t_word *data, t_template *template, t_float basex, t_float basey, int *xp1, int *yp1, int *xp2, int *yp2) { - //fprintf(stderr,">>>>>>>>>>>>>>>>>>>>>>curve_getrect %lx\n", (t_int)z); + //fprintf(stderr,">>>>>>>>>>>>>>>>>>>>>>curve_getrect %zx\n", (t_uint)z); t_curve *x = (t_curve *)z; int i, n = x->x_npoints; t_fielddesc *f = x->x_vec; @@ -5329,14 +5329,14 @@ static void curve_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, gui_start_array(); char parent_tagbuf[MAXPDSTRING]; - sprintf(parent_tagbuf, "dgroup%lx.%lx", - (in_array ? (long unsigned int)parentglist : - (long unsigned int)x->x_canvas), - (long unsigned int)data); + sprintf(parent_tagbuf, "dgroup%zx.%zx", + (in_array ? (t_int)parentglist : + (t_int)x->x_canvas), + (t_int)data); gui_s(parent_tagbuf); char tagbuf[MAXPDSTRING]; - sprintf(tagbuf, "curve%lx.%lx", (long unsigned int)x, - (long unsigned int)data); + sprintf(tagbuf, "curve%zx.%zx", (t_uint)x, + (t_int)data); gui_s(tagbuf); gui_end_array(); /* end of tags array */ gui_end_vmess(); @@ -5346,7 +5346,7 @@ static void curve_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, //glist_noselect(gl); //glist_select(gl, (t_gobj *)glist); char objtag[64]; - sprintf(objtag, ".x%lx.x%lx.template%lx", + sprintf(objtag, ".x%zx.x%zx.template%zx", (t_int)gl, (t_int)glist, (t_int)data); canvas_restore_original_position(gl, (t_gobj *)glist, objtag, -1); @@ -5359,8 +5359,8 @@ static void curve_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, if (n > 1) { char itemtagbuf[MAXPDSTRING]; - sprintf(itemtagbuf, "curve%lx.%lx", (long unsigned int)x, - (long unsigned int)data); + sprintf(itemtagbuf, "curve%zx.%zx", (t_uint)x, + (t_int)data); } } } @@ -5422,7 +5422,7 @@ static int curve_click(t_gobj *z, t_glist *glist, t_float basex, t_float basey, int xpix, int ypix, int shift, int alt, int dbl, int doit) { - //fprintf(stderr,"curve_click %f %f %d %d %lx\n", basex, basey, + //fprintf(stderr,"curve_click %f %f %d %d %zx\n", basex, basey, // xpix, ypix, (t_int)data); t_curve *x = (t_curve *)z; int i, n = x->x_npoints; @@ -5475,7 +5475,7 @@ static int curve_click(t_gobj *z, t_glist *glist, &curve_motion_scalar->sc_gobj); else gpointer_setarray(&curve_motion_gpointer, curve_motion_array, curve_motion_wp); - glist_grab(glist, z, curve_motion, 0, xpix, ypix); + glist_grab(glist, z, curve_motion, 0, 0, xpix, ypix); } return (1); } @@ -5977,10 +5977,10 @@ static void plot_groupvis(t_scalar *x, t_glist *owner, t_word *data, { t_gobj *y; char tagbuf[MAXPDSTRING], parent_tagbuf[MAXPDSTRING]; - sprintf(tagbuf, "dgroup%lx.%lx", (long unsigned int)groupcanvas, - (long unsigned int)data); - sprintf(parent_tagbuf, "dgroup%lx.%lx", (long unsigned int)parent, - (long unsigned int)data); + sprintf(tagbuf, "dgroup%zx.%zx", (t_uint)groupcanvas, + (t_int)data); + sprintf(parent_tagbuf, "dgroup%zx.%zx", (t_uint)parent, + (t_int)data); gui_start_vmess("gui_scalar_draw_group", "xsss", glist_getcanvas(owner), tagbuf, @@ -6203,13 +6203,13 @@ static void plot_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, gui_start_array(); char pbuf[MAXPDSTRING]; char tbuf[MAXPDSTRING]; - sprintf(pbuf, "dgroup%lx.%lx", - (long unsigned int)x->x_canvas, - (long unsigned int)data); - sprintf(tbuf, ".x%lx.x%lx.template%lx", - (long unsigned int)glist_getcanvas(glist), - (long unsigned int)glist, - (long unsigned int)data); + sprintf(pbuf, "dgroup%zx.%zx", + (t_int)x->x_canvas, + (t_int)data); + sprintf(tbuf, ".x%zx.x%zx.template%zx", + (t_int)glist_getcanvas(glist), + (t_int)glist, + (t_int)data); gui_s(pbuf); gui_s(pbuf); gui_end_array(); @@ -6322,13 +6322,13 @@ static void plot_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, gui_start_array(); char pbuf[MAXPDSTRING]; char tbuf[MAXPDSTRING]; - sprintf(pbuf, "dgroup%lx.%lx", - (long unsigned int)x->x_canvas, - (long unsigned int)data); - sprintf(tbuf, ".x%lx.x%lx.template%lx", - (long unsigned int)glist_getcanvas(glist), - (long unsigned int)glist, - (long unsigned int)data); + sprintf(pbuf, "dgroup%zx.%zx", + (t_int)x->x_canvas, + (t_int)data); + sprintf(tbuf, ".x%zx.x%zx.template%zx", + (t_int)glist_getcanvas(glist), + (t_int)glist, + (t_int)data); gui_s(pbuf); gui_s(pbuf); gui_end_array(); @@ -6402,13 +6402,13 @@ static void plot_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, gui_start_array(); char pbuf[MAXPDSTRING]; char tbuf[MAXPDSTRING]; - sprintf(pbuf, "dgroup%lx.%lx", - (long unsigned int)x->x_canvas, - (long unsigned int)data); - sprintf(tbuf, ".x%lx.x%lx.template%lx", - (long unsigned int)glist_getcanvas(glist), - (long unsigned int)glist, - (long unsigned int)data); + sprintf(pbuf, "dgroup%zx.%zx", + (t_int)x->x_canvas, + (t_int)data); + sprintf(tbuf, ".x%zx.x%zx.template%zx", + (t_int)glist_getcanvas(glist), + (t_int)glist, + (t_int)data); gui_s(pbuf); gui_s(pbuf); gui_end_array(); @@ -6418,7 +6418,7 @@ static void plot_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, /* make sure the array drawings are behind the graph */ /* not doing this yet with the GUI port... */ - //sys_vgui(".x%lx.c lower plot%lx graph%lx\n", glist_getcanvas(glist), + //sys_vgui(".x%zx.c lower plot%zx graph%zx\n", glist_getcanvas(glist), // data, glist); /* We're done with the outline; now draw all the points. @@ -6449,14 +6449,14 @@ static void plot_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, /* todo: need to check if plot itself is in an array */ char tagbuf[MAXPDSTRING]; - sprintf(tagbuf, "dgroup%lx.%lx", - (long unsigned int)elemtemplatecanvas, - (long unsigned int)((t_word *)(elem + elemsize * i))); + sprintf(tagbuf, "dgroup%zx.%zx", + (t_int)elemtemplatecanvas, + (t_int)((t_word *)(elem + elemsize * i))); char parent_tagbuf[MAXPDSTRING]; - sprintf(parent_tagbuf, "dgroup%lx.%lx", - (in_array ? (long unsigned int)parentglist : - (long unsigned int)x->x_canvas), - (long unsigned int)data); + sprintf(parent_tagbuf, "dgroup%zx.%zx", + (in_array ? (t_int)parentglist : + (t_int)x->x_canvas), + (t_int)data); char transform_buf[MAXPDSTRING]; sprintf(transform_buf, "translate(%g,%g)", usexloc, useyloc); @@ -6494,16 +6494,16 @@ static void plot_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, { t_canvas *gl = glist_getcanvas(glist); char objtag[64]; - sprintf(objtag, ".x%lx.x%lx.template%lx", + sprintf(objtag, ".x%zx.x%zx.template%zx", (t_int)gl, (t_int)glist, (t_int)data); canvas_restore_original_position(gl, (t_gobj *)glist, objtag, -1); } /* - sys_vgui(".x%lx.c lower .x%lx.x%lx.plot%lx %s\n", + sys_vgui(".x%zx.c lower .x%zx.x%zx.plot%zx %s\n", glist_getcanvas(glist), glist_getcanvas(glist), glist, data, rtext_gettag(glist_findrtext(glist_getcanvas(glist), &glist->gl_obj))); - sys_vgui(".x%lx.c raise .x%lx.x%lx.plot%lx %s\n", + sys_vgui(".x%zx.c raise .x%zx.x%zx.plot%zx %s\n", glist_getcanvas(glist), glist_getcanvas(glist), glist, data, rtext_gettag(glist_findrtext(glist_getcanvas(glist), &glist->gl_obj))); @@ -6532,7 +6532,7 @@ static void plot_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, } /* and then the trace */ - //sys_vgui(".x%lx.c delete .x%lx.x%lx.template%lx\n", + //sys_vgui(".x%zx.c delete .x%zx.x%zx.template%zx\n", // glist_getcanvas(glist), glist_getcanvas(glist), glist, data); } } @@ -6542,7 +6542,7 @@ static int plot_click(t_gobj *z, t_glist *glist, t_float basex, t_float basey, int xpix, int ypix, int shift, int alt, int dbl, int doit) { - //fprintf(stderr,"plot_click %lx %lx %f %f %d %d\n", + //fprintf(stderr,"plot_click %zx %zx %f %f %d %d\n", // (t_int)z, (t_int)glist, basex, basey, xpix, ypix); t_plot *x = (t_plot *)z; t_symbol *elemtemplatesym; @@ -6582,7 +6582,7 @@ static void plot_free(t_plot *x) if (t) { t->t_transformable--; - //fprintf(stderr,"plot_free > template:%lx(%s) transform:%d\n", + //fprintf(stderr,"plot_free > template:%zx(%s) transform:%d\n", // (t_int)t, canvas_makebindsym(x->x_canvas->gl_name)->s_name, // t->t_transformable); } @@ -6735,10 +6735,10 @@ static void drawarray_groupvis(t_scalar *x, t_glist *owner, t_word *data, { t_gobj *y; char tagbuf[MAXPDSTRING], parent_tagbuf[MAXPDSTRING]; - sprintf(tagbuf, "dgroup%lx.%lx", (long unsigned int)groupcanvas, - (long unsigned int)data); - sprintf(parent_tagbuf, "dgroup%lx.%lx", (long unsigned int)parent, - (long unsigned int)data); + sprintf(tagbuf, "dgroup%zx.%zx", (t_uint)groupcanvas, + (t_int)data); + sprintf(parent_tagbuf, "dgroup%zx.%zx", (t_uint)parent, + (t_int)data); gui_start_vmess("gui_scalar_draw_group", "xsss", glist_getcanvas(owner), tagbuf, @@ -6805,8 +6805,8 @@ static void drawarray_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, /* id for the the viewport-- we prefix it with "draw" to be compatible with the other svg-based drawcommands */ char viewport_tagbuf[MAXPDSTRING]; - sprintf(viewport_tagbuf, "draw%lx.%lx", - (long unsigned int)x, (long unsigned int)data); + sprintf(viewport_tagbuf, "draw%zx.%zx", + (t_int)x, (t_int)data); if (tovis) { @@ -6815,15 +6815,15 @@ static void drawarray_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, /* make sure the array drawings are behind the graph */ /* not doing this yet with the GUI port... */ - //sys_vgui(".x%lx.c lower plot%lx graph%lx\n", glist_getcanvas(glist), + //sys_vgui(".x%zx.c lower plot%zx graph%zx\n", glist_getcanvas(glist), // data, glist); /* 1. Set up the main <g> for this widget */ char parent_tagbuf[MAXPDSTRING]; - sprintf(parent_tagbuf, "dgroup%lx.%lx", - (in_array ? (long unsigned int)parentglist : - (long unsigned int)x->x_canvas), - (long unsigned int)data); + sprintf(parent_tagbuf, "dgroup%zx.%zx", + (in_array ? (t_int)parentglist : + (t_int)x->x_canvas), + (t_int)data); t_svg *sa = (t_svg *)x->x_attr; gui_start_vmess("gui_draw_vis", "xs", glist_getcanvas(glist), "g"); @@ -6863,9 +6863,9 @@ static void drawarray_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, /* todo: need to check if drawarray itself is in an array */ char tagbuf[MAXPDSTRING]; - sprintf(tagbuf, "dgroup%lx.%lx", - (long unsigned int)elemtemplatecanvas, - (long unsigned int)((t_word *)(elem + elemsize * i))); + sprintf(tagbuf, "dgroup%zx.%zx", + (t_int)elemtemplatecanvas, + (t_int)((t_word *)(elem + elemsize * i))); char transform_buf[MAXPDSTRING]; sprintf(transform_buf, "translate(%g,%g)", usexloc, useyloc); @@ -6910,7 +6910,7 @@ static void drawarray_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, { t_canvas *gl = glist_getcanvas(glist); char objtag[64]; - sprintf(objtag, ".x%lx.x%lx.template%lx", + sprintf(objtag, ".x%zx.x%zx.template%zx", (t_int)gl, (t_int)glist, (t_int)data); canvas_restore_original_position(gl, (t_gobj *)glist, objtag, -1); } @@ -6945,7 +6945,7 @@ static int drawarray_click(t_gobj *z, t_glist *glist, int xpix, int ypix, int shift, int alt, int dbl, int doit) { /* Let's hold off on this for a bit... - //fprintf(stderr,"drawarray_click %lx %lx %f %f %d %d\n", + //fprintf(stderr,"drawarray_click %zx %zx %f %f %d %d\n", // (t_int)z, (t_int)glist, basex, basey, xpix, ypix); t_drawarray *x = (t_drawarray *)z; t_symbol *elemtemplatesym; @@ -6984,7 +6984,7 @@ static void drawarray_free(t_drawarray *x) if (t) { t->t_transformable--; - //fprintf(stderr,"drawarray_free > template:%lx(%s) transform:%d\n", + //fprintf(stderr,"drawarray_free > template:%zx(%s) transform:%d\n", // (t_int)t, canvas_makebindsym(x->x_canvas->gl_name)->s_name, // t->t_transformable); } @@ -7313,13 +7313,13 @@ static void drawsymbol_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, colorstring); drawsymbol_getbuf(x, data, template, buf); char parent_tagbuf[MAXPDSTRING]; - sprintf(parent_tagbuf, "dgroup%lx.%lx", - (in_array ? (long unsigned int)parentglist : - (long unsigned int)x->x_canvas), - (long unsigned int)data); + sprintf(parent_tagbuf, "dgroup%zx.%zx", + (in_array ? (t_int)parentglist : + (t_int)x->x_canvas), + (t_int)data); char tagbuf[MAXPDSTRING]; - sprintf(tagbuf, "drawnumber%lx.%lx", (long unsigned int)x, - (long unsigned int)data); + sprintf(tagbuf, "drawnumber%zx.%zx", (t_uint)x, + (t_int)data); gui_vmess("gui_drawnumber_vis", "xssiiffsissii", glist_getcanvas(glist), parent_tagbuf, @@ -7338,8 +7338,8 @@ static void drawsymbol_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, else { char tagbuf[MAXPDSTRING]; - sprintf(tagbuf, "drawnumber%lx.%lx", (long unsigned int)x, - (long unsigned int)data); + sprintf(tagbuf, "drawnumber%zx.%zx", (t_uint)x, + (t_int)data); gui_vmess("gui_draw_erase_item", "xs", glist_getcanvas(glist), tagbuf); } @@ -7505,8 +7505,9 @@ static int drawsymbol_click(t_gobj *z, t_glist *glist, drawsymbol_motion_glist, &drawsymbol_motion_scalar->sc_gobj); else gpointer_setarray(&drawsymbol_motion_gpointer, drawsymbol_motion_array, drawsymbol_motion_wp); - glist_grab(glist, z, drawsymbol_motion, drawsymbol_key, - xpix, ypix); + /* ico@vt.edu 20200920: LATER consider also using keyname (currently 0) */ + glist_grab(glist, z, drawsymbol_motion, drawsymbol_key, + 0, xpix, ypix); } return (1); } @@ -7564,7 +7565,7 @@ static void *drawimage_new(t_symbol *classsym, int argc, t_atom *argv) char *classname = classsym->s_name; char buf[50]; - sprintf(buf, "x%lx", (t_int)x); + sprintf(buf, "x%zx", (t_uint)x); pd_bind(&x->x_obj.ob_pd, gensym(buf)); int flags = 0; @@ -7816,17 +7817,17 @@ static void drawimage_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, basex + fielddesc_getcoord(&svg->x_x.a_attr, template, data, 0)); int yloc = glist_ytopixels(glist, basey + fielddesc_getcoord(&svg->x_y.a_attr, template, data, 0)); - sys_vgui("pdtk_drawimage_vis .x%lx.c %d %d .x%lx .x%lx.i %d ",*/ + sys_vgui("pdtk_drawimage_vis .x%zx.c %d %d .x%zx .x%zx.i %d ",*/ t_float xloc = fielddesc_getcoord(&svg->x_x.a_attr, template, data, 0); t_float yloc = fielddesc_getcoord(&svg->x_y.a_attr, template, data, 0); char tagbuf[MAXPDSTRING]; char parent_tagbuf[MAXPDSTRING]; - sprintf(tagbuf, "draw%lx.%lx", - (long unsigned int)x, (long unsigned int)data); - sprintf(parent_tagbuf,"dgroup%lx.%lx", - in_array ? (long unsigned int)parentglist : (long unsigned int)parent, - (long unsigned int)data); + sprintf(tagbuf, "draw%zx.%zx", + (t_int)x, (t_int)data); + sprintf(parent_tagbuf,"dgroup%zx.%zx", + in_array ? (t_int)parentglist : (t_int)parent, + (t_int)data); gui_vmess("gui_drawimage_vis", "xffxxis", glist_getcanvas(glist), @@ -7846,7 +7847,7 @@ static void drawimage_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, { /* We don't actually need this-- the image should get destroyed automatically. */ - //sys_vgui("pdtk_drawimage_unvis .x%lx.c .x%lx.i\n", + //sys_vgui("pdtk_drawimage_unvis .x%zx.c .x%zx.i\n", // glist_getcanvas(glist), data); } } @@ -7935,8 +7936,9 @@ static int drawimage_click(t_gobj *z, t_glist *glist, drawimage_motion_glist, &drawimage_motion_scalar->sc_gobj); else gpointer_setarray(&drawimage_motion_gpointer, drawimage_motion_array, drawimage_motion_wp); + /* ico@vt.edu 20200920: LATER consider also using keyname (currently 0) */ glist_grab(glist, z, drawimage_motion, drawimage_key, - xpix, ypix); + 0, xpix, ypix); } return (1); } @@ -7957,8 +7959,8 @@ static void drawimage_free(t_drawimage *x) { /* delete the parent image in the gui */ char buf[50]; - //sprintf(buf, ".x%lx", (t_int)x); - sprintf(buf, "x%lx", (long unsigned int)x); + //sprintf(buf, ".x%zx", (t_uint)x); + sprintf(buf, "x%zx", (t_uint)x); pd_unbind(&x->x_obj.ob_pd, gensym(buf)); gui_vmess("gui_image_free", "x", x); } @@ -8071,9 +8073,9 @@ void svg_parentwidgettogui(t_gobj *z, t_scalar *sc, t_glist *owner, if (pd_class(&z->g_pd) == draw_class) { t_draw *x = (t_draw *)z; - sprintf(tagbuf, "draw%lx.%lx", - (long unsigned int)x, - (long unsigned int)data); + sprintf(tagbuf, "draw%zx.%zx", + (t_int)x, + (t_int)data); gui_start_vmess("gui_draw_configure_all", "xs", glist_getcanvas(owner), tagbuf); svg_togui((t_svg *)x->x_attr, template, data); @@ -8082,9 +8084,9 @@ void svg_parentwidgettogui(t_gobj *z, t_scalar *sc, t_glist *owner, else if (pd_class(&z->g_pd) == drawimage_class) { t_drawimage *x = (t_drawimage *)z; - sprintf(tagbuf, "draw%lx.%lx", - (long unsigned int)x, - (long unsigned int)data); + sprintf(tagbuf, "draw%zx.%zx", + (t_int)x, + (t_int)data); gui_start_vmess("gui_draw_configure_all", "xs", glist_getcanvas(owner), tagbuf); svg_togui((t_svg *)x->x_attr, template, data); diff --git a/pd/src/g_text.c b/pd/src/g_text.c index 4eae176faf5ab4d41d05110fdea158b946211b36..692396032c1b3e9efe293257d912bd5c5fabb2e8 100644 --- a/pd/src/g_text.c +++ b/pd/src/g_text.c @@ -44,6 +44,11 @@ extern int we_are_undoing; extern void glob_preset_node_list_check_loc_and_update(void); extern void glob_preset_node_list_seek_hub(void); +extern int sys_noautopatch; +extern int glob_autopatch_connectme; +extern t_gobj *glist_nth(t_glist *x, int n); +extern int glist_getindex(t_glist *x, t_gobj *y); + /* ----------------- the "text" object. ------------------ */ /* add a "text" object (comment) to a glist. While this one goes for any @@ -78,8 +83,8 @@ void glist_text(t_glist *gl, t_symbol *s, int argc, t_atom *argv) else { //int xpix, ypix; - int connectme, xpix, ypix, indx, nobj; - canvas_howputnew(gl, &connectme, &xpix, &ypix, &indx, &nobj); + int xpix, ypix, indx, nobj; + canvas_howputnew(gl, &glob_autopatch_connectme, &xpix, &ypix, &indx, &nobj); pd_vmess((t_pd *)glist_getcanvas(gl), gensym("editmode"), "i", 1); SETSYMBOL(&at, gensym("comment")); glist_noselect(gl); @@ -99,7 +104,7 @@ void glist_text(t_glist *gl, t_symbol *s, int argc, t_atom *argv) if (!we_are_undoing) canvas_undo_add(glist_getcanvas(gl), 9, "create", (void *)canvas_undo_set_create(glist_getcanvas(gl))); - if (connectme == 0) + if (glob_autopatch_connectme == 0) { canvas_displaceselection(glist_getcanvas(gl), -8, -8); canvas_startmotion(glist_getcanvas(gl)); @@ -284,9 +289,6 @@ static int get_autopatch_yoffset(t_canvas *x) } } -extern int sys_noautopatch; -extern t_gobj *glist_nth(t_glist *x, int n); -extern int glist_getindex(t_glist *x, t_gobj *y); /* utility routine to figure out where to put a new text box from menu and whether to connect to it automatically */ void canvas_howputnew(t_canvas *x, int *connectp, int *xpixp, int *ypixp, @@ -304,9 +306,9 @@ void canvas_howputnew(t_canvas *x, int *connectp, int *xpixp, int *ypixp, t_object *ob = pd_checkobject(&selected->g_pd); connectme = (obj_noutlets(ob) ? 1 : 0); }*/ - int connectme = (x->gl_editor->e_selection && + glob_autopatch_connectme = (x->gl_editor->e_selection && !x->gl_editor->e_selection->sel_next); - if (connectme) + if (glob_autopatch_connectme) { t_gobj *g, *selected = x->gl_editor->e_selection->sel_what; t_text *t = (t_text *)selected; @@ -353,10 +355,10 @@ void canvas_howputnew(t_canvas *x, int *connectp, int *xpixp, int *ypixp, } if (sys_noautopatch) { - if (connectme == 1) connectme = -1; - else connectme = 0; + if (glob_autopatch_connectme == 1) glob_autopatch_connectme = -1; + else glob_autopatch_connectme = 0; } - *connectp = connectme; + *connectp = glob_autopatch_connectme; *indexp = indx; *totalp = nobj; } @@ -385,21 +387,21 @@ void canvas_obj(t_glist *gl, t_symbol *s, int argc, t_atom *argv) { /* interactively create new object */ t_binbuf *b = binbuf_new(); - int connectme, xpix, ypix, indx, nobj; - canvas_howputnew(gl, &connectme, &xpix, &ypix, &indx, &nobj); + int xpix, ypix, indx, nobj; + canvas_howputnew(gl, &glob_autopatch_connectme, &xpix, &ypix, &indx, &nobj); pd_vmess(&gl->gl_pd, gensym("editmode"), "i", 1); canvas_objtext(gl, - connectme ? xpix : xpix - 8, - connectme ? ypix : ypix - 8, - 0, 1, b, connectme); - if (connectme == 1) + glob_autopatch_connectme ? xpix : xpix - 8, + glob_autopatch_connectme ? ypix : ypix - 8, + 0, 1, b, glob_autopatch_connectme); + if (glob_autopatch_connectme == 1) { //fprintf(stderr,"canvas_obj calls canvas_connect\n"); connect_exception = 1; canvas_connect(gl, indx, 0, nobj, 0); connect_exception = 0; } - else if (connectme == 0) + else if (glob_autopatch_connectme == 0) { //fprintf(stderr,"canvas_obj calls canvas_startmotion\n"); //canvas_displaceselection(glist_getcanvas(gl), -8, -8); @@ -426,8 +428,8 @@ void canvas_obj_abstraction_from_menu(t_glist *gl, t_symbol *s, t_binbuf *b = binbuf_new(); binbuf_restore(b, 2, argv); - int connectme, xpix, ypix, indx, nobj; - canvas_howputnew(gl, &connectme, &xpix, &ypix, &indx, &nobj); + int xpix, ypix, indx, nobj; + canvas_howputnew(gl, &glob_autopatch_connectme, &xpix, &ypix, &indx, &nobj); pd_vmess(&gl->gl_pd, gensym("editmode"), "i", 1); #ifdef PDL2ORK if (sys_k12_mode) @@ -445,11 +447,11 @@ void canvas_obj_abstraction_from_menu(t_glist *gl, t_symbol *s, y = y->g_next; canvas_loadbang((t_canvas *)y); - if (connectme == 1) + if (glob_autopatch_connectme == 1) { canvas_connect(gl, indx, 0, nobj, 0); } - else if (connectme == 0) + else if (glob_autopatch_connectme == 0) { //glist_setlastxy(glist_getcanvas(gl), xpix, ypix); canvas_startmotion(glist_getcanvas(gl)); @@ -472,9 +474,9 @@ void canvas_iemguis(t_glist *gl, t_symbol *guiobjname) if (!strcmp(guiobjname->s_name, "cnv")) glist_noselect(gl); - int connectme, xpix, ypix, indx, nobj; + int xpix, ypix, indx, nobj; - canvas_howputnew(gl, &connectme, &xpix, &ypix, &indx, &nobj); + canvas_howputnew(gl, &glob_autopatch_connectme, &xpix, &ypix, &indx, &nobj); /* NOT NECESSARY ANY MORE: compensate for the iemgui sliders' xyoffset in case of autopatch @@ -496,11 +498,11 @@ void canvas_iemguis(t_glist *gl, t_symbol *guiobjname) SETSYMBOL(&at, guiobjname); binbuf_restore(b, 1, &at); canvas_objtext(gl, xpix, ypix, 0, 1, b, 0); - if (connectme == 1) + if (glob_autopatch_connectme == 1) canvas_connect(gl, indx, 0, nobj, 0); //glist_getnextxy(gl, &xpix, &ypix); //canvas_objtext(gl, xpix, ypix, 1, b, 0); - else if (connectme == 0) + else if (glob_autopatch_connectme == 0) { canvas_displaceselection(glist_getcanvas(gl), -8, -8); canvas_startmotion(glist_getcanvas(gl)); @@ -828,8 +830,8 @@ void canvas_msg(t_glist *gl, t_symbol *s, int argc, t_atom *argv) post("unable to create stub message in closed canvas!"); else { - int connectme, xpix, ypix, indx, nobj; - canvas_howputnew(gl, &connectme, &xpix, &ypix, &indx, &nobj); + int xpix, ypix, indx, nobj; + canvas_howputnew(gl, &glob_autopatch_connectme, &xpix, &ypix, &indx, &nobj); pd_vmess(&gl->gl_pd, gensym("editmode"), "i", 1); x->m_text.te_xpix = xpix; @@ -838,10 +840,10 @@ void canvas_msg(t_glist *gl, t_symbol *s, int argc, t_atom *argv) glist_noselect(gl); glist_select(gl, &x->m_text.te_g); gobj_activate(&x->m_text.te_g, gl, - connectme ? 1 : 2); // <-- hack to signal we're a new message box - if (connectme == 1) + glob_autopatch_connectme ? 1 : 2); // <-- hack to signal we're a new message box + if (glob_autopatch_connectme == 1) canvas_connect(gl, indx, 0, nobj, 0); - else if (connectme == 0) + else if (glob_autopatch_connectme == 0) { canvas_displaceselection(glist_getcanvas(gl), -8, -8); canvas_startmotion(glist_getcanvas(gl)); @@ -864,18 +866,22 @@ void canvas_msg(t_glist *gl, t_symbol *s, int argc, t_atom *argv) typedef struct _gatom { t_text a_text; - t_atom a_atom; /* this holds the value and the type */ - t_glist *a_glist; /* owning glist */ - t_float a_toggle; /* value to toggle to */ - t_float a_draghi; /* high end of drag range */ - t_float a_draglo; /* low end of drag range */ - t_symbol *a_label; /* symbol to show as label next to box */ - t_symbol *a_symfrom; /* "receive" name -- bind ourselvs to this */ - t_symbol *a_symto; /* "send" name -- send to this on output */ - char a_buf[ATOMBUFSIZE];/* string buffer for typing */ - char a_shift; /* was shift key down when dragging started? */ - char a_wherelabel; /* 0-3 for left, right, above, below */ + t_atom a_atom; /* this holds the value and the type */ + t_atom a_atomold; /* this holds old value, used to reverting to + when changing the number value using arrows */ + t_glist *a_glist; /* owning glist */ + t_float a_toggle; /* value to toggle to */ + t_float a_draghi; /* high end of drag range */ + t_float a_draglo; /* low end of drag range */ + t_symbol *a_label; /* symbol to show as label next to box */ + t_symbol *a_symfrom; /* "receive" name -- bind ourselvs to this */ + t_symbol *a_symto; /* "send" name -- send to this on output */ + char a_buf[ATOMBUFSIZE]; /* string buffer for typing */ + char a_shift; /* was shift key down when dragging started? */ + char a_wherelabel; /* 0-3 for left, right, above, below */ t_symbol *a_expanded_to; /* a_symto after $0, $1, ... expansion */ + int a_shift_clicked; /* used to keep old text after \n. this is + activated by shift+clicking no the object */ } t_gatom; /* prepend "-" as necessary to avoid empty strings, so we can @@ -911,16 +917,20 @@ static void gatom_redraw(t_gobj *client, t_glist *glist) glist_retext(x->a_glist, &x->a_text); } - /* recolor option offers 0 ignore recolor + /* recolor option offers 0 ignore recolor 1 recolor */ static void gatom_retext(t_gatom *x, int senditup, int recolor) { + //post("gatom_retext senditup=%d recolor=%d", senditup, recolor); t_canvas *canvas = glist_getcanvas(x->a_glist); t_rtext *y = glist_findrtext(x->a_glist, &x->a_text); if (recolor) { + //post("gatom click off"); gui_vmess("gui_gatom_activate", "xsi", canvas, rtext_gettag(y), 0); + x->a_shift_clicked = 0; + x->a_shift = 0; } binbuf_clear(x->a_text.te_binbuf); binbuf_add(x->a_text.te_binbuf, 1, &x->a_atom); @@ -945,8 +955,14 @@ static void gatom_set(t_gatom *x, t_symbol *s, int argc, t_atom *argv) gatom_retext(x, 1, 1); else gatom_retext(x, 1, 0); + x->a_atomold = x->a_atom; + } + if (x->a_atom.a_type == A_FLOAT) + { + x->a_buf[0] = 0; + } else { + strcpy(x->a_buf, x->a_atom.a_w.w_symbol->s_name); } - x->a_buf[0] = 0; } static void gatom_bang(t_gatom *x) @@ -1011,12 +1027,59 @@ static void gatom_symbol(t_gatom *x, t_symbol *s) "nofirstin" flag, the standard list behavior gets confused. */ static void gatom_list(t_gatom *x, t_symbol *s, int argc, t_atom *argv) { + //post("gatom_list <%s>", s->s_name); if (!argc) gatom_bang(x); - else if (argv->a_type == A_FLOAT) - gatom_float(x, argv->a_w.w_float); - else if (argv->a_type == A_SYMBOL) - gatom_symbol(x, argv->a_w.w_symbol); + else if (argc == 1) + { + if (argv->a_type == A_FLOAT) + gatom_float(x, argv->a_w.w_float); + else if (argv->a_type == A_SYMBOL) + gatom_symbol(x, argv->a_w.w_symbol); + } + /* ico@vt.edu 20200904 like g_numbox.c, here we hijack list to capture + keyname keypresses, so that we can use shift+backspace to delete + entire text */ + else if (argc == 2 && argv[0].a_type == A_FLOAT && argv[1].a_type == A_SYMBOL) + { + //post("got keyname %s while grabbed\n", argv[1].a_w.w_symbol->s_name); + if (!strcmp("Shift", argv[1].a_w.w_symbol->s_name)) + { + x->a_shift = (int)argv[0].a_w.w_float; + //post("...Shift %d", x->a_shift); + } + if (x->a_atom.a_type == A_FLOAT && argv[0].a_w.w_float == 1) + { + if (!strcmp("Up", argv[1].a_w.w_symbol->s_name)) + { + //fprintf(stderr,"...Up\n"); + x->a_atom.a_w.w_float += 1; + //sprintf(x->a_buf, "%g", x->a_atom.a_w.w_float); + gatom_retext(x, 1, 0); + } + else if (!strcmp("ShiftUp", argv[1].a_w.w_symbol->s_name)) + { + //fprintf(stderr,"...ShiftUp\n"); + x->a_atom.a_w.w_float += 0.01; + //sprintf(x->a_buf, "%g", x->a_atom.a_w.w_float); + gatom_retext(x, 1, 0); + } + if (!strcmp("Down", argv[1].a_w.w_symbol->s_name)) + { + //fprintf(stderr,"...Down\n"); + x->a_atom.a_w.w_float -= 1; + //sprintf(x->a_buf, "%g", x->a_atom.a_w.w_float); + gatom_retext(x, 1, 0); + } + else if (!strcmp("ShiftDown", argv[1].a_w.w_symbol->s_name)) + { + //fprintf(stderr,"...ShiftDown\n"); + x->a_atom.a_w.w_float -= 0.01; + //sprintf(x->a_buf, "%g", x->a_atom.a_w.w_float); + gatom_retext(x, 1, 0); + } + } + } else pd_error(x, "gatom_list: need float or symbol"); } @@ -1047,40 +1110,92 @@ static void gatom_motion(void *z, t_floatarg dx, t_floatarg dy) static void gatom_key(void *z, t_floatarg f) { - //fprintf(stderr,"gatom_key %f\n", f); t_gatom *x = (t_gatom *)z; int c = f; + //post("gatom_key %f %d", f, x->a_shift); int len = strlen(x->a_buf); t_atom at; char sbuf[ATOMBUFSIZE + 4]; if (c == 0) { - /* we're being notified that no more keys will come for this grab */ - if (x->a_buf[0]) + // we're being notified that no more keys will come for this grab + //post("gatom_key end <%s> <%s>", x->a_buf, x->a_atom.a_w.w_symbol->s_name); + pd_unbind(&x->a_text.ob_pd, gensym("#keyname_a")); + //post("unbind <%s>", x->a_buf); + if (x->a_atom.a_type == A_FLOAT) + { + x->a_atom = x->a_atomold; + //if (x->a_buf[0]) x->a_atom.a_w.w_float = atof(x->a_buf); + //sprintf(x->a_buf, "%f", x->a_atom.a_w.w_float); + //post("got float f=<%f> s=<%s>", x->a_atom.a_w.w_float, x->a_buf); + + // ico@vt.edu 20200904: + // we reset internal buffer since there is currently no graceful way + // to handle conversion from float to string and back without loss + // in the value accuracy + x->a_buf[0] = 0; gatom_retext(x, 1, 1); - else - gatom_retext(x, 0, 1); + } + else if (x->a_atom.a_type == A_SYMBOL) + { + //post("gatom_key release"); + // ico@vt.edu 20200923: we also check for empty a_buf to ensure that + // the ... is deleted. This was created when the object was originally + // clicked on below, but only if the current gatom is symbol type and + // is empty. + if (x->a_buf[0] == 0 || strcmp(x->a_buf, x->a_atom.a_w.w_symbol->s_name)) + { + strcpy(x->a_buf, x->a_atom.a_w.w_symbol->s_name); + gatom_retext(x, 1, 1); + //post("gatom_key buf=<%s> s_name=<%s>", x->a_buf, + // x->a_atom.a_w.w_symbol->s_name); + } + else + gatom_retext(x, 0, 1); + } return; } else if (c == '\b') { if (len > 0) - x->a_buf[len-1] = 0; + { + if (x->a_shift) + x->a_buf[0] = 0; + else + x->a_buf[len-1] = 0; + } goto redraw; } else if (c == '\n') { - if (x->a_atom.a_type == A_FLOAT) - x->a_atom.a_w.w_float = atof(x->a_buf); + if (x->a_atom.a_type == A_FLOAT) { + if (x->a_buf[0]) x->a_atom.a_w.w_float = atof(x->a_buf); + //sprintf(x->a_buf, "%f", x->a_atom.a_w.w_float); + //post("got float f=<%f> s=<%s>", x->a_atom.a_w.w_float, x->a_buf); + + // ico@vt.edu 20200904: + // we reset internal buffer since there is currently no graceful way + // to handle conversion from float to string and back without loss + // in the value accuracy + x->a_buf[0] = 0; + } else if (x->a_atom.a_type == A_SYMBOL) - x->a_atom.a_w.w_symbol = gensym(x->a_buf); + x->a_atom.a_w.w_symbol = gensym(x->a_buf); else bug("gatom_key"); + + x->a_atomold = x->a_atom; gatom_bang(x); gatom_retext(x, 1, 0); - x->a_buf[0] = 0; + /* ico@vt.edu 20200904: We prevent deleting of internal buffer, + so that we can keep adding to the existing text unless we click + the second time in which case we will always start with an + empty symbol + */ + if (!x->a_shift_clicked) + x->a_buf[0] = 0; /* We want to keep grabbing the keyboard after hitting "Enter", so we're commenting the following out */ - //glist_grab(x->a_glist, 0, 0, 0, 0, 0); + //glist_grab(x->a_glist, 0, 0, 0, 0, 0, 0); } else if (len < (ATOMBUFSIZE-1)) { @@ -1122,6 +1237,9 @@ static void gatom_click(t_gatom *x, t_floatarg xpos, t_floatarg ypos, t_floatarg shift, t_floatarg ctrl, t_floatarg alt) { + //post("gatom_click %f %f", ctrl, alt); + pd_bind(&x->a_text.ob_pd, gensym("#keyname_a")); + //post("bind"); if (x->a_text.te_width == 1) { if (x->a_atom.a_type == A_FLOAT) @@ -1142,9 +1260,24 @@ static void gatom_click(t_gatom *x, return; } x->a_shift = shift; - x->a_buf[0] = 0; - glist_grab(x->a_glist, &x->a_text.te_g, gatom_motion, gatom_key, - xpos, ypos); + if (x->a_atom.a_type == A_SYMBOL && !strlen(x->a_atom.a_w.w_symbol->s_name)) + { + char sbuf[ATOMBUFSIZE + 4]; + t_atom at; + sprintf(sbuf, "%s...", x->a_buf); + SETSYMBOL(&at, gensym(sbuf)); + binbuf_clear(x->a_text.te_binbuf); + binbuf_add(x->a_text.te_binbuf, 1, &at); + glist_retext(x->a_glist, &x->a_text); + } + glist_grab(x->a_glist, &x->a_text.te_g, gatom_motion, gatom_key, + gatom_list, xpos, ypos); + //post("a_shift_clicked=%d", x->a_shift_clicked); + x->a_shift_clicked = shift; + // second click wipes prior text + if (!x->a_shift_clicked) + x->a_buf[0] = 0; + //post("a_shift_clicked=%d", x->a_shift_clicked); } } @@ -1250,7 +1383,7 @@ static void gatom_displace(t_gobj *z, t_glist *glist, /* for gatom's label */ static void gatom_vis(t_gobj *z, t_glist *glist, int vis) { - //fprintf(stderr,"gatom_vis\n"); + //post("gatom_vis"); t_gatom *x = (t_gatom*)z; text_vis(z, glist, vis); if (*x->a_label->s_name) @@ -1276,7 +1409,7 @@ static void gatom_vis(t_gobj *z, t_glist *glist, int vis) /* We're just deleting the parent gobj in the GUI, which takes care of removing all the children. So we don't need to send a message here */ - //sys_vgui(".x%lx.c delete %lx.l\n", glist_getcanvas(glist), x); + //sys_vgui(".x%zx.c delete %zx.l\n", glist_getcanvas(glist), x); } } if (!vis) @@ -1303,6 +1436,7 @@ void canvas_atom(t_glist *gl, t_atomtype type, x->a_label = &s_; x->a_symfrom = &s_; x->a_symto = x->a_expanded_to = &s_; + x->a_shift_clicked = 0; if (type == A_FLOAT) { x->a_atom.a_w.w_float = 0; @@ -1315,6 +1449,7 @@ void canvas_atom(t_glist *gl, t_atomtype type, x->a_text.te_width = 10; SETSYMBOL(&at, &s_symbol); } + x->a_atomold = x->a_atom; binbuf_add(x->a_text.te_binbuf, 1, &at); if (argc > 1) /* create from file. x, y, width, low-range, high-range, flags, @@ -1347,8 +1482,8 @@ void canvas_atom(t_glist *gl, t_atomtype type, } else { - int connectme, xpix, ypix, indx, nobj; - canvas_howputnew(gl, &connectme, &xpix, &ypix, &indx, &nobj); + int xpix, ypix, indx, nobj; + canvas_howputnew(gl, &glob_autopatch_connectme, &xpix, &ypix, &indx, &nobj); outlet_new(&x->a_text, x->a_atom.a_type == A_FLOAT ? &s_float: &s_symbol); inlet_new(&x->a_text, &x->a_text.te_pd, 0, 0); @@ -1358,9 +1493,9 @@ void canvas_atom(t_glist *gl, t_atomtype type, glist_add(gl, &x->a_text.te_g); glist_noselect(gl); glist_select(gl, &x->a_text.te_g); - if (connectme == 1) + if (glob_autopatch_connectme == 1) canvas_connect(gl, indx, 0, nobj, 0); - else if (connectme == 0) + else if (glob_autopatch_connectme == 0) { canvas_displaceselection(glist_getcanvas(gl), -8, -8); canvas_startmotion(glist_getcanvas(gl)); @@ -1734,7 +1869,7 @@ static void dropdown_vis(t_gobj *z, t_glist *glist, int vis) /* We're just deleting the parent gobj in the GUI, which takes care of removing all the children. So we don't need to send a message here */ - //sys_vgui(".x%lx.c delete %lx.l\n", glist_getcanvas(glist), x); + //sys_vgui(".x%zx.c delete %zx.l\n", glist_getcanvas(glist), x); } } if (!vis) @@ -1767,7 +1902,7 @@ void canvas_dropdown(t_glist *gl, t_symbol *s, int argc, t_atom *argv) x->a_text.te_width = 6; /* bind symbol for sending index updates from the GUI */ - sprintf(tagbuf, "x%lx", (long unsigned int)x); + sprintf(tagbuf, "x%zx", (t_uint)x); pd_bind(&x->a_text.te_pd, gensym(tagbuf)); binbuf_add(x->a_text.te_binbuf, 1, binbuf_getvec(x->a_names)); @@ -1801,8 +1936,8 @@ void canvas_dropdown(t_glist *gl, t_symbol *s, int argc, t_atom *argv) } else { - int connectme, xpix, ypix, indx, nobj; - canvas_howputnew(gl, &connectme, &xpix, &ypix, &indx, &nobj); + int xpix, ypix, indx, nobj; + canvas_howputnew(gl, &glob_autopatch_connectme, &xpix, &ypix, &indx, &nobj); outlet_new(&x->a_text, &s_float); inlet_new(&x->a_text, &x->a_text.te_pd, 0, 0); pd_vmess(&gl->gl_pd, gensym("editmode"), "i", 1); @@ -1811,9 +1946,9 @@ void canvas_dropdown(t_glist *gl, t_symbol *s, int argc, t_atom *argv) glist_add(gl, &x->a_text.te_g); glist_noselect(gl); glist_select(gl, &x->a_text.te_g); - if (connectme == 1) + if (glob_autopatch_connectme == 1) canvas_connect(gl, indx, 0, nobj, 0); - else if (connectme == 0) + else if (glob_autopatch_connectme == 0) { canvas_displaceselection(glist_getcanvas(gl), -8, -8); canvas_startmotion(glist_getcanvas(gl)); @@ -1830,7 +1965,7 @@ void canvas_dropdown(t_glist *gl, t_symbol *s, int argc, t_atom *argv) static void dropdown_free(t_dropdown *x) { char tagbuf[MAXPDSTRING]; - sprintf(tagbuf, "x%lx", (long unsigned int)x); + sprintf(tagbuf, "x%zx", (t_uint)x); pd_unbind(&x->a_text.te_pd, gensym(tagbuf)); if (*x->a_symfrom->s_name) @@ -2109,18 +2244,29 @@ static void text_vis(t_gobj *z, t_glist *glist, int vis) t_rtext *y = glist_findrtext(glist, x); // make a group text_getrect(&x->te_g, glist, &x1, &y1, &x2, &y2); - gui_vmess("gui_gobj_new", "xssiii", + gui_vmess("gui_gobj_new", "xssiiii", glist_getcanvas(glist), rtext_gettag(y), type, x1, y1, - glist_istoplevel(glist)); + glist_istoplevel(glist), + pd_class(&x->te_pd) == canvas_class); if (x->te_type == T_ATOM) glist_retext(glist, x); text_drawborder(x, glist, rtext_gettag(y), rtext_width(y), rtext_height(y), 1); rtext_draw(y); + + /* check whether we have to tell the gui to mark + (border color) the gobj as dirty or not */ + if(pd_class(&x->te_pd) == canvas_class) + { + if (((t_canvas *)x)->gl_dirty) + gobj_dirty(&x->te_g, glist, 1); + else if (((t_canvas *)x)->gl_subdirties) + gobj_dirty(&x->te_g, glist, 2); + } } } else @@ -2128,7 +2274,7 @@ static void text_vis(t_gobj *z, t_glist *glist, int vis) t_rtext *y = glist_findrtext(glist, x); if (gobj_shouldvis(&x->te_g, glist)) { - //fprintf(stderr," erase it %lx %lx\n", x, glist); + //fprintf(stderr," erase it %zx %zx\n", x, glist); text_erase_gobj(x, glist, rtext_gettag(y)); //text_eraseborder(x, glist, rtext_gettag(y)); //rtext_erase(y); @@ -2163,8 +2309,8 @@ static int text_click(t_gobj *z, struct _glist *glist, t_rtext *y = glist_findrtext(glist, x); if (doit) { - //fprintf(stderr,"atom click\n"); - /* Change the gatom blue when it's clicked? Need to test... */ + //post("gatom click on"); + /* Change the gatom text color when it's clicked? Need to test... */ gui_vmess("gui_gatom_activate", "xsi", canvas, rtext_gettag(y), 1); gatom_click((t_gatom *)x, (t_floatarg)xpix, (t_floatarg)ypix, @@ -2182,6 +2328,7 @@ static int text_click(t_gobj *z, struct _glist *glist, else return (0); } +void canvas_statesavers_doit(t_glist *x, t_binbuf *b); void text_save(t_gobj *z, t_binbuf *b) { //fprintf(stderr, "text_save\n"); @@ -2211,6 +2358,7 @@ void text_save(t_gobj *z, t_binbuf *b) //fprintf(stderr, "this must be it\n"); binbuf_addbinbuf(b, x->te_binbuf); //fprintf(stderr, "DONE this must be it\n"); + } else if (x->te_type == T_MESSAGE) { @@ -2292,6 +2440,13 @@ void text_save(t_gobj *z, t_binbuf *b) binbuf_addv(b, ",si", gensym("f"), (int)x->te_width); } binbuf_addv(b, ";"); + + /* if an abstraction, give it a chance to save state */ + if (pd_class(&x->te_pd) == canvas_class && + canvas_isabstraction((t_canvas *)x)) + { + canvas_statesavers_doit((t_glist *)x, b); + } } /* this one is for everyone but "gatoms"; it's imposed in m_class.c */ @@ -2469,7 +2624,7 @@ void text_drawborder(t_text *x, t_glist *glist, } else { - //fprintf(stderr, "redrawing rectangle? .x%lx.c %sR\n", + //fprintf(stderr, "redrawing rectangle? .x%zx.c %sR\n", // (t_int)glist_getcanvas(glist), tag); gui_vmess("gui_text_redraw_border", "xsii", glist_getcanvas(glist), @@ -2571,13 +2726,13 @@ void glist_eraseiofor(t_glist *glist, t_object *ob, char *tag) n = obj_noutlets(ob); for (i = 0; i < n; i++) { - //sys_vgui(".x%lx.c delete %so%d\n", + //sys_vgui(".x%zx.c delete %so%d\n", // glist_getcanvas(glist), tag, i); } n = obj_ninlets(ob); for (i = 0; i < n; i++) { - //sys_vgui(".x%lx.c delete %si%d\n", + //sys_vgui(".x%zx.c delete %si%d\n", // glist_getcanvas(glist), tag, i); } } diff --git a/pd/src/g_toggle.c b/pd/src/g_toggle.c index 6286b9c6ee9a8b145b787bc362dcdb4f9d09051b..195887fc5790f6aec8eccb177b4ebb4fa7161fea 100644 --- a/pd/src/g_toggle.c +++ b/pd/src/g_toggle.c @@ -178,10 +178,10 @@ static void toggle_getrect(t_gobj *z, t_glist *glist, static void toggle_save(t_gobj *z, t_binbuf *b) { t_toggle *x = (t_toggle *)z; - int bflcol[3]; + t_symbol *bflcol[3]; t_symbol *srl[3]; iemgui_save(&x->x_gui, srl, bflcol); - binbuf_addv(b, "ssiisiisssiiiiiiiff;", gensym("#X"),gensym("obj"), + binbuf_addv(b, "ssiisiisssiiiisssff;", gensym("#X"),gensym("obj"), (int)x->x_gui.x_obj.te_xpix, (int)x->x_gui.x_obj.te_ypix, gensym("tgl"), x->x_gui.x_w, iem_symargstoint(&x->x_gui), srl[0], srl[1], srl[2], x->x_gui.x_ldx, x->x_gui.x_ldy, @@ -349,7 +349,6 @@ static void toggle_nonzero(t_toggle *x, t_floatarg f) static void *toggle_new(t_symbol *s, int argc, t_atom *argv) { t_toggle *x = (t_toggle *)pd_new(toggle_class); - int bflcol[]={-262144, -1, -1}; int a=IEM_GUI_DEFAULTSIZE; int ldx=17, ldy=7; int fs=10; @@ -358,14 +357,17 @@ static void *toggle_new(t_symbol *s, int argc, t_atom *argv) iem_inttosymargs(&x->x_gui, 0); iem_inttofstyle(&x->x_gui, 0); + x->x_gui.x_bcol = 0xFCFCFC; + x->x_gui.x_fcol = 0x00; + x->x_gui.x_lcol = 0x00; + if(((argc == 13)||(argc == 14))&&IS_A_FLOAT(argv,0) &&IS_A_FLOAT(argv,1) &&(IS_A_SYMBOL(argv,2)||IS_A_FLOAT(argv,2)) &&(IS_A_SYMBOL(argv,3)||IS_A_FLOAT(argv,3)) &&(IS_A_SYMBOL(argv,4)||IS_A_FLOAT(argv,4)) &&IS_A_FLOAT(argv,5)&&IS_A_FLOAT(argv,6) - &&IS_A_FLOAT(argv,7)&&IS_A_FLOAT(argv,8)&&IS_A_FLOAT(argv,9) - &&IS_A_FLOAT(argv,10)&&IS_A_FLOAT(argv,11)&&IS_A_FLOAT(argv,12)) + &&IS_A_FLOAT(argv,7)&&IS_A_FLOAT(argv,8)&&IS_A_FLOAT(argv,12)) { a = atom_getintarg(0, argc, argv); iem_inttosymargs(&x->x_gui, atom_getintarg(1, argc, argv)); @@ -374,9 +376,7 @@ static void *toggle_new(t_symbol *s, int argc, t_atom *argv) ldy = atom_getintarg(6, argc, argv); iem_inttofstyle(&x->x_gui, atom_getintarg(7, argc, argv)); fs = maxi(atom_getintarg(8, argc, argv),4); - bflcol[0] = atom_getintarg(9, argc, argv); - bflcol[1] = atom_getintarg(10, argc, argv); - bflcol[2] = atom_getintarg(11, argc, argv); + iemgui_all_loadcolors(&x->x_gui, argv+9, argv+10, argv+11); on = atom_getfloatarg(12, argc, argv); } else iemgui_new_getnames(&x->x_gui, 2, 0); @@ -399,7 +399,6 @@ static void *toggle_new(t_symbol *s, int argc, t_atom *argv) x->x_gui.x_fontsize = fs; x->x_gui.x_w = iemgui_clip_size(a); x->x_gui.x_h = x->x_gui.x_w; - iemgui_all_colfromload(&x->x_gui, bflcol); iemgui_verify_snd_ne_rcv(&x->x_gui); outlet_new(&x->x_gui.x_obj, &s_float); diff --git a/pd/src/g_undo.c b/pd/src/g_undo.c index e314e1caed28bfc78d592ed3b8361ef404887282..2d963439b6d4da9890f598c65d63c1f4b18e7fe9 100644 --- a/pd/src/g_undo.c +++ b/pd/src/g_undo.c @@ -110,6 +110,7 @@ void canvas_undo_undo(t_canvas *x) if(UNDO_SEQUENCE_END == x->u_last->type) { int sequence_depth = 1; + if(x->u_last->data) post("undo info: %s", (char *)x->u_last->data); while((x->u_last = x->u_last->prev) && (UNDO_INIT != x->u_last->type)) { @@ -120,6 +121,7 @@ void canvas_undo_undo(t_canvas *x) break; case UNDO_SEQUENCE_END: sequence_depth++; + if(x->u_last->data) post("undo info: %s", (char *)x->u_last->data); break; default: canvas_undo_doit(x, x->u_last, UNDO_UNDO); @@ -176,6 +178,7 @@ void canvas_undo_redo(t_canvas *x) if(UNDO_SEQUENCE_START == x->u_last->type) { int sequence_depth = 1; + if(x->u_last->data) post("redo info: %s", (char *)x->u_last->data); while(x->u_last->next && (x->u_last = x->u_last->next)) { switch(x->u_last->type) @@ -185,6 +188,7 @@ void canvas_undo_redo(t_canvas *x) break; case UNDO_SEQUENCE_START: sequence_depth++; + if(x->u_last->data) post("redo info: %s", (char *)x->u_last->data); break; default: canvas_undo_doit(x, x->u_last, UNDO_REDO); diff --git a/pd/src/g_vumeter.c b/pd/src/g_vumeter.c index d1693a08a7301963780c8fd23a32e8b75d395206..7b6f46ecd1f4b9b8269ba7c4820ed23147bb675b 100644 --- a/pd/src/g_vumeter.c +++ b/pd/src/g_vumeter.c @@ -159,7 +159,7 @@ static void vu_draw_new(t_vu *x, t_glist *glist) gui_vmess("gui_vumeter_draw_text", "xxsiisiiiis", canvas, x, cbuf, end+1, yyy+k3+2, iemgui_vu_scale_str[i/4], - i, x1, y1, + i, x1, y1 - 3, x->x_gui.x_fontsize, sys_fontweight); } @@ -428,10 +428,10 @@ static void vu_getrect(t_gobj *z, t_glist *glist, static void vu_save(t_gobj *z, t_binbuf *b) { t_vu *x = (t_vu *)z; - int bflcol[3]; + t_symbol *bflcol[3]; t_symbol *srl[3]; iemgui_save(&x->x_gui, srl, bflcol); - binbuf_addv(b, "ssiisiissiiiiiiii;", gensym("#X"),gensym("obj"), + binbuf_addv(b, "ssiisiissiiiissii;", gensym("#X"),gensym("obj"), (int)x->x_gui.x_obj.te_xpix, (int)x->x_gui.x_obj.te_ypix, gensym("vu"), x->x_gui.x_w, x->x_gui.x_h, srl[1], srl[2], x->x_gui.x_ldx, x->x_gui.x_ldy, @@ -648,19 +648,22 @@ static void vu_bang(t_vu *x) static void *vu_new(t_symbol *s, int argc, t_atom *argv) { t_vu *x = (t_vu *)pd_new(vu_class); - int bflcol[] = {-66577, -1, -1}; int w = IEM_GUI_DEFAULTSIZE, h = IEM_VU_STEPS*IEM_VU_DEFAULTSIZE; int ldx = -1, ldy = -8, fs = 10, scale = 1; iem_inttosymargs(&x->x_gui, 0); iem_inttofstyle(&x->x_gui, 0); + x->x_gui.x_bcol = 0x404040; + x->x_gui.x_fcol = 0x00; + x->x_gui.x_lcol = 0x00; + if((argc >= 11)&&IS_A_FLOAT(argv,0)&&IS_A_FLOAT(argv,1) &&(IS_A_SYMBOL(argv,2)||IS_A_FLOAT(argv,2)) &&(IS_A_SYMBOL(argv,3)||IS_A_FLOAT(argv,3)) &&IS_A_FLOAT(argv,4)&&IS_A_FLOAT(argv,5) &&IS_A_FLOAT(argv,6)&&IS_A_FLOAT(argv,7) - &&IS_A_FLOAT(argv,8)&&IS_A_FLOAT(argv,9)&&IS_A_FLOAT(argv,10)) + &&IS_A_FLOAT(argv,10)) { w = atom_getintarg(0, argc, argv); h = atom_getintarg(1, argc, argv); @@ -669,8 +672,7 @@ static void *vu_new(t_symbol *s, int argc, t_atom *argv) ldy = atom_getintarg(5, argc, argv); iem_inttofstyle(&x->x_gui, atom_getintarg(6, argc, argv)); fs = maxi(atom_getintarg(7, argc, argv),4); - bflcol[0] = atom_getintarg(8, argc, argv); - bflcol[2] = atom_getintarg(9, argc, argv); + iemgui_all_loadcolors(&x->x_gui, argv+8, NULL, argv+9); scale = !!atom_getintarg(10, argc, argv); } else iemgui_new_getnames(&x->x_gui, 1, 0); @@ -688,7 +690,6 @@ static void *vu_new(t_symbol *s, int argc, t_atom *argv) x->x_gui.x_fontsize = fs; x->x_gui.x_w = iemgui_clip_size(w); vu_check_height(x, h); - iemgui_all_colfromload(&x->x_gui, bflcol); x->x_scale = scale; x->x_peak = 0; x->x_rms = 0; diff --git a/pd/src/import.c b/pd/src/import.c index 72df5e2fbb24a10fdcea4d43df6d1b8205bbbf54..c12fc1c01fef25cee392c1f2b7f3c076ca41ad0b 100644 --- a/pd/src/import.c +++ b/pd/src/import.c @@ -105,7 +105,8 @@ static void import_output(t_import* x) * namespace, [import] will output the new element on the next bang. */ if(x->x_current) { - strncpy(buffer, x->x_current->nl_string, MAXPDSTRING); + strncpy(buffer, x->x_current->nl_string, MAXPDSTRING-1); + buffer[MAXPDSTRING-1] = 0; outlet_symbol( x->x_data_outlet, gensym(buffer)); x->x_current = x->x_current->nl_next; } diff --git a/pd/src/m_class.c b/pd/src/m_class.c index a9d296369656927a5b2948915e71858ed620bc23..c582318b9cdde1a9d2e290df08eb45c59bbacd5d 100644 --- a/pd/src/m_class.c +++ b/pd/src/m_class.c @@ -99,18 +99,29 @@ char *type_hint(t_symbol *s, int argc, t_atom *argv, int dostof) { if (symbol_can_float(atom_getsymbolarg(0, argc, argv), &f)) { - sprintf(hint, " (Note: this symbol message has a floatlike payload " - "which cannot be saved properly. Did you mean 'float %s'?)", - argv->a_w.w_symbol->s_name); + if (s == &s_symbol) + sprintf(hint, " (Warning: symbol message with numeric payload " + "detected. This data cannot be saved properly in a patch."); + else + sprintf(hint, " (Note: '%s' is actually a symbol atom, not " + "a float)", + argv->a_w.w_symbol->s_name); return hint; } else if (f == -1 || f == 1) { /* For values which would overflow, give a hint but don't suggest float type */ - sprintf(hint, " (Note: this symbol message has an %s floatlike " - "payload which cannot be saved properly.", - f == 1 ? "overflowing" : "underflowing"); + if (s == &s_symbol) + sprintf(hint, " (Note: this symbol message has an %s floatlike " + "payload which cannot be saved properly.", + f == 1 ? "overflowing" : "underflowing"); + else + sprintf(hint, " (Note: '%s' is actually a symbol atom. If you " + "save it Pd will parse it as a float and cause an %s " + "error.", + argv->a_w.w_symbol->s_name, + f == 1 ? "overflow" : "underflow"); return hint; } } @@ -129,13 +140,33 @@ char *type_hint(t_symbol *s, int argc, t_atom *argv, int dostof) { /* For values which would overflow, give a hint but don't suggest float type */ - sprintf(hint, " (Note: this symbol atom has an %s floatlike " + sprintf(hint, " (Note: the symbol atom '%s' has an %s floatlike " "payload which cannot be saved properly.", + s->s_name, f == 1 ? "overflowing" : "underflowing"); return hint; } } + /* Now that we've checked for symbols that could be floats, let's + catch the generic case where a user entered a symbol payload for a + "float" message. This can be typed into a messsage box, for + example. We also check for empty symbol payload here, and other + odd atom types */ + if (s && s == &s_float && argc && argv->a_type != A_FLOAT) + { + if (argv->a_type == A_SYMBOL && argv->a_w.w_symbol == &s_) + sprintf(hint, " (Expected a float argument but got empty symbol)"); + else if (argv->a_type == A_SYMBOL) + sprintf(hint, " (Expected a float argument but got '%s')", + argv->a_w.w_symbol->s_name); + else if (argv->a_type == A_POINTER) + sprintf(hint, " (Expected a float argument but got a gpointer)"); + else + sprintf(hint, " (Note: got an argument that's not a float)"); + return hint; + } + hint[0] = '\0'; return hint; } @@ -150,7 +181,7 @@ static void pd_defaultanything(t_pd *x, t_symbol *s, int argc, t_atom *argv) static void pd_defaultbang(t_pd *x) { if (*(*x)->c_listmethod != pd_defaultlist) - (*(*x)->c_listmethod)(x, 0, 0, 0); + (*(*x)->c_listmethod)(x, &s_bang, 0, 0); else (*(*x)->c_anymethod)(x, &s_bang, 0, 0); } @@ -165,7 +196,7 @@ static void pd_defaultpointer(t_pd *x, t_gpointer *gp) { t_atom at; SETPOINTER(&at, gp); - (*(*x)->c_listmethod)(x, 0, 1, &at); + (*(*x)->c_listmethod)(x, &s_pointer, 1, &at); } else { @@ -181,7 +212,7 @@ static void pd_defaultfloat(t_pd *x, t_float f) { t_atom at; SETFLOAT(&at, f); - (*(*x)->c_listmethod)(x, 0, 1, &at); + (*(*x)->c_listmethod)(x, &s_float, 1, &at); } else { @@ -197,7 +228,7 @@ static void pd_defaultsymbol(t_pd *x, t_symbol *s) { t_atom at; SETSYMBOL(&at, s); - (*(*x)->c_listmethod)(x, 0, 1, &at); + (*(*x)->c_listmethod)(x, &s_symbol, 1, &at); } else { @@ -439,6 +470,11 @@ void class_addmethod(t_class *c, t_method fn, t_symbol *sel, t_atomtype argtype = arg1; int nargs; + if (!c) + { + bug("class_addmethod"); + return; + } va_start(ap, arg1); /* "signal" method specifies that we take audio signals but that we don't want automatic float to signal conversion. This @@ -527,61 +563,121 @@ phooey: /* Instead of these, see the "class_addfloat", etc., macros in m_pd.h */ void class_addbang(t_class *c, t_method fn) { + if (!c) + { + bug("class_addbang"); + return; + } c->c_bangmethod = (t_bangmethod)fn; } void class_addpointer(t_class *c, t_method fn) { + if (!c) + { + bug("class_addpointer"); + return; + } c->c_pointermethod = (t_pointermethod)fn; } void class_doaddfloat(t_class *c, t_method fn) { + if (!c) + { + bug("class_doaddfloat"); + return; + } c->c_floatmethod = (t_floatmethod)fn; } void class_addsymbol(t_class *c, t_method fn) { + if (!c) + { + bug("class_addsymbol"); + return; + } c->c_symbolmethod = (t_symbolmethod)fn; } void class_addblob(t_class *c, t_method fn) /* MP 20061226 blob type */ { + if (!c) + { + bug("class_addblob"); + return; + } c->c_blobmethod = (t_blobmethod)fn; } void class_addlist(t_class *c, t_method fn) { + if (!c) + { + bug("class_addlist"); + return; + } c->c_listmethod = (t_listmethod)fn; } void class_addanything(t_class *c, t_method fn) { + if (!c) + { + bug("class_addanything"); + return; + } c->c_anymethod = (t_anymethod)fn; } void class_setwidget(t_class *c, t_widgetbehavior *w) { + if (!c) + { + bug("class_setwidget"); + return; + } c->c_wb = w; } void class_setparentwidget(t_class *c, t_parentwidgetbehavior *pw) { + if (!c) + { + bug("class_setparentwidget"); + return; + } c->c_pwb = pw; } char *class_getname(t_class *c) { + if (!c) + { + bug("class_getname"); + return 0; + } return (c->c_name->s_name); } char *class_gethelpname(t_class *c) { + if (!c) + { + bug("class_gethelpname"); + return 0; + } return (c->c_helpname->s_name); } void class_sethelpsymbol(t_class *c, t_symbol *s) { + if (!c) + { + bug("class_sethelpsymbol"); + return; + } c->c_helpname = s; } @@ -592,11 +688,21 @@ t_parentwidgetbehavior *pd_getparentwidget(t_pd *x) void class_setdrawcommand(t_class *c) { + if (!c) + { + bug("class_setdrawcommand"); + return; + } c->c_drawcommand = 1; } int class_isdrawcommand(t_class *c) { + if (!c) + { + bug("class_isdrawcommand"); + return 0; + } return (c->c_drawcommand); } @@ -612,6 +718,11 @@ static void pd_floatforsignal(t_pd *x, t_float f) void class_domainsignalin(t_class *c, int onset) { + if (!c) + { + bug("class_domainsignalin"); + return; + } if (onset <= 0) onset = -1; else { @@ -629,6 +740,11 @@ void class_set_extern_dir(t_symbol *s) char *class_gethelpdir(t_class *c) { + if (!c) + { + bug("class_gethelpdir"); + return 0; + } return (c->c_externdir->s_name); } @@ -639,21 +755,41 @@ static void class_nosavefn(t_gobj *z, t_binbuf *b) void class_setsavefn(t_class *c, t_savefn f) { + if (!c) + { + bug("class_setsavefn"); + return; + } c->c_savefn = f; } t_savefn class_getsavefn(t_class *c) { + if (!c) + { + bug("class_getsavefn"); + return 0; + } return (c->c_savefn); } void class_setpropertiesfn(t_class *c, t_propertiesfn f) { + if (!c) + { + bug("class_setpropertiesfn"); + return; + } c->c_propertiesfn = f; } t_propertiesfn class_getpropertiesfn(t_class *c) { + if (!c) + { + bug("class_getpropertiesfn"); + return 0; + } return (c->c_propertiesfn); } @@ -986,8 +1122,10 @@ badarg: message that contains it (so it can be selected when 'Find Error' is used). */ x = pd_mess_from_responder(x); - pd_error(x, "Bad arguments for message '%s' to object '%s'", - s->s_name, c->c_name->s_name); + pd_error(x, "Bad arguments for message '%s' to object '%s'%s", + s->s_name, + c->c_name->s_name, + type_hint(s, argc, argv, 1)); lastmess: last_typedmess = s; last_typedmess_pd = x; @@ -1063,7 +1201,10 @@ t_gotfn getfn(t_pd *x, t_symbol *s) for (i = c->c_nmethod, m = c->c_methods; i--; m++) if (m->me_name == s) return(m->me_fun); - pd_error(x, "%s: no method for message '%s'", c->c_name->s_name, s->s_name); + pd_error(x, "%s: no method for message '%s'%s", + c->c_name->s_name, + s->s_name, + type_hint(s, 0, 0, 1)); return((t_gotfn)nullfn); } @@ -1077,3 +1218,37 @@ t_gotfn zgetfn(t_pd *x, t_symbol *s) if (m->me_name == s) return(m->me_fun); return(0); } + +t_gotfn zcheckgetfn(t_pd *x, t_symbol *s, t_atomtype arg1, ...) +{ + t_class *c = *x; + t_methodentry *m; + int i, j; + + /* get arg types */ + va_list ap; + int nargs = 0; + t_atomtype args[MAXPDARG+1], curr = arg1; + va_start(ap, arg1); + while (curr != A_NULL && nargs < MAXPDARG) + { + args[nargs++] = curr; + curr = va_arg(ap, t_atomtype); + } + if (curr != A_NULL) error("zcheckgetfn: only 5 arguments are typecheckable"); + args[nargs] = A_NULL; + va_end(ap); + + for (i = c->c_nmethod, m = c->c_methods; i--; m++) + { + if (m->me_name == s) + { + j = 0; + /* both argtype lists are valid, dont need to check whether j < MAXDPARG */ + while(m->me_arg[j] != A_NULL && args[j] != A_NULL + && m->me_arg[j] == args[j]) j++; + if(m->me_arg[j] == A_NULL && args[j] == A_NULL) return(m->me_fun); + } + } + return(0); +} diff --git a/pd/src/m_glob.c b/pd/src/m_glob.c index a67a4f61f263fb4af01a7fb64f6af90514c10dbe..6fca411ca59a08070c0c2b2fd9ee2a0da4f41eb7 100644 --- a/pd/src/m_glob.c +++ b/pd/src/m_glob.c @@ -79,12 +79,13 @@ static void glob_perf(t_pd *dummy, float f) sys_perf = (f != 0); } -extern int sys_zoom, sys_browser_doc, sys_browser_path, sys_browser_init, +extern int sys_grid, sys_zoom, sys_browser_doc, sys_browser_path, sys_browser_init, sys_autopatch_yoffset; extern t_symbol *sys_gui_preset; static void glob_gui_prefs(t_pd *dummy, t_symbol *s, int argc, t_atom *argv) { sys_gui_preset = atom_getsymbolarg(0, argc--, argv++); + sys_grid = !!atom_getintarg(0, argc--, argv++); sys_zoom = !!atom_getintarg(0, argc--, argv++); sys_browser_doc = !!atom_getintarg(0, argc--, argv++); sys_browser_path = !!atom_getintarg(0, argc--, argv++); @@ -95,9 +96,10 @@ static void glob_gui_prefs(t_pd *dummy, t_symbol *s, int argc, t_atom *argv) /* just the gui-preset, the save-zoom toggle and various help browser options for now */ static void glob_gui_properties(t_pd *dummy) { - gui_vmess("gui_gui_properties", "xsiiiii", + gui_vmess("gui_gui_properties", "xsiiiiii", dummy, sys_gui_preset->s_name, + sys_grid, sys_zoom, sys_browser_doc, sys_browser_path, @@ -105,6 +107,12 @@ static void glob_gui_properties(t_pd *dummy) sys_autopatch_yoffset); } +int sys_gui_busy; +static void glob_gui_busy(void *dummy, t_float f) +{ + sys_gui_busy = f != 0; +} + // ths one lives inside g_editor so that it can access the clipboard extern void glob_clipboard_text(t_pd *dummy, float f); @@ -199,6 +207,8 @@ void glob_init(void) gensym("add-recent-file"), A_SYMBOL, 0); class_addmethod(glob_pdobject, (t_method)glob_clear_recent_files, gensym("clear-recent-files"), 0); + class_addmethod(glob_pdobject, (t_method)glob_gui_busy, gensym("gui-busy"), + A_DEFFLOAT, 0); #ifdef UNIX class_addmethod(glob_pdobject, (t_method)glob_watchdog, gensym("watchdog"), 0); diff --git a/pd/src/m_memory.c b/pd/src/m_memory.c index 39d77babc4e1ff44b82051a49bee923f0a575031..f28b47e32c5f2439a2c827c0261d1ee1bd276aec 100644 --- a/pd/src/m_memory.c +++ b/pd/src/m_memory.c @@ -25,7 +25,7 @@ void *getbytes(size_t nbytes) ret = (void *)calloc(nbytes, 1); #ifdef LOUD - fprintf(stderr, "new %lx %d\n", (int)ret, nbytes); + fprintf(stderr, "new %zx %d\n", (int)ret, nbytes); #endif /* LOUD */ #ifdef DEBUGMEM @@ -59,7 +59,7 @@ void *resizebytes(void *old, size_t oldsize, size_t newsize) if (newsize > oldsize && ret) memset(((char *)ret) + oldsize, 0, newsize - oldsize); #ifdef LOUD - fprintf(stderr, "resize %lx %d --> %lx %d\n", (int)old, oldsize, (int)ret, newsize); + fprintf(stderr, "resize %zx %d --> %zx %d\n", (int)old, oldsize, (int)ret, newsize); #endif /* LOUD */ #ifdef DEBUGMEM totalmem += (newsize - oldsize); @@ -74,7 +74,7 @@ void freebytes(void *fatso, size_t nbytes) if (nbytes == 0) nbytes = 1; #ifdef LOUD - fprintf(stderr, "free %lx %d\n", (int)fatso, nbytes); + fprintf(stderr, "free %zx %d\n", (int)fatso, nbytes); #endif /* LOUD */ #ifdef DEBUGMEM totalmem -= nbytes; diff --git a/pd/src/m_obj.c b/pd/src/m_obj.c index ea1dd5dd2b73ddcaee60de608b2dbfe9072998e8..725ecf42514a51b4d7274165ecd502d0611070e1 100644 --- a/pd/src/m_obj.c +++ b/pd/src/m_obj.c @@ -80,6 +80,36 @@ static void inlet_wrong(t_inlet *x, t_symbol *s, int argc, t_atom *argv) x->i_symfrom->s_name, s->s_name, type_hint(s, argc, argv, 1)); } + /* forward a message to an inlet~ object */ +static int inlet_fwd(t_inlet *x, t_symbol *s, int argc, t_atom *argv) +{ + if(x->i_symfrom == &s_signal + && zcheckgetfn(x->i_dest, gensym("fwd"), A_GIMME, A_NULL)) + { + mess3(x->i_dest, gensym("fwd"), s, argc, argv); + return 1; + } + return 0; +} + +static int inlet_fwd_symbol(t_inlet *x, t_symbol *s) +{ + t_atom sym; SETSYMBOL(&sym, s); + return inlet_fwd(x, &s_symbol, 1, &sym); +} + +static int inlet_fwd_blob(t_inlet *x, t_blob *st) +{ + t_atom blob; SETBLOB(&blob, st); + return inlet_fwd(x, &s_blob, 1, &blob); +} + +static int inlet_fwd_pointer(t_inlet *x, t_gpointer *gp) +{ + t_atom ptr; SETPOINTER(&ptr, gp); + return inlet_fwd(x, &s_pointer, 1, &ptr); +} + static void inlet_list(t_inlet *x, t_symbol *s, int argc, t_atom *argv); /* LATER figure out how to make these efficient: */ @@ -90,7 +120,8 @@ static void inlet_bang(t_inlet *x) else if (!x->i_symfrom) pd_bang(x->i_dest); else if (x->i_symfrom == &s_list) inlet_list(x, &s_bang, 0, 0); - else inlet_wrong(x, &s_bang, 0, 0); + else if (!inlet_fwd(x, &s_bang, 0, 0)) + inlet_wrong(x, &s_bang, 0, 0); } static void inlet_pointer(t_inlet *x, t_gpointer *gp) @@ -104,7 +135,8 @@ static void inlet_pointer(t_inlet *x, t_gpointer *gp) SETPOINTER(&a, gp); inlet_list(x, &s_pointer, 1, &a); } - else inlet_wrong(x, &s_pointer, 0, 0); + else if (!inlet_fwd_pointer(x, gp)) + inlet_wrong(x, &s_pointer, 0, 0); } static void inlet_float(t_inlet *x, t_float f) @@ -129,7 +161,7 @@ static void inlet_symbol(t_inlet *x, t_symbol *s) if (x->i_symfrom == &s_symbol) pd_vmess(x->i_dest, x->i_symto, "s", s); else if (!x->i_symfrom) pd_symbol(x->i_dest, s); - else + else if (!inlet_fwd_symbol(x, s)) { t_atom a; SETSYMBOL(&a, s); @@ -153,7 +185,7 @@ static void inlet_blob(t_inlet *x, t_blob *st) /* MP20061226 blob type */ /*post("inlet_blob calling pd_blob");*/ pd_blob(x->i_dest, st); } - else + else if (!inlet_fwd_blob(x, st)) { /*post("inlet_blob calling inlet_wrong");*/ inlet_wrong(x, &s_blob, 0, 0); @@ -172,7 +204,8 @@ static void inlet_list(t_inlet *x, t_symbol *s, int argc, t_atom *argv) inlet_float(x, atom_getfloat(argv)); else if (argc==1 && argv->a_type == A_SYMBOL) inlet_symbol(x, atom_getsymbol(argv)); - else inlet_wrong(x, &s_list, 0, 0); + else if (!inlet_fwd(x, &s_list, argc, argv)) + inlet_wrong(x, &s_list, 0, 0); } static void inlet_anything(t_inlet *x, t_symbol *s, int argc, t_atom *argv) @@ -181,7 +214,8 @@ static void inlet_anything(t_inlet *x, t_symbol *s, int argc, t_atom *argv) typedmess(x->i_dest, x->i_symto, argc, argv); else if (!x->i_symfrom) typedmess(x->i_dest, s, argc, argv); - else inlet_wrong(x, s, 0, 0); + else if (!inlet_fwd(x, s, argc, argv)) + inlet_wrong(x, s, 0, 0); } void inlet_free(t_inlet *x) diff --git a/pd/src/m_pd.c b/pd/src/m_pd.c index 7e2f9826933a85f455bb9167741d3ae59a546925..dc69076d44ad1d9cbe5ebddb73ecbaa7df6ed70b 100644 --- a/pd/src/m_pd.c +++ b/pd/src/m_pd.c @@ -198,7 +198,7 @@ void pd_bind(t_pd *x, t_symbol *s) { if (*s->s_thing == bindlist_class) { - //fprintf(stderr," pd_bind option 1A %lx\n", (t_int)x); + //fprintf(stderr," pd_bind option 1A %zx\n", (t_uint)x); t_bindlist *b = (t_bindlist *)s->s_thing; t_bindelem *e = (t_bindelem *)getbytes(sizeof(t_bindelem)); e->e_next = b->b_list; @@ -208,7 +208,7 @@ void pd_bind(t_pd *x, t_symbol *s) } else { - //fprintf(stderr," pd_bind option 1B %lx\n", (t_int)x); + //fprintf(stderr," pd_bind option 1B %zx\n", (t_uint)x); t_bindlist *b = (t_bindlist *)pd_new(bindlist_class); t_bindelem *e1 = (t_bindelem *)getbytes(sizeof(t_bindelem)); t_bindelem *e2 = (t_bindelem *)getbytes(sizeof(t_bindelem)); @@ -223,7 +223,7 @@ void pd_bind(t_pd *x, t_symbol *s) } } else { - //fprintf(stderr,"pd_bind option 2 %lx\n", (t_int)x); + //fprintf(stderr,"pd_bind option 2 %zx\n", (t_uint)x); s->s_thing = x; } } @@ -232,7 +232,7 @@ void pd_unbind(t_pd *x, t_symbol *s) { //fprintf(stderr,"pd_unbind %s\n", s->s_name); if (s->s_thing == x) { - //fprintf(stderr," pd_unbind option A %lx\n", (t_int)x); + //fprintf(stderr," pd_unbind option A %zx\n", (t_uint)x); s->s_thing = 0; } else if (s->s_thing && *s->s_thing == bindlist_class) @@ -248,7 +248,7 @@ void pd_unbind(t_pd *x, t_symbol *s) which we call bindlist_cleanup(). we control the execution via static int variable change_bindlist_via_graph */ - //fprintf(stderr," pd_unbind option B %lx\n", (t_int)x); + //fprintf(stderr," pd_unbind option B %zx\n", (t_uint)x); t_bindlist *b = (t_bindlist *)s->s_thing; t_bindelem *e, *e2; @@ -330,7 +330,7 @@ t_pd *pd_findbyclass(t_symbol *s, t_class *c) //fprintf(stderr, "(e_who == c)?%d || e->e_delayed_free=%d\n", (*e->e_who == c ? 1 : 0), e->e_delayed_free); if (e->e_delayed_free != 1 && *e->e_who == c) { - //fprintf(stderr,"...found %lx", e); + //fprintf(stderr,"...found %zx", e); if (x && !warned) { zz(); diff --git a/pd/src/m_pd.h b/pd/src/m_pd.h index 7fe41825464f833327f9538de69811f3291c30bc..534b2c069c6532f20970126284baf67c0bd0b9a7 100644 --- a/pd/src/m_pd.h +++ b/pd/src/m_pd.h @@ -14,7 +14,7 @@ extern "C" { #define PD_MINOR_VERSION 48 #define PD_BUGFIX_VERSION 0 #define PD_TEST_VERSION "" -#define PD_L2ORK_VERSION "2.12.0" +#define PD_L2ORK_VERSION "2.15.2" #define PDL2ORK extern int pd_compatibilitylevel; /* e.g., 43 for pd 0.43 compatibility */ @@ -87,8 +87,19 @@ typedef unsigned __int64 uint64_t; /* signed and unsigned integer types the size of a pointer: */ #if !defined(PD_LONGINTTYPE) +#if defined(_WIN32) && defined(_WIN64) +#define PD_LONGINTTYPE long long +#else #define PD_LONGINTTYPE long #endif +#endif +#if !defined(PD_LONGUINTTYPE) +#if defined(_WIN32) && defined(_WIN64) +#define PD_LONGUINTTYPE unsigned long long +#else +#define PD_LONGUINTTYPE unsigned long +#endif +#endif #if !defined(PD_FLOATSIZE) #define PD_FLOATSIZE 32 /* 32 for single precision or 64 for double precision */ @@ -103,6 +114,7 @@ typedef unsigned __int64 uint64_t; #endif typedef PD_LONGINTTYPE t_int; /* pointer-size integer */ +typedef PD_LONGUINTTYPE t_uint; /* pointer-size unsigned integer */ typedef PD_FLOATTYPE t_float; /* a float type at most the same size */ typedef PD_FLOATTYPE t_floatarg; /* float type for function calls */ @@ -305,6 +317,7 @@ EXTERN void pd_forwardmess(t_pd *x, int argc, t_atom *argv); EXTERN t_symbol *gensym(const char *s); EXTERN t_gotfn getfn(t_pd *x, t_symbol *s); EXTERN t_gotfn zgetfn(t_pd *x, t_symbol *s); +EXTERN t_gotfn zcheckgetfn(t_pd *x, t_symbol *s, t_atomtype arg1, ...); EXTERN void nullfn(void); EXTERN void pd_vmess(t_pd *x, t_symbol *s, char *fmt, ...); #define mess0(x, s) ((*getfn((x), (s)))((x))) @@ -556,6 +569,7 @@ EXTERN int sys_isreadablefile(const char *name); EXTERN int sys_isabsolutepath(const char *dir); EXTERN void sys_bashfilename(const char *from, char *to); EXTERN void sys_unbashfilename(const char *from, char *to); +EXTERN int sys_relativizepath(const char *from, const char *to, char *result); EXTERN int open_via_path(const char *name, const char *ext, const char *dir, char *dirresult, char **nameresult, unsigned int size, int bin); EXTERN int sched_geteventno(void); @@ -691,6 +705,7 @@ EXTERN void garray_setsaveit(t_garray *x, int saveit); EXTERN t_glist *garray_getglist(t_garray *x); EXTERN t_array *garray_getarray(t_garray *x); EXTERN t_class *scalar_class; +EXTERN t_class *text_class; EXTERN t_float *value_get(t_symbol *s); EXTERN void value_release(t_symbol *s); @@ -712,7 +727,7 @@ EXTERN void sys_vguid(const char *file, int line, const char *fmt, ...); EXTERN void sys_vvguid(const char *file, int line, const char *fmt, va_list); #endif EXTERN void sys_gui(const char *s); -#define sys_vgui(args...) sys_vguid(__FILE__,__LINE__,args) +#define sys_vgui(...) sys_vguid(__FILE__,__LINE__,__VA_ARGS__) #define sys_gui(s) sys_vguid(__FILE__,__LINE__,"%s",s) EXTERN void gui_vmess(const char *sel, char *fmt, ...); /* some more gui interfaces for building incremental messages */ @@ -721,7 +736,7 @@ EXTERN void gui_start_array(void); EXTERN void gui_f(t_float f); /* send a float element in an array */ EXTERN void gui_i(int i); /* send an int element in an array */ EXTERN void gui_s(const char *s); /* send a string element in an array */ -EXTERN void gui_x(long unsigned int i); +EXTERN void gui_x(t_uint i); EXTERN void gui_end_array(void); EXTERN void gui_end_vmess(void); diff --git a/pd/src/m_sched.c b/pd/src/m_sched.c index e51d64038efa9ce0fe460236ef44c80f1c45559c..50654791f6a49104d0e3b893110dba558d2f345c 100644 --- a/pd/src/m_sched.c +++ b/pd/src/m_sched.c @@ -312,11 +312,12 @@ static void sched_pollformeters( void) { int inclip, outclip, indb, outdb; static int sched_nextmeterpolltime, sched_nextpingtime; + extern int sys_gui_busy; /* if there's no GUI but we're running in "realtime", here is where we arrange to ping the watchdog every 2 seconds. */ #if defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__GNU__) - if (sys_nogui && sys_hipriority && (sched_diddsp - sched_nextpingtime > 0)) + if ((sys_nogui||sys_gui_busy) && sys_hipriority && (sched_diddsp - sched_nextpingtime > 0)) { glob_watchdog(0); /* ping every 2 seconds */ diff --git a/pd/src/makefile.mingw b/pd/src/makefile.mingw index 845bf5989b1bfc1bdc7d99bd85748272bf4d7cbf..c62b9eaafbe80cbaaf4f9e45b86b048c4392b317 100755 --- a/pd/src/makefile.mingw +++ b/pd/src/makefile.mingw @@ -62,11 +62,16 @@ WARN_CFLAGS = -Wall -W -Wstrict-prototypes -Wno-unused \ # next minor version of Windows, 5.2. ARCH_CFLAGS = -DPD -DPD_INTERNAL -DMSW -DPA_USE_ASIO -DPA_USE_WMME \ -DWINVER=0x0502 -DUSEAPI_MMIO -DUSEAPI_PORTAUDIO -mms-bitfields \ - -DWISHAPP='"wish85.exe"' + -DWISHAPP='"wish85.exe"' -D__USE_MINGW_ANSI_STDIO=1 CFLAGS += $(ARCH_CFLAGS) $(WARN_CFLAGS) $(OPT_CFLAGS) $(MORECFLAGS) +ifeq ($(filter -g -ggdb, $(CFLAGS)),) STRIP = strip --strip-unneeded -R .note -R .comment +else +# don't strip, we need the debugging symbols +STRIP = true +endif # the sources diff --git a/pd/src/s_audio_alsa.c b/pd/src/s_audio_alsa.c index cb59b0966f7d29fbdc4773c6be4bb18d79575134..3b91c69236e151615c8397d160ae52f532baef86 100644 --- a/pd/src/s_audio_alsa.c +++ b/pd/src/s_audio_alsa.c @@ -169,7 +169,7 @@ static int alsaio_setup(t_alsa_dev *dev, int out, int *channels, int *rate, /* set the sampling rate */ err = snd_pcm_hw_params_set_rate_min(dev->a_handle, hw_params, (unsigned int *)rate, 0); - check_error(err, "snd_pcm_hw_params_set_rate_min (input)"); + check_error(err, "snd_pcm_hw_params_set_rate_min"); #if 0 err = snd_pcm_hw_params_get_rate(hw_params, &subunitdir); post("input sample rate %d", err); @@ -185,7 +185,7 @@ static int alsaio_setup(t_alsa_dev *dev, int out, int *channels, int *rate, err = snd_pcm_hw_params_set_period_size_near(dev->a_handle, hw_params, &tmp_snd_pcm_uframes, 0); #endif - check_error(err, "snd_pcm_hw_params_set_period_size_near (input)"); + check_error(err, "snd_pcm_hw_params_set_period_size_near"); /* set the buffer size */ #ifdef ALSAAPI9 @@ -196,10 +196,10 @@ static int alsaio_setup(t_alsa_dev *dev, int out, int *channels, int *rate, err = snd_pcm_hw_params_set_buffer_size_near(dev->a_handle, hw_params, &tmp_snd_pcm_uframes); #endif - check_error(err, "snd_pcm_hw_params_set_buffer_size_near (input)"); + check_error(err, "snd_pcm_hw_params_set_buffer_size_near"); err = snd_pcm_hw_params(dev->a_handle, hw_params); - check_error(err, "snd_pcm_hw_params (input)"); + check_error(err, "snd_pcm_hw_params"); /* set up the buffer */ bufsizeforthis = DEFDACBLKSIZE * dev->a_sampwidth * *channels; @@ -254,7 +254,7 @@ int alsa_open_audio(int naudioindev, int *audioindev, int nchindev, alsa_numbertoname(audioindev[iodev], devname, 512); err = snd_pcm_open(&alsa_indev[alsa_nindev].a_handle, devname, SND_PCM_STREAM_CAPTURE, SND_PCM_NONBLOCK); - check_error(err, "snd_pcm_open"); + check_error(err, "snd_pcm_open (input)"); if (err < 0) continue; alsa_indev[alsa_nindev].a_devno = audioindev[iodev]; @@ -268,7 +268,7 @@ int alsa_open_audio(int naudioindev, int *audioindev, int nchindev, alsa_numbertoname(audiooutdev[iodev], devname, 512); err = snd_pcm_open(&alsa_outdev[alsa_noutdev].a_handle, devname, SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK); - check_error(err, "snd_pcm_open"); + check_error(err, "snd_pcm_open (output)"); if (err < 0) continue; alsa_outdev[alsa_noutdev].a_devno = audiooutdev[iodev]; @@ -421,7 +421,8 @@ int alsa_send_dacs(void) callno++; #endif - alsa_checkiosync(); /* check I/O are in sync and data not late */ + if (alsa_nindev > 0 && alsa_noutdev > 0) + alsa_checkiosync(); /* check I/O are in sync and data not late */ for (iodev = 0; iodev < alsa_nindev; iodev++) { @@ -746,10 +747,10 @@ static void alsa_checkiosync( void) } if (result < 0) { - post("output snd_pcm_delay failed: %s", snd_strerror(result)); - if (snd_pcm_status(alsa_outdev[iodev].a_handle, + post("input snd_pcm_delay failed: %s", snd_strerror(result)); + if (snd_pcm_status(alsa_indev[iodev].a_handle, alsa_status) < 0) - post("output snd_pcm_status failed"); + post("input snd_pcm_status failed"); else post("astate %d", snd_pcm_status_get_state(alsa_status)); return; @@ -838,19 +839,29 @@ void alsa_getdevs(char *indevlist, int *nindevs, char *outdevlist, int *noutdevs, int *canmulti, int maxndev, int devdescsize) { - int ndev = 0, cardno = -1, i, j; + int ndev = 0, cardno = -1; *canmulti = 2; /* supports multiple devices */ + + /* First list devices from the -alsa-adddev command line arg */ + for (ndev = 0; ndev < alsa_nnames; ndev++) + { + if (ndev >= maxndev) + break; + snprintf(indevlist + ndev * devdescsize, devdescsize, "%s", + alsa_names[ndev]); + snprintf(outdevlist + ndev * devdescsize, devdescsize, "%s", + alsa_names[ndev]); + } + + /* Then query hardware devices from ALSA */ while (!snd_card_next(&cardno) && cardno >= 0) { snd_ctl_t *ctl; snd_ctl_card_info_t *info = NULL; char devname[80]; const char *desc; - if (2 * ndev + 2 > maxndev) + if (ndev + 2 > maxndev) break; - /* apparently, "cardno" is just a counter; but check that here */ - if (ndev != cardno) - fprintf(stderr, "oops: ALSA cards not reported in order?\n"); sprintf(devname, "hw:%d", cardno); // fprintf(stderr, "\ntry %s...\n", devname); if (snd_ctl_open(&ctl, devname, 0) >= 0) @@ -865,23 +876,17 @@ void alsa_getdevs(char *indevlist, int *nindevs, desc = "???"; } /* fprintf(stderr, "name: %s\n", snd_ctl_card_info_get_name(info)); */ - sprintf(indevlist + 2*ndev * devdescsize, "%s (hardware)", desc); - sprintf(indevlist + (2*ndev + 1) * devdescsize, "%s (plug-in)", desc); - sprintf(outdevlist + 2*ndev * devdescsize, "%s (hardware)", desc); - sprintf(outdevlist + (2*ndev + 1) * devdescsize, "%s (plug-in)", desc); - ndev++; + sprintf(indevlist + ndev * devdescsize, "%s (hardware)", desc); + sprintf(indevlist + (ndev + 1) * devdescsize, "%s (plug-in)", desc); + sprintf(outdevlist + ndev * devdescsize, "%s (hardware)", desc); + sprintf(outdevlist + (ndev + 1) * devdescsize, "%s (plug-in)", desc); + ndev += 2; if (info) { snd_ctl_card_info_free(info); info = NULL; } } - for (i = 0, j = 2*ndev; i < alsa_nnames; i++, j++) - { - if (j >= maxndev) - break; - snprintf(indevlist + j * devdescsize, devdescsize, "%s", - alsa_names[i]); - } - *nindevs = *noutdevs = j; + + *nindevs = *noutdevs = ndev; } diff --git a/pd/src/s_audio_alsamm.c b/pd/src/s_audio_alsamm.c index 604d0fe761b43724741959e88a487137a9b82cc3..10544969377781dce8b026690d351628fd1346eb 100644 --- a/pd/src/s_audio_alsamm.c +++ b/pd/src/s_audio_alsamm.c @@ -242,7 +242,7 @@ int alsamm_open_audio(int rate, int blocksize) for(i=0;i<alsa_noutdev;i++) { - /* post("open audio out %d, of %lx, %d",i,&alsa_device[i], + /* post("open audio out %d, of %zx, %d",i,&alsa_device[i], alsa_outdev[i].a_handle); */ if((err = set_hwparams(alsa_outdev[i].a_handle, hw_params, &(alsa_outdev[i].a_channels))) < 0) @@ -370,7 +370,7 @@ void alsamm_close_audio(void) #ifdef ALSAMM_DEBUG if(sys_verbose) - post("unlink audio out %d, of %lx",i,used_outdevice[i]); + post("unlink audio out %d, of %zx",i,used_outdevice[i]); #endif if(alsa_outdev[i].a_synced != 0){ diff --git a/pd/src/s_file.c b/pd/src/s_file.c index be8b87958b361b1f40424a41f4e3030f43047b12..0f0b18f258c23d9ad266a71eb86638fcb0ccd320 100644 --- a/pd/src/s_file.c +++ b/pd/src/s_file.c @@ -14,6 +14,7 @@ #include "m_pd.h" #include "s_stuff.h" +#include "s_utf8.h" #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -35,12 +36,13 @@ #ifdef MSW #include <windows.h> #include <tchar.h> +#include <io.h> #endif #ifdef _MSC_VER /* This is only for Microsoft's compiler, not cygwin, e.g. */ #define snprintf sprintf_s #endif -int sys_defeatrt, sys_autopatch_yoffset, sys_zoom, sys_browser_doc = 1, +int sys_defeatrt, sys_autopatch_yoffset, sys_grid = 1, sys_zoom, sys_browser_doc = 1, sys_browser_path, sys_browser_init; t_symbol *sys_flags = &s_; void sys_doflags( void); @@ -228,8 +230,8 @@ static void sys_putpreference(const char *key, const char *value) NULL, &hkey, NULL); if (err != ERROR_SUCCESS) { - post("unable to create registry entry: %s: error %lx\n", key, - (long unsigned int)err); + post("unable to create registry entry: %s: error %zx\n", key, + (t_int)err); return; } err = RegSetValueEx(hkey, key, 0, REG_EXPAND_SZ, value, strlen(value)+1); @@ -668,6 +670,8 @@ void sys_loadpreferences( void) } if (sys_getpreference("defeatrt", prefbuf, MAXPDSTRING)) sscanf(prefbuf, "%d", &sys_defeatrt); + if (sys_getpreference("showgrid", prefbuf, MAXPDSTRING)) + sscanf(prefbuf, "%d", &sys_grid); if (sys_getpreference("savezoom", prefbuf, MAXPDSTRING)) sscanf(prefbuf, "%d", &sys_zoom); if (sys_getpreference("browser_doc", prefbuf, MAXPDSTRING)) @@ -815,6 +819,8 @@ void glob_savepreferences(t_pd *dummy) sys_putpreference("nloadlib", buf1); sprintf(buf1, "%d", sys_defeatrt); sys_putpreference("defeatrt", buf1); + sprintf(buf1, "%d", sys_grid); + sys_putpreference("showgrid", buf1); sprintf(buf1, "%d", sys_zoom); sys_putpreference("savezoom", buf1); sprintf(buf1, "%d", sys_browser_doc); diff --git a/pd/src/s_inter.c b/pd/src/s_inter.c index c9add24e45b852668423b9b94e0c0dbbeb83dc69..a712dba3a1d75e6927d7423e3dfbcdea4c5f9220 100644 --- a/pd/src/s_inter.c +++ b/pd/src/s_inter.c @@ -57,7 +57,7 @@ static int isatty(int fd) {return 0;} typedef int pid_t; # endif typedef int socklen_t; -#define EADDRINUSE WSAEADDRINUSE +//#define EADDRINUSE WSAEADDRINUSE #endif #include <stdarg.h> @@ -94,7 +94,7 @@ typedef int socklen_t; #define LOCALHOST "localhost" #endif -#define X_SPECIFIER "x%.6lx" +#define X_SPECIFIER "x%.6zx" #if PD_FLOATSIZE == 32 #define FLOAT_SPECIFIER "%.6g" @@ -195,6 +195,7 @@ double sys_getrealtime(void) } extern int sys_nosleep; +static int fdschanged; static int sys_domicrosleep(int microsec, int pollem) { @@ -203,7 +204,7 @@ static int sys_domicrosleep(int microsec, int pollem) t_fdpoll *fp; timout.tv_sec = 0; timout.tv_usec = (sys_nosleep ? 0 : microsec); - if (pollem) + if (pollem && sys_nfdpoll) { fd_set readset, writeset, exceptset; FD_ZERO(&writeset); @@ -216,8 +217,10 @@ static int sys_domicrosleep(int microsec, int pollem) Sleep(microsec/1000); else #endif - select(sys_maxfd+1, &readset, &writeset, &exceptset, &timout); - for (i = 0; i < sys_nfdpoll; i++) + if (select(sys_maxfd+1, &readset, &writeset, &exceptset, &timout) < 0) + perror("microsleep select"); + fdschanged = 0; + for (i = 0; i < sys_nfdpoll && !fdschanged; i++) if (FD_ISSET(sys_fdpoll[i].fdp_fd, &readset)) { #ifdef THREAD_LOCKING @@ -229,18 +232,23 @@ static int sys_domicrosleep(int microsec, int pollem) #endif didsomething = 1; } - return (didsomething); + if (didsomething) return (1); } - else + if (microsec) { +#ifdef THREAD_LOCKING + sys_unlock(); +#endif #ifdef MSW - if (sys_maxfd == 0) - Sleep(microsec/1000); - else + Sleep(microsec/1000); +#else + usleep(microsec); +#endif +#ifdef THREAD_LOCKING + sys_lock(); #endif - select(0, 0, 0, 0, &timout); - return (0); } + return (0); } void sys_microsleep(int microsec) @@ -438,6 +446,7 @@ void sys_addpollfn(int fd, t_fdpollfn fn, void *ptr) fp->fdp_ptr = ptr; sys_nfdpoll = nfd + 1; if (fd >= sys_maxfd) sys_maxfd = fd + 1; + fdschanged = 1; } void sys_rmpollfn(int fd) @@ -445,6 +454,7 @@ void sys_rmpollfn(int fd) int nfd = sys_nfdpoll; int i, size = nfd * sizeof(t_fdpoll); t_fdpoll *fp; + fdschanged = 1; for (i = nfd, fp = sys_fdpoll; i--; fp++) { if (fp->fdp_fd == fd) @@ -501,12 +511,12 @@ static int socketreceiver_doread(t_socketreceiver *x) if (c == ';' && (!indx || inbuf[indx-1] != '\\')) { intail = (indx+1)&(INBUFSIZE-1); - binbuf_text(inbinbuf, messbuf, bp - messbuf); + binbuf_text(inbinbuf, messbuf, (int)(bp - messbuf)); if (sys_debuglevel & DEBUG_MESSDOWN) { if (stderr_isatty) - fprintf(stderr,"\n<- \e[0;1;36m%.*s\e[0m", bp - messbuf, messbuf); + fprintf(stderr,"\n<- \e[0;1;36m%.*s\e[0m", (int)(bp - messbuf), messbuf); else - fprintf(stderr,"\n<- %.*s", bp - messbuf, messbuf); + fprintf(stderr,"\n<- %.*s", (int)(bp - messbuf), messbuf); } x->sr_inhead = inhead; x->sr_intail = intail; @@ -624,6 +634,7 @@ void socketreceiver_read(t_socketreceiver *x, int fd) void sys_closesocket(int fd) { #ifdef HAVE_UNISTD_H + if (fd<0) return; close(fd); #endif #ifdef MSW @@ -887,7 +898,7 @@ void gui_do_vmess(const char *sel, char *fmt, int end, va_list ap) case 's': escape_double_quotes(va_arg(ap, const char *)); break; case 'i': sys_vgui("%d", va_arg(ap, int)); break; case 'x': sys_vgui("\"" X_SPECIFIER "\"", - va_arg(ap, long unsigned int)); + va_arg(ap, t_uint)); break; //case 'p': SETPOINTER(at, va_arg(ap, t_gpointer *)); break; default: goto done; @@ -965,7 +976,7 @@ void gui_s(const char *s) gui_array_tail = 0; } -void gui_x(long unsigned int i) +void gui_x(t_uint i) { if (gui_array_head && !gui_array_tail) sys_vgui("\"x%.6lx\"", i); @@ -1347,10 +1358,11 @@ int sys_startgui(const char *guidir) { #ifdef MSW int err = WSAGetLastError(); + if ((ntry++ > 20) || (err != WSAEADDRINUSE)) #else int err = errno; -#endif if ((ntry++ > 20) || (err != EADDRINUSE)) +#endif { perror("bind"); fprintf(stderr, @@ -1438,7 +1450,7 @@ int sys_startgui(const char *guidir) portno, (sys_k12_mode ? "pd-l2ork-k12" : "pd-l2ork"), guidir2, - (long unsigned int)pd_this); + (t_uint)pd_this); #else sprintf(cmdbuf, "TCL_LIBRARY=\"%s/tcl/library\" TK_LIBRARY=\"%s/tk/library\" \ @@ -1480,7 +1492,7 @@ int sys_startgui(const char *guidir) portno, (sys_k12_mode ? "pd-l2ork-k12" : "pd-l2ork"), guidir2, - (long unsigned int)pd_this); + (t_uint)pd_this); #endif sys_guicmd = cmdbuf; } @@ -1537,7 +1549,7 @@ int sys_startgui(const char *guidir) //sys_bashfilename(scriptbuf, scriptbuf); char pd_this_string[80]; - sprintf(pd_this_string, X_SPECIFIER, (long unsigned int)pd_this); + sprintf(pd_this_string, X_SPECIFIER, (t_uint)pd_this); sprintf(scriptbuf, "\""); /* use quotes in case there are spaces */ strcat(scriptbuf, sys_libdir->s_name); strcat(scriptbuf, "/" PDBINDIR); @@ -1775,6 +1787,16 @@ extern int do_not_redraw; void glob_quit(void *dummy, t_floatarg status) { + if (sys_nogui) + { + // ag: Take the quick way out. Specifically, we do *not* want to clean + // up a non-existent gui here (which also causes spurious segfaults in + // gui-less operation on Windows). + canvas_suspend_dsp(); + sys_bail(status); + // sys_bail shouldn't return, but just in case: + return; + } /* If we're going to try to cleanly close everything here, we should do the same for all open patches and that is currently not the case, so for the time being, let's just leave OS to deal with freeing of all diff --git a/pd/src/s_main.c b/pd/src/s_main.c index 62ad4dc69ab4f64d511db9bfa4ff1a052d79625d..2dbc5e906b753a1fd17f7bae45460964b106b07d 100644 --- a/pd/src/s_main.c +++ b/pd/src/s_main.c @@ -57,6 +57,8 @@ int sys_unique = 0; /* by default off, prevents multiple instances of pd-l2ork */ int sys_legacy = 0; /* by default off, used to enable legacy features, such as offsets in iemgui object positioning */ +int sys_legacy_bendin = 0; /* by default off, used to enable vanilla- + compatible (unsigned) pitch bend input */ char *sys_guicmd; t_symbol *sys_gui_preset; /* name of gui theme to be used */ t_symbol *sys_libdir; @@ -91,6 +93,11 @@ char sys_extraflagsstring[MAXPDSTRING]; int sys_run_scheduler(const char *externalschedlibname, const char *sys_extraflagsstring); int sys_noautopatch = 0; /* temporary hack to defeat new 0.42 editing */ +int glob_autopatch_connectme = 0; /* added to compensate for weird gui objects + whose positioning is not true to its xy + origin, to ensure they can be at least + somewhat reasonably autopatched + */ /* here the "-1" counts signify that the corresponding vector hasn't been specified in command line arguments; sys_set_audio_settings will detect it @@ -345,14 +352,14 @@ int sys_main(int argc, char **argv) if (WSAStartup(version, &nobby)) sys_sockerror("WSAstartup"); /* use Win32 "binary" mode by default since we don't want the * translation that Win32 does by default */ -# ifdef _MSC_VER /* MS Visual Studio */ +# ifdef MSC /* MS Visual Studio */ _set_fmode( _O_BINARY ); # else /* MinGW */ { extern int _fmode; _fmode = _O_BINARY; } -# endif /* _MSC_VER */ +# endif /* MSC */ #endif /* _WIN32 */ #ifndef _WIN32 /* long ago Pd used setuid to promote itself to real-time priority. @@ -365,7 +372,7 @@ int sys_main(int argc, char **argv) } #endif /* _WIN32 */ pd_init(); /* start the message system */ - logpost(NULL, 2, "PD_FLOATSIZE = %lu bits", sizeof(t_float)*8); + logpost(NULL, 2, "PD_FLOATSIZE = %u bits", (unsigned)sizeof(t_float)*8); sys_findprogdir(argv[0]); /* set sys_progname, guipath */ for (i = noprefs = 0; i < argc; i++) /* prescan args for noprefs */ if (!strcmp(argv[i], "-noprefs")) @@ -423,7 +430,8 @@ int sys_main(int argc, char **argv) sys_reopen_midi(); sys_reopen_audio(); - if (sys_console) sys_vgui("pdtk_toggle_console 1\n"); + // ag: no longer needed (cruft from the pd-l2ork1 days) + //if (sys_console) sys_vgui("pdtk_toggle_console 1\n"); if (sys_k12_mode) { t_namelist *path = pd_extrapath; @@ -531,6 +539,7 @@ static char *(usagemessage[]) = { "-k12 -- enable K-12 education mode (requires L2Ork K12 lib)\n", "-unique -- enable multiple instances (disabled by default)\n", "-legacy -- enable legacy features (disabled by default)\n", +"-legacy-bendin -- enable legacy (unsigned) bendin (disabled by default)\n", "\n", }; @@ -938,6 +947,12 @@ int sys_argparse(int argc, char **argv) argc -= 1; argv += 1; } + else if (!strcmp(*argv, "-legacy-bendin")) + { + sys_legacy_bendin = 1; + argc -= 1; + argv += 1; + } else if (!strcmp(*argv, "-guiport") && argc > 1 && sscanf(argv[1], "%d", &sys_guisetportnumber) >= 1) { diff --git a/pd/src/s_path.c b/pd/src/s_path.c index 9b2aebb8d9f95d5ddeee6bdf190f51759c25d73a..6c721c30c82de72fa2d1e0d74a3ccb30d621e6aa 100644 --- a/pd/src/s_path.c +++ b/pd/src/s_path.c @@ -195,6 +195,60 @@ int sys_isabsolutepath(const char *dir) } } +int sys_relativizepath(const char *from, const char *to, char *result) +{ + char fromext[FILENAME_MAX]; + sys_unbashfilename(from, fromext); + char toext[FILENAME_MAX]; + sys_unbashfilename(to, toext); + + int i = 0, j; + while(fromext[i] && toext[i] && fromext[i] == toext[i]) i++; + if(!i) return 0; + + j = i; + if(fromext[i]) + while(i > 0 && fromext[i] != '/') i--; + if(toext[j]) + while(j > 0 && toext[j] != '/') j--; + + if(fromext[i]) + { + int k = 0; + while(fromext[i]) + { + if(fromext[i] == '/') + { + if(k == 0) + { + strcpy(result+k, ".."); + k += 2; + } + else + { + strcpy(result+k, "/.."); + k += 3; + } + } + i++; + } + if(toext[j]) + { + result[k] = '/'; + strcpy(result+k+1, toext+j+1); + } + } + else if(!fromext[i] && toext[j]) + { + strcpy(result, toext+j+1); + } + else + { + strcpy(result, ""); + } + return 1; +} + /******************* Utility functions used below ******************/ diff --git a/pd/src/s_print.c b/pd/src/s_print.c index e00b814f3c25eadb37c3c08bb43e19f1a173c338..156f45ac612b7da74dd01681f2a7e9bde1692921 100644 --- a/pd/src/s_print.c +++ b/pd/src/s_print.c @@ -43,7 +43,7 @@ static char* strnpointerid(char *dest, const void *pointer, size_t len) { *dest=0; if (pointer) - snprintf(dest, len, ".x%lx", (unsigned long)pointer); + snprintf(dest, len, ".x%zx", (t_uint)pointer); return dest; } @@ -267,8 +267,8 @@ void glob_finderror(t_pd *dummy) void glob_findinstance(t_pd *dummy, t_symbol*s) { // revert s to (potential) pointer to object - long obj = 0; - if (sscanf(s->s_name, ".x%lx", &obj)) + t_int obj = 0; + if (sscanf(s->s_name, ".x%zx", &obj)) { if (obj) { diff --git a/pd/src/x_arithmetic.c b/pd/src/x_arithmetic.c index 6d4fad6fa6b8fb51ca17a70ad3f8c2216ced8162..57f4402d5de8a21d2ac2fb913809d8ada3ec2d4a 100644 --- a/pd/src/x_arithmetic.c +++ b/pd/src/x_arithmetic.c @@ -636,19 +636,28 @@ static void sqrt_float(t_object *x, t_float f) outlet_float(x->ob_outlet, r); } -static t_class *log_class; /* ----------- log --------------- */ +static t_class *binop1_log_class; /* ----------- log --------------- */ -static void *log_new(void) +static void *binop1_log_new(t_floatarg f) { - t_object *x = (t_object *)pd_new(log_class); - outlet_new(x, &s_float); - return (x); + return (binop1_new(binop1_log_class, f)); } -static void log_float(t_object *x, t_float f) +static void binop1_log_bang(t_binop *x) { - t_float r = (f > 0 ? LOG(f) : -1000); - outlet_float(x->ob_outlet, r); + t_float r; + if (x->x_f1 <= 0) + r = -1000; + else if (x->x_f2 <= 0) + r = LOG(x->x_f1); + else r = LOG(x->x_f1)/LOG(x->x_f2); + outlet_float(x->x_obj.ob_outlet, r); +} + +static void binop1_log_float(t_binop *x, t_float f) +{ + x->x_f1 = f; + binop1_log_bang(x); } static t_class *exp_class; /* ----------- exp --------------- */ @@ -791,6 +800,11 @@ void x_arithmetic_setup(void) class_addbang(binop1_min_class, binop1_min_bang); class_addfloat(binop1_min_class, (t_method)binop1_min_float); + binop1_log_class = class_new(gensym("log"), (t_newmethod)binop1_log_new, + 0, sizeof(t_binop), 0, A_DEFFLOAT, 0); + class_addbang(binop1_log_class, binop1_log_bang); + class_addfloat(binop1_log_class, (t_method)binop1_log_float); + /* ------------------ binop2 ----------------------- */ binop2_ee_class = class_new(gensym("=="), (t_newmethod)binop2_ee_new, 0, @@ -911,10 +925,6 @@ void x_arithmetic_setup(void) sizeof(t_object), 0, 0); class_addfloat(sqrt_class, (t_method)sqrt_float); - log_class = class_new(gensym("log"), log_new, 0, - sizeof(t_object), 0, 0); - class_addfloat(log_class, (t_method)log_float); - exp_class = class_new(gensym("exp"), exp_new, 0, sizeof(t_object), 0, 0); class_addfloat(exp_class, (t_method)exp_float); diff --git a/pd/src/x_array.c b/pd/src/x_array.c index 67471549dee81f54c40c34301c77b346941328c4..5457bcb58f1a2e3db2359840efe18512d126c267 100644 --- a/pd/src/x_array.c +++ b/pd/src/x_array.c @@ -227,7 +227,23 @@ static void array_define_send(t_glist *x, t_symbol *s) pd_pointer(s->s_thing, &gp); gpointer_unset(&gp); } - else bug("array_define_anything"); + else bug("array_define_send"); +} + +static void array_define_bang(t_glist *x) +{ + t_glist *gl = (x->gl_list ? pd_checkglist(&x->gl_list->g_pd) : 0); + if (gl && gl->gl_list && pd_class(&gl->gl_list->g_pd) == garray_class) + { + t_gpointer gp; + gpointer_init(&gp); + gpointer_setglist(&gp, gl, + //garray_getscalar((t_garray *)gl->gl_list)); + (t_gobj *)gl->gl_list); + outlet_pointer(x->gl_obj.ob_outlet, &gp); + gpointer_unset(&gp); + } + else bug("array_define_bang"); } /* just forward any messages to the garray */ @@ -864,6 +880,7 @@ void x_array_setup(void ) canvas_add_for_class(array_define_class); class_addmethod(array_define_class, (t_method)array_define_send, gensym("send"), A_SYMBOL, 0); + class_addbang(array_define_class, array_define_bang); class_addanything(array_define_class, array_define_anything); class_sethelpsymbol(array_define_class, gensym("array-object")); class_setsavefn(array_define_class, array_define_save); diff --git a/pd/src/x_gui.c b/pd/src/x_gui.c index b5b66ca6b9f285c586925715de4680785e116fb7..862a73f064b8890dd46f1d2c6bba6b5ab1265426 100644 --- a/pd/src/x_gui.c +++ b/pd/src/x_gui.c @@ -68,7 +68,7 @@ void gfxstub_new(t_pd *owner, void *key, const char *cmd) return; } x = (t_gfxstub *)pd_new(gfxstub_class); - sprintf(namebuf, ".gfxstub%lx", (t_int)x); + sprintf(namebuf, ".gfxstub%zx", (t_uint)x); s = gensym(namebuf); pd_bind(&x->x_pd, s); @@ -99,7 +99,7 @@ char *gfxstub_new2(t_pd *owner, void *key) if (x->x_key == key) gfxstub_deleteforkey(key); x = (t_gfxstub *)pd_new(gfxstub_class); - sprintf(namebuf, ".gfxstub%lx", (t_int)x); + sprintf(namebuf, ".gfxstub%zx", (t_uint)x); s = gensym(namebuf); pd_bind(&x->x_pd, s); x->x_owner = owner; @@ -154,7 +154,7 @@ void gfxstub_deleteforkey(void *key) if (y->x_key == key) { char tagbuf[MAXPDSTRING]; - sprintf(tagbuf, ".gfxstub%lx", (long unsigned int)y); + sprintf(tagbuf, ".gfxstub%zx", (t_uint)y); gui_vmess("gui_remove_gfxstub", "s", tagbuf); @@ -245,7 +245,7 @@ static void *openpanel_new( void) char buf[50]; t_openpanel *x = (t_openpanel *)pd_new(openpanel_class); x->x_canvas = canvas_getcurrent(); - sprintf(buf, "d%lx", (t_int)x); + sprintf(buf, "d%zx", (t_uint)x); x->x_s = gensym(buf); pd_bind(&x->x_obj.ob_pd, x->x_s); outlet_new(&x->x_obj, &s_symbol); @@ -303,7 +303,7 @@ static void *savepanel_new( void) { char buf[50]; t_savepanel *x = (t_savepanel *)pd_new(savepanel_class); - sprintf(buf, "d%lx", (t_int)x); + sprintf(buf, "d%zx", (t_uint)x); x->x_s = gensym(buf); x->x_canvas = canvas_getcurrent(); pd_bind(&x->x_obj.ob_pd, x->x_s); diff --git a/pd/src/x_interface.c b/pd/src/x_interface.c index bfb69df38ccd1a179c50b50b510dad75cbb302ae..6753ea626236c574d981ccfa9753e4e22a037aae 100644 --- a/pd/src/x_interface.c +++ b/pd/src/x_interface.c @@ -325,6 +325,20 @@ typedef struct _objectinfo { t_canvas *x_canvas; } t_objectinfo; +static t_class *debuginfo_class; + +typedef struct _debuginfo { + t_object x_obj; +} t_debuginfo; + +static t_class *abinfo_class; + +typedef struct _abinfo +{ + t_object x_obj; + t_ab_definition *abdef; +} t_abinfo; + /* used by all the *info objects */ static int info_to_console = 0; @@ -576,7 +590,7 @@ void canvasinfo_name(t_canvasinfo *x, t_symbol *s, int argc, t_atom *argv) { t_canvas *c = canvas_climb(x->x_canvas, x->x_depth); char buf[MAXPDSTRING]; - snprintf(buf, MAXPDSTRING, "x%lx", (long unsigned int)c); + snprintf(buf, MAXPDSTRING, "x%zx", (t_uint)c); t_atom at[1]; SETSYMBOL(at, gensym(buf)); info_out((t_text *)x, s, 1, at); @@ -1623,12 +1637,112 @@ void objectinfo_setup(void) post("stable objectinfo methods: class"); } +/* -------------------------- abinfo ------------------------------ */ + +void *abinfo_new(void) +{ + t_abinfo *x; + t_canvas *c = canvas_getcurrent(); + while(c->gl_owner && !c->gl_isab) c = c->gl_owner; + if(c->gl_isab) + { + x = (t_abinfo *)pd_new(abinfo_class); + x->abdef = c->gl_absource; + outlet_new(&x->x_obj, &s_list); + } + else + { + if(!abframe) + { + error("abinfo: only instantiable inside an ab object"); + x = 0; + } + else + x = pd_new(text_class); + } + return (x); +} + +void abinfo_name(t_abinfo *x, t_symbol *s, int argc, t_atom *argv) +{ + t_atom at[1]; + SETSYMBOL(at, x->abdef->ad_name); + info_out((t_text *)x, s, 1, at); +} + +void abinfo_instances(t_abinfo *x, t_symbol *s, int argc, t_atom *argv) +{ + t_atom at[1]; + SETFLOAT(at, x->abdef->ad_numinstances); + info_out((t_text *)x, s, 1, at); +} + +void abinfo_within(t_abinfo *x, t_symbol *s, int argc, t_atom *argv) +{ + t_binbuf *buf = binbuf_new(); + int i; + for(i = 0; i < x->abdef->ad_numdep; i++) + { + binbuf_addv(buf, "s", x->abdef->ad_dep[i]->ad_name); + } + info_out((t_text *)x, s, binbuf_getnatom(buf), binbuf_getvec(buf)); + binbuf_free(buf); +} + +//ADD MORE METHODS + +void abinfo_setup(void) +{ + abinfo_class = class_new(gensym("abinfo"), (t_newmethod)abinfo_new, 0, + sizeof(t_abinfo), CLASS_DEFAULT, 0); + + class_addmethod(abinfo_class, (t_method)abinfo_name, + gensym("name"), A_GIMME, 0); + class_addmethod(abinfo_class, (t_method)abinfo_instances, + gensym("instances"), A_GIMME, 0); + class_addmethod(abinfo_class, (t_method)abinfo_within, + gensym("within"), A_GIMME, 0); +} + + +void debuginfo_print(t_debuginfo *x) +{ + info_print((t_text *)x); +} + + /* replace incoming message's selector with zero and output it */ +void debuginfo_nullselector(t_debuginfo *x, t_symbol *s, int argc, + t_atom *argv) +{ + info_out((t_text *)x, 0, argc, argv); +} + +void *debuginfo_new(void) +{ + t_debuginfo *x = (t_debuginfo *)pd_new(debuginfo_class); + outlet_new(&x->x_obj, &s_anything); + return (void *)x; +} + +void debuginfo_setup(void) +{ + debuginfo_class = class_new(gensym("debuginfo"), + (t_newmethod)debuginfo_new, 0, sizeof(t_debuginfo), + CLASS_DEFAULT, 0); + class_addmethod(debuginfo_class, (t_method)debuginfo_nullselector, + gensym("null-selector"), A_GIMME, 0); + class_addmethod(debuginfo_class, (t_method)debuginfo_print, + gensym("print"), A_GIMME, 0); +} + void x_interface_setup(void) { - print_setup(); - unpost_setup(); canvasinfo_setup(); - pdinfo_setup(); classinfo_setup(); + debuginfo_setup(); objectinfo_setup(); + abinfo_setup(); + pdinfo_setup(); + print_setup(); + unpost_setup(); } diff --git a/pd/src/x_list.c b/pd/src/x_list.c index 230267430b0c6579f352d96eb577251f67489fad..70dbdfd87e7148ed9d236b9019a73a4a6be348c0 100644 --- a/pd/src/x_list.c +++ b/pd/src/x_list.c @@ -8,7 +8,7 @@ #include "s_stuff.h" #include <string.h> -#ifdef HAVE_MALLOC_H +#if defined HAVE_MALLOC_H || defined MSW #include <malloc.h> #endif diff --git a/pd/src/x_midi.c b/pd/src/x_midi.c index c827ea7375cbd2a31eb08dfe3484ea5ca41217e7..2f75442d7ae752ce7d395c3142ccb91a0d3bfb36 100644 --- a/pd/src/x_midi.c +++ b/pd/src/x_midi.c @@ -307,14 +307,21 @@ typedef struct _bendin { t_object x_obj; t_float x_channel; + t_float x_offs; t_outlet *x_outlet1; t_outlet *x_outlet2; } t_bendin; -static void *bendin_new(t_floatarg f) +static void *bendin_new(t_symbol *s, int argc, t_atom *argv) { t_bendin *x = (t_bendin *)pd_new(bendin_class); + extern int sys_legacy_bendin; + t_float f = 0.0, g = sys_legacy_bendin; + f = atom_getfloatarg(0, argc, argv); + if (argc > 1) + g = atom_getfloatarg(1, argc, argv); x->x_channel = f; + x->x_offs = g==0.0?-8192.0:0.0; x->x_outlet1 = outlet_new(&x->x_obj, &s_float); if (f == 0) x->x_outlet2 = outlet_new(&x->x_obj, &s_float); pd_bind(&x->x_obj.ob_pd, pd_this->pd_bendin_sym); @@ -328,12 +335,12 @@ static void bendin_list(t_bendin *x, t_symbol *s, int argc, t_atom *argv) if (x->x_channel != 0) { if (channel != x->x_channel) return; - outlet_float(x->x_outlet1, value); + outlet_float(x->x_outlet1, value + x->x_offs); } else { outlet_float(x->x_outlet2, channel); - outlet_float(x->x_outlet1, value); + outlet_float(x->x_outlet1, value + x->x_offs); } } @@ -345,7 +352,7 @@ static void bendin_free(t_bendin *x) static void bendin_setup(void) { bendin_class = class_new(gensym("bendin"), (t_newmethod)bendin_new, - (t_method)bendin_free, sizeof(t_bendin), CLASS_NOINLET, A_DEFFLOAT, 0); + (t_method)bendin_free, sizeof(t_bendin), CLASS_NOINLET, A_GIMME, 0); class_addlist(bendin_class, bendin_list); class_sethelpsymbol(bendin_class, gensym("midi")); } @@ -355,11 +362,7 @@ void inmidi_pitchbend(int portno, int channel, int value) if (pd_this->pd_bendin_sym->s_thing) { t_atom at[2]; - // AG: -legacy behavior was changed so that it is consistent with - // vanilla bendin. - extern int sys_legacy; - int shift = sys_legacy ? 0 : 8192; - SETFLOAT(at, value-shift); // Ico fix the offset of the incoming pitchbend + SETFLOAT(at, value); SETFLOAT(at+1, (channel + (portno << 4) + 1)); pd_list(pd_this->pd_bendin_sym->s_thing, &s_list, 2, at); } diff --git a/pd/src/x_preset.c b/pd/src/x_preset.c index 65da15c8cb694ff84e689e29bb82d92c82d13de8..f3043532da93799609d0186a27e1531f5b81c1b2 100644 --- a/pd/src/x_preset.c +++ b/pd/src/x_preset.c @@ -434,7 +434,7 @@ static void preset_node_update_my_glist_location(t_preset_node *x) at this point is still null since this means this is being called at the end of the preset_node_new call */ if (PH_DEBUG) - fprintf(stderr," location = %d %lx %lx\n", + fprintf(stderr," location = %d %zx %zx\n", i, (t_int)g, (t_int)target); x->pn_gl_loc[j] = i; @@ -477,7 +477,7 @@ static void preset_node_update_my_glist_location(t_preset_node *x) as well as when hubs try to query nodes that have not been paired yet. */ void preset_node_seek_hub(t_preset_node *x) { - if(PH_DEBUG) fprintf(stderr,"preset_node_seek_hub %lx\n", (t_int)x->pn_hub); + if(PH_DEBUG) fprintf(stderr,"preset_node_seek_hub %zx\n", (t_uint)x->pn_hub); if (we_are_undoing) return; t_canvas *y = x->pn_canvas; @@ -529,16 +529,16 @@ static int preset_node_location_changed(t_preset_node *x) static void preset_node_anything(t_preset_node *x, t_symbol *s, int argc, t_atom *argv) { - if (PH_DEBUG) fprintf(stderr,"preset_node_anything %lx %s %d\n", (t_int)x, s->s_name, argc); + if (PH_DEBUG) fprintf(stderr,"preset_node_anything %zx %s %d\n", (t_uint)x, s->s_name, argc); int i; alist_list(&x->pn_val, 0, argc, argv); if (PH_DEBUG) { if (x->pn_val.l_vec->l_a.a_type == A_SYMBOL) - fprintf(stderr," %lx data is %s\n", + fprintf(stderr," %zx data is %s\n", (t_int)x, x->pn_val.l_vec->l_a.a_w.w_symbol->s_name); else if (x->pn_val.l_vec->l_a.a_type == A_FLOAT) - fprintf(stderr," %lx data is %f\n", + fprintf(stderr," %zx data is %f\n", (t_int)x, x->pn_val.l_vec->l_a.a_w.w_float); } // check for pointers and warn user presetting them has not been tested @@ -609,7 +609,7 @@ void preset_node_request_hub_writepreset(t_preset_node *x, t_symbol *filename, void preset_node_set_and_output_value(t_preset_node *x, t_alist val) { if(PH_DEBUG) - fprintf(stderr,"preset_node_set_and_output_value %lx\n", (t_int)x); + fprintf(stderr,"preset_node_set_and_output_value %zx\n", (t_uint)x); t_atom *outv; if (val.l_n > 0) { @@ -621,10 +621,10 @@ void preset_node_set_and_output_value(t_preset_node *x, t_alist val) if(PH_DEBUG) { if (outv->a_type == A_SYMBOL) - fprintf(stderr," %lx outputs %s\n", + fprintf(stderr," %zx outputs %s\n", (t_int)x, outv->a_w.w_symbol->s_name); else if (outv->a_type == A_FLOAT) - fprintf(stderr," %lx outputs %f\n", + fprintf(stderr," %zx outputs %f\n", (t_int)x, outv->a_w.w_float); } XL_ATOMS_FREEA(outv, x->pn_val.l_n); @@ -1186,14 +1186,14 @@ void preset_hub_store(t_preset_hub *h, t_float f) if (hd1->phd_node->pn_val.l_vec->l_a.a_type == A_SYMBOL) { - fprintf(stderr," %lx outputs %s\n", + fprintf(stderr," %zx outputs %s\n", (t_int)hd1->phd_node, hd1->phd_node->pn_val.l_vec->l_a.a_w.w_symbol->s_name); } else if (hd1->phd_node->pn_val.l_vec->l_a.a_type == A_FLOAT) { - fprintf(stderr," %lx outputs %f\n", + fprintf(stderr," %zx outputs %f\n", (t_int)hd1->phd_node, hd1->phd_node->pn_val.l_vec->l_a.a_w.w_float); } @@ -1209,14 +1209,14 @@ void preset_hub_store(t_preset_hub *h, t_float f) if (hd1->phd_node->pn_val.l_vec->l_a.a_type == A_SYMBOL) { - fprintf(stderr," %lx outputs %s\n", + fprintf(stderr," %zx outputs %s\n", (t_int)hd1->phd_node, np2->np_val.l_vec->l_a.a_w.w_symbol->s_name); } else if (hd1->phd_node->pn_val.l_vec->l_a.a_type == A_FLOAT) { - fprintf(stderr," %lx outputs %f\n", + fprintf(stderr," %zx outputs %f\n", (t_int)hd1->phd_node, np2->np_val.l_vec->l_a.a_w.w_float); } diff --git a/pd/src/x_scalar.c b/pd/src/x_scalar.c index 61a6cf1f45fa6476215d38051f8dfaa654f7bbeb..95187b700795dd9f5231d636de8efa3fb8d41b85 100644 --- a/pd/src/x_scalar.c +++ b/pd/src/x_scalar.c @@ -111,6 +111,19 @@ static void scalar_define_send(t_glist *x, t_symbol *s) else bug("scalar_define_send"); } +static void scalar_define_bang(t_glist *x) +{ + if (x->gl_list && pd_class(&x->gl_list->g_pd) == scalar_class) + { + t_gpointer gp; + gpointer_init(&gp); + gpointer_setglist(&gp, x, (t_gobj *)&x->gl_list->g_pd); + outlet_pointer(x->gl_obj.ob_outlet, &gp); + gpointer_unset(&gp); + } + else bug("scalar_define_bang"); +} + /* set to a list, used to restore from scalar_define_save()s below */ static void scalar_define_set(t_glist *x, t_symbol *s, int argc, t_atom *argv) { @@ -180,6 +193,7 @@ void x_scalar_setup(void ) canvas_add_for_class(scalar_define_class); class_addmethod(scalar_define_class, (t_method)scalar_define_send, gensym("send"), A_SYMBOL, 0); + class_addbang(scalar_define_class, (t_method)scalar_define_bang); class_addmethod(scalar_define_class, (t_method)scalar_define_set, gensym("set"), A_GIMME, 0); class_sethelpsymbol(scalar_define_class, gensym("scalar-object")); diff --git a/pd/src/x_text.c b/pd/src/x_text.c index 922a5e64d1ad633147d87c42d9eea0cb3a71bae0..3d61d0cf3f1c3aa9fded175287e38f8a51303a26 100644 --- a/pd/src/x_text.c +++ b/pd/src/x_text.c @@ -10,6 +10,8 @@ moment it also defines "text" but it may later be better to split this off. */ #include "s_stuff.h" /* just for sys_hostfontsize, phooey */ #include <string.h> #include <stdio.h> +#define __USE_GNU +#include <stdlib.h> #ifdef HAVE_UNISTD_H #include <unistd.h> #endif @@ -27,6 +29,10 @@ static t_class *text_define_class; # include <stdlib.h> /* BSDs for example */ #endif +#ifdef _WIN32 +#define qsort_r qsort_s /* of course Microsoft decides to be different */ +#endif + #ifndef HAVE_ALLOCA /* can work without alloca() but we never need it */ #define HAVE_ALLOCA 1 #endif @@ -74,13 +80,13 @@ static void textbuf_senditup(t_textbuf *x) if (!x->b_guiconnect) return; binbuf_gettext(x->b_binbuf, &txt, &ntxt); - //sys_vgui("pdtk_textwindow_clear .x%lx\n", x); + //sys_vgui("pdtk_textwindow_clear .x%zx\n", x); gui_vmess("gui_text_dialog_clear", "x", x); for (i = 0; i < ntxt; ) { char *j = strchr(txt+i, '\n'); if (!j) j = txt + ntxt; - //sys_vgui("pdtk_textwindow_append .x%lx {%.*s\n}\n", + //sys_vgui("pdtk_textwindow_append .x%zx {%.*s\n}\n", // x, j-txt-i, txt+i); if (j - txt - i >= MAXPDSTRING) { @@ -88,12 +94,12 @@ static void textbuf_senditup(t_textbuf *x) MAXPDSTRING); break; } - sprintf(buf, "%.*s\n", j-txt-i, txt+i); + sprintf(buf, "%.*s\n", (int)(j-txt-i), txt+i); gui_vmess("gui_text_dialog_append", "xs", x, buf); i = (j-txt)+1; } - //sys_vgui("pdtk_textwindow_setdirty .x%lx 0\n", x); + //sys_vgui("pdtk_textwindow_setdirty .x%zx 0\n", x); gui_vmess("gui_text_dialog_set_dirty", "xi", x, 0); t_freebytes(txt, ntxt); } @@ -108,25 +114,25 @@ static void textbuf_open(t_textbuf *x) { if (x->b_guiconnect) { - //sys_vgui("wm deiconify .x%lx\n", x); - //sys_vgui("raise .x%lx\n", x); - //sys_vgui("focus .x%lx.text\n", x); + //sys_vgui("wm deiconify .x%zx\n", x); + //sys_vgui("raise .x%zx\n", x); + //sys_vgui("focus .x%zx.text\n", x); gui_vmess("gui_text_dialog_raise", "x", x); } else { char buf[40]; - //sys_vgui("pdtk_textwindow_open .x%lx %dx%d {%s: %s} %d\n", + //sys_vgui("pdtk_textwindow_open .x%zx %dx%d {%s: %s} %d\n", // x, 600, 340, "myname", "text", // sys_hostfontsize(glist_getfont(x->b_canvas)));//, //glist_getzoom(x->b_canvas))); - sprintf(buf, "x%lx", (unsigned long)x); + sprintf(buf, "x%zx", (t_uint)x); x->b_guiconnect = guiconnect_new(&x->b_ob.ob_pd, gensym(buf)); gui_vmess("gui_text_dialog", "xsiii", x, x->b_sym->s_name, - 600, - 340, + 480, + 550, sys_hostfontsize(glist_getfont(x->b_canvas))); //textbuf_senditup(x); } @@ -134,7 +140,7 @@ static void textbuf_open(t_textbuf *x) static void textbuf_close(t_textbuf *x) { - //sys_vgui("pdtk_textwindow_doclose .x%lx\n", x); + //sys_vgui("pdtk_textwindow_doclose .x%zx\n", x); gui_vmess("gui_text_dialog_close_from_pd", "x", x, 1); if (x->b_guiconnect) { @@ -232,7 +238,7 @@ static void textbuf_free(t_textbuf *x) binbuf_free(x->b_binbuf); if (x->b_guiconnect) { - //sys_vgui("destroy .x%lx\n", x); + //sys_vgui("destroy .x%zx\n", x); gui_vmess("gui_text_dialog_close_from_pd", "xi", x, 0); guiconnect_notarget(x->b_guiconnect, 1000); } @@ -421,6 +427,201 @@ static void text_define_send(t_text_define *x, t_symbol *s) } } +typedef struct _keyinfo +{ + int ki_forward; /* one if forward, -1 if reversed */ + int ki_onset; /* number of fields to skip over */ +} t_keyinfo; + + /* apple products seem to have their own prototypes for qsort_r (?) */ +#ifdef __APPLE__ +static int text_sortcompare(void *zkeyinfo, const void *z1, const void *z2) +#else +static int text_sortcompare(const void *z1, const void *z2, void *zkeyinfo) +#endif +{ + const t_atom *a1 = *(t_atom **)z1, *a2 = *(t_atom **)z2; + t_keyinfo *k = (t_keyinfo *)zkeyinfo; + int count; + /* advance first line by key onset and react if we run out early */ + for (count = k->ki_onset; count--; a1++) + { + if (a1->a_type == A_SEMI || a1->a_type == A_COMMA) + { + /* if second line runs out early too consider them equal */ + for (count = k->ki_onset; count--; a2++) + if (a2->a_type == A_SEMI || a2->a_type == A_COMMA) + goto equal; + return (-k->ki_forward); + } + } + for (count = k->ki_onset; count--; a2++) + if (a2->a_type == A_SEMI || a2->a_type == A_COMMA) + return (-k->ki_forward); + /* compare remaining fields */ + for (; ; a1++, a2++) + { + if (a1->a_type == A_SEMI || a1->a_type == A_COMMA) + { + /* hit end of first line */ + if (a2->a_type == A_SEMI || a2->a_type == A_COMMA) + goto equal; + else return (-k->ki_forward); + } + else if (a2->a_type == A_SEMI || a2->a_type == A_COMMA) + return (k->ki_forward); /* hit end of second line */ + + /* otherwise if they're different return something, and + if not proceed to next field */ + else if (a1->a_type == A_FLOAT) + { + if (a2->a_type == A_FLOAT) + { + if (a1->a_w.w_float < a2->a_w.w_float) + return (-k->ki_forward); + else if (a1->a_w.w_float > a2->a_w.w_float) + return (k->ki_forward); + } + else return (-k->ki_forward); + } + else if (a1->a_type == A_SYMBOL) + { + if (a2->a_type == A_SYMBOL) + { + int z = strcmp(a1->a_w.w_symbol->s_name, + a2->a_w.w_symbol->s_name); + if (z) + return (z * k->ki_forward); + } + else return (k->ki_forward); + } + } +equal: + /* ran out of both lines at same time, so we're "equal". + in this case compare pointers so that "equal" lines (which + might not be identical because of a nonzero onset) stay in the + same order as before. */ + if (a1 < a2) + return (-1); + else return (1); +} + +/* I can't seem to get to qsort_s on W2K - clicking on Pd complains it isn't +found in msvcrt (which indeed it isn't in). Rather than waste more time +on this, just call qsort if we're Microsoft and single-instance. I hope nobody +will try to compile multi-instance Pd for 32-bit windows, but if they +do, they might run into my qsort_s problem again. */ +#if defined(_WIN32) && !defined(PDINSTANCE) +#define MICROSOFT_STUPID_SORT +static void *stupid_zkeyinfo; +static int stupid_sortcompare(const void *z1, const void *z2) { + return (text_sortcompare(z1, z2, stupid_zkeyinfo)); } +#endif + + /* sort the contents */ +static void text_define_sort(t_text_define *x, t_symbol *s, + int argc, t_atom *argv) +{ + int nlines, unique = 0, natom = binbuf_getnatom(x->x_binbuf), i, + thisline, startline; + t_atom *vec = binbuf_getvec(x->x_binbuf), **sortbuf, *a1, *a2; + t_binbuf *newb; + t_keyinfo k; + k.ki_forward = 1; + k.ki_onset = 0; + while (argc && argv->a_type == A_SYMBOL && + *argv->a_w.w_symbol->s_name == '-') + { + if (!strcmp(argv->a_w.w_symbol->s_name, "-u")) + unique = 1; + else if (!strcmp(argv->a_w.w_symbol->s_name, "-r")) + k.ki_forward = -1; + else if (!strcmp(argv->a_w.w_symbol->s_name, "-k") && argc > 1 + && argv[1].a_type == A_FLOAT) + { + if ((k.ki_onset = argv[1].a_w.w_float) < 0) + k.ki_onset = 0; + argc--; argv++; + } + else + { + pd_error(x, "text define sort: unknown flag ..."); + postatom(argc, argv); endpost(); + } + argc--; argv++; + } + if (argc) + { + post("warning: text define sort ignoring extra argument: "); + postatom(argc, argv); endpost(); + } + if (!natom) + return; + /* last thing in buffer should be a terminator */ + if (vec[natom-1].a_type != A_SEMI && + vec[natom-1].a_type != A_COMMA) + binbuf_addsemi(x->x_binbuf), + vec = binbuf_getvec(x->x_binbuf), + natom = binbuf_getnatom(x->x_binbuf), + nlines++; + for (i = nlines = 0; i < natom; i++) + if (vec[i].a_type == A_SEMI || vec[i].a_type == A_COMMA) + nlines++; + sortbuf = (t_atom **)getbytes(nlines * sizeof(*sortbuf)); + for (i = thisline = 0, startline = 1; i < natom; i++) + { + if (startline) + { + if (thisline >= nlines) + bug("text_define_sort"); + sortbuf[thisline++] = vec+i; + } + startline = (vec[i].a_type == A_SEMI || vec[i].a_type == A_COMMA); + } +#ifdef MICROSOFT_STUPID_SORT + stupid_zkeyinfo = &k; + qsort(sortbuf, nlines, sizeof(*sortbuf), stupid_sortcompare); +#else +#ifdef __APPLE__ + qsort_r(sortbuf, nlines, sizeof(*sortbuf), &k, text_sortcompare); +#else /* __APPLE__ */ + qsort_r(sortbuf, nlines, sizeof(*sortbuf), text_sortcompare, &k); +#endif /* __APPLE__ */ +#endif /* MICROSOFT_STUPID_SORT */ + newb = binbuf_new(); + for (thisline = 0; thisline < nlines; thisline++) + { + if (unique && thisline > 0) /* check for duplicates */ + { + for (a1 = sortbuf[thisline-1], a2 = sortbuf[thisline]; ; a1++, a2++) + { + if (a1->a_type == A_SEMI || a1->a_type == A_COMMA) + { + if (a1->a_type == a2->a_type) + goto skipit; /* duplicate line, don't copy */ + else goto doit; + } + else if (a1->a_type != a2->a_type || + (a1->a_type == A_FLOAT && + a1->a_w.w_float != a2->a_w.w_float) || + (a1->a_type == A_SYMBOL && + a1->a_w.w_symbol != a2->a_w.w_symbol)) + goto doit; + } + } + doit: + for (i = 0, a1 = sortbuf[thisline]; + a1->a_type != A_SEMI && a1->a_type != A_COMMA; i++, a1++) + ; + binbuf_add(newb, i+1, sortbuf[thisline]); + skipit: ; + } + binbuf_free(x->x_binbuf); + x->x_scalar->sc_vec[2].w_binbuf = x->x_binbuf = newb; + freebytes(sortbuf, nlines * sizeof(*sortbuf)); + textbuf_senditup(&x->x_textbuf); +} + /* notification from GUI that we've been updated */ static void text_define_notify(t_text_define *x) { @@ -2036,6 +2237,8 @@ void x_qlist_setup(void ) gensym("read"), A_GIMME, 0); class_addmethod(text_define_class, (t_method)text_define_send, gensym("send"), A_SYMBOL, 0); + class_addmethod(text_define_class, (t_method)text_define_sort, + gensym("sort"), A_GIMME, 0); class_setsavefn(text_define_class, text_define_save); class_addbang(text_define_class, text_define_bang); class_sethelpsymbol(text_define_class, gensym("text-object")); diff --git a/pd/src/x_vexp.c b/pd/src/x_vexp.c index b11bc5f96f8d9b486af36540174aa429df3e29ea..cee584d24342ac19a6ca40ef6a8ffad3ac278299 100644 --- a/pd/src/x_vexp.c +++ b/pd/src/x_vexp.c @@ -541,7 +541,7 @@ ex_parse(struct expr *x, struct ex_ex *iptr, struct ex_ex *optr, long int *argc) long count; if (!iptr) { - post("ex_parse: input is null, iptr = 0x%lx\n", iptr); + post("ex_parse: input is null, iptr = 0x%zx\n", iptr); return (exNULL); } if (!iptr->ex_type) @@ -674,7 +674,7 @@ ex_parse(struct expr *x, struct ex_ex *iptr, struct ex_ex *optr, long int *argc) case ET_STR: default: ex_print(eptr); - post("expr: ex_parse: type = 0x%lx\n", eptr->ex_type); + post("expr: ex_parse: type = 0x%zx\n", eptr->ex_type); return (exNULL); } @@ -2077,10 +2077,10 @@ ex_print(struct ex_ex *eptr) post("$f%ld ", eptr->ex_int + 1); break; case ET_SI: - post("$s%lx ", eptr->ex_ptr); + post("$s%zx ", eptr->ex_ptr); break; case ET_VI: - post("$v%lx ", eptr->ex_vec); + post("$v%zx ", eptr->ex_vec); break; case ET_VEC: post("vec = %ld ", eptr->ex_vec); @@ -2180,11 +2180,11 @@ ex_print(struct ex_ex *eptr) post("%c", ';'); break; default: - post("expr: ex_print: bad op 0x%lx\n", eptr->ex_op); + post("expr: ex_print: bad op 0x%zx\n", eptr->ex_op); } break; default: - post("expr: ex_print: bad type 0x%lx\n", eptr->ex_type); + post("expr: ex_print: bad type 0x%zx\n", eptr->ex_type); } eptr++; } diff --git a/scripts/external-tests.pd b/scripts/external-tests.pd index 06fd1eb968f1310657580a0dc527e70031b3c7e4..70af1a03f0d6739942088d41876c2ec1f491ab02 100644 --- a/scripts/external-tests.pd +++ b/scripts/external-tests.pd @@ -1,4 +1,4 @@ -#N canvas 9 60 659 633 12; +#N canvas 10 84 659 633 12; #X obj 61 34 loadbang; #N canvas 107 123 756 233 load_hcs/folder_list 0; #X obj 357 47 inlet; @@ -368,7 +368,7 @@ works.; #X connect 28 1 19 1; #X connect 29 0 19 0; #X restore 132 653 pd get-creator-names; -#N canvas 310 187 450 421 test-object 0; +#N canvas 311 211 450 421 test-object 0; #X obj 26 36 inlet; #X text 72 34 creator_name argtype1 argtype2 etc.; #N canvas 372 37 649 659 right_outlet_for_aliases 0; @@ -434,7 +434,7 @@ tests; #X connect 26 1 3 0; #X connect 27 0 12 1; #X restore 194 129 pd right_outlet_for_aliases; -#N canvas 6 60 740 633 load_the_object 0; +#N canvas 787 103 740 854 load_the_object 0; #X obj 22 13 inlet; #X obj 86 115 list split 1; #N canvas 238 121 613 490 set_args 0; @@ -512,29 +512,29 @@ arguments in order to continue the tests, f 45; #X restore 193 168 pd set_args; #X obj 126 140 route bang; #X obj 86 213 list; -#X obj 86 381 s pd-\$0-load_the_object_subpatch; +#X obj 125 521 s pd-\$0-load_the_object_subpatch; #X obj 86 238 t a b; #X msg 118 264 clear; #X text 216 107 Try to instantiate the object and connect up the primary inlet and outlet; -#X msg 54 430 find \$1; -#X obj 54 455 s \$0-load_canvasinfo_input; -#X obj 54 480 r \$0-load_canvasinfo_output; -#X obj 54 505 list split 1; -#X text 261 429 <-- find the object by box text-- it was the first +#X msg 54 570 find \$1; +#X obj 54 595 s \$0-load_canvasinfo_input; +#X obj 54 620 r \$0-load_canvasinfo_output; +#X obj 54 645 list split 1; +#X text 261 569 <-- find the object by box text-- it was the first one on the canvas to get created so it will get returned first if there are any duplicate matches; -#X text 149 505 <-- filter out any duplicate matches from our "helper" +#X text 149 645 <-- filter out any duplicate matches from our "helper" object chain; -#X obj 54 530 t b a; -#X msg 54 555 class; -#X obj 54 580 objectinfo; -#X obj 54 605 select text; -#X text 140 604 <-- the "text" class is an internal class that essentially +#X obj 54 670 t b a; +#X msg 54 695 class; +#X obj 54 720 objectinfo; +#X obj 54 745 select text; +#X text 140 744 <-- the "text" class is an internal class that essentially represents an object box that currently holds no object. So if we query our object and get "text" here \, it means Pd couldn't load the object. ; -#X obj 54 406 trigger anything anything; +#X obj 54 546 trigger anything anything; #N canvas 365 98 450 323 fail 0; #X obj 41 34 inlet; #X obj 112 34 inlet; @@ -548,8 +548,8 @@ our object and get "text" here \, it means Pd couldn't load the object. #X connect 3 0 6 0; #X connect 5 0 3 1; #X connect 6 0 4 0; -#X restore 54 630 pd fail; -#X obj 22 665 outlet; +#X restore 54 770 pd fail; +#X obj 22 805 outlet; #N canvas 436 87 569 401 plain_then_with_libdir_prefix 0; #X obj 35 26 inlet; #X text 128 26 try both the lone creator name and the libdir prefix: @@ -579,10 +579,17 @@ may be other oddities in external libs with regard to libdir prefixes. #X restore 128 57 pd plain_then_with_libdir_prefix; #X obj 22 38 t a a; #X obj 54 89 t a a; -#X msg 86 291 obj 5 30 \$@ \, obj 5 100 r \$0-load_canvasinfo_input +#X msg 125 441 obj 5 30 \$@ \, obj 5 100 r \$0-load_canvasinfo_input \, obj 5 130 canvasinfo \, obj 5 160 s \$0-load_canvasinfo_output \, obj 5 190 r \$0-switch \, obj 5 220 switch~ \, connect 1 0 2 0 \, connect 2 0 3 0 \, connect 4 0 5 0; +#X obj 86 307 unpost; +#X text 137 306 suppress any constructor/error messages associated +with creating this object. In the future we may want to fail the test +if there are errors. For now there are just too many abstractions that +have dependencies on other abstractions \, and the way we're doing +the tests those standard paths aren't accessible. So for now \, we're +just looking for crashers and memory errors...; #X connect 0 0 24 0; #X connect 1 0 4 0; #X connect 1 1 3 0; @@ -591,7 +598,7 @@ obj 5 190 r \$0-switch \, obj 5 220 switch~ \, connect 1 0 2 0 \, connect #X connect 3 0 4 1; #X connect 3 1 2 0; #X connect 4 0 6 0; -#X connect 6 0 26 0; +#X connect 6 0 27 0; #X connect 6 1 7 0; #X connect 7 0 5 0; #X connect 9 0 10 0; @@ -610,11 +617,12 @@ obj 5 190 r \$0-switch \, obj 5 220 switch~ \, connect 1 0 2 0 \, connect #X connect 25 0 20 0; #X connect 25 1 1 0; #X connect 26 0 5 0; -#X restore 46 206 pd load_the_object; +#X connect 27 1 26 0; +#X restore 66 206 pd load_the_object; #N canvas 844 164 450 369 \$0-load_the_object_subpatch 0; -#X restore 191 207 pd \$0-load_the_object_subpatch; -#X msg 46 291 clear; -#X obj 46 316 s pd-\$0-load_the_object_subpatch; +#X restore 211 207 pd \$0-load_the_object_subpatch; +#X msg 66 271 clear; +#X obj 66 296 s pd-\$0-load_the_object_subpatch; #N canvas 135 60 704 645 check_for_namespace_collisions 0; #X obj 42 26 inlet; #X obj 42 51 t a a; @@ -709,10 +717,10 @@ nameclash is in the current library we're testing then we ignore it. #X connect 24 0 22 0; #X restore 194 164 pd check_for_namespace_collisions; #X obj 86 87 s \$0-object-test; -#X obj 66 160 s pd; +#X obj 46 160 s pd; #X obj 26 61 t b b a b; -#X msg 66 131 dsp 1 \, dsp 0; -#X obj 26 345 outlet; +#X msg 46 131 dsp 1 \, dsp 0; +#X obj 26 325 outlet; #N canvas 798 213 450 323 test-dsp 0; #X obj 46 32 inlet; #X obj 46 61 t b b b b; @@ -732,7 +740,7 @@ non-optimized branches.; #X connect 1 3 3 0; #X connect 3 0 4 0; #X connect 6 0 4 0; -#X restore 46 248 pd test-dsp; +#X restore 66 238 pd test-dsp; #X connect 0 0 10 0; #X connect 2 0 7 0; #X connect 2 1 7 0; diff --git a/scripts/regression_tests.pd b/scripts/regression_tests.pd index fc7b8832d55c3d89a664cbbb60891e8a8a54e752..4b8a8c20c7713b30c986cb19b34e0e4d0c16751c 100644 --- a/scripts/regression_tests.pd +++ b/scripts/regression_tests.pd @@ -1,7 +1,7 @@ -#N canvas 339 133 750 572 12; +#N canvas -9 -9 771 392 12; #X obj 465 281 r \$0-result; -#X obj 212 239 bng 31 250 50 0 empty empty Run_all 39 13 0 12 -262144 --1 -1; +#X obj 212 239 bng 15 250 50 0 empty empty Run_all 17 7 0 10 #fcfcfc +#000000 #000000; #X obj 56 25 r init; #X obj 345 191 route dollarzero; #X obj 198 281 rtest msg_dollarzero; @@ -25,13 +25,13 @@ is handy for some binbuf tests.; #X obj 198 659 rtest makefilename_double_percent; #X obj 198 710 rtest makefilename_code_coverage; #N canvas 461 242 450 323 (subpatch) 0; -#X restore 201 2175 pd; +#X restore 201 2605 pd; #X obj 198 761 rtest makefilename_default; #X obj 198 812 rtest makefilename_default_bang; #X obj 198 863 rtest makefilename_float; #X obj 198 914 rtest makefilename_symbol; #X obj 198 965 rtest makefilename_bang; -#X obj 198 1016 rtest drawtext-typecheck; +#X obj 198 1016 rtest drawtext_typecheck; #X obj 465 308 utils/print-result; #X obj 56 231 utils/quit-if-nogui; #X obj 198 1071 rtest list_cat_clear; @@ -58,6 +58,14 @@ is handy for some binbuf tests.; #X obj 198 1976 rtest float_symbol_method; #X obj 198 2031 rtest type_hint_coverage; #X obj 198 2086 rtest route_reject_bang; +#X obj 198 2141 rtest text_sort; +#X obj 198 2196 rtest iemgui_color_symbolargs; +#X obj 198 2251 rtest log_right_inlet; +#X obj 198 2306 rtest log_base; +#X obj 198 2361 rtest inlet~_no_fwd; +#X obj 198 2416 rtest inlet~_fwd_large_message; +#X obj 198 2471 rtest pow~_negative_numbers; +#X obj 198 2526 rtest encapsulate; #X connect 0 0 27 0; #X connect 1 0 4 0; #X connect 2 0 42 0; @@ -101,3 +109,11 @@ is handy for some binbuf tests.; #X connect 49 0 50 0; #X connect 50 0 51 0; #X connect 51 0 52 0; +#X connect 52 0 53 0; +#X connect 53 0 54 0; +#X connect 54 0 55 0; +#X connect 55 0 56 0; +#X connect 56 0 57 0; +#X connect 57 0 58 0; +#X connect 58 0 59 0; +#X connect 59 0 60 0; diff --git a/scripts/regression_tests/drawtext-typecheck.pd b/scripts/regression_tests/drawtext_typecheck.pd similarity index 100% rename from scripts/regression_tests/drawtext-typecheck.pd rename to scripts/regression_tests/drawtext_typecheck.pd diff --git a/scripts/regression_tests/encapsulate.pd b/scripts/regression_tests/encapsulate.pd new file mode 100644 index 0000000000000000000000000000000000000000..7e3fe921e3879876ec60b6e76d3422ce258d77bf --- /dev/null +++ b/scripts/regression_tests/encapsulate.pd @@ -0,0 +1,126 @@ +#N canvas 472 0 948 963 10; +#X obj 794 292 s pd-encapsulate_test.pd; +#X obj 55 22 inlet; +#X obj 65 674 outlet; +#X obj 174 61 t b b; +#X obj 101 318 float; +#X obj 101 273 until; +#X obj 193 318 bang; +#X msg 101 238 bang; +#X obj 86 90 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 +-1; +#X msg 794 96 editmode 1; +#X msg 794 180 encapsulate; +#X obj 651 42 t b b b b b b b b b; +#X msg 169 271 0; +#X msg 794 208 obj_addtobuf pd test; +#X msg 794 236 obj_buftotext; +#X msg 794 264 noselect; +#X obj 102 404 list cat; +#X obj 102 361 moses 5; +#X obj 103 489 unpack f f f f f; +#X obj 103 447 spigot; +#X obj 410 236 float 1; +#X obj 298 567 ==; +#X obj 331 567 ==; +#X obj 367 567 ==; +#X obj 401 567 ==; +#X obj 437 567 ==; +#X obj 491 251 float 0; +#X msg 512 209 clear; +#X obj 371 168 t b b b; +#X obj 474 168 t b b b; +#X obj 404 611 &&; +#X obj 452 611 + 0; +#X obj 386 645 float; +#X obj 606 312 float; +#X obj 606 267 until; +#X obj 698 312 bang; +#X msg 606 232 bang; +#X msg 674 265 0; +#X obj 607 398 list cat; +#X obj 607 355 moses 5; +#X obj 608 483 unpack f f f f f; +#X obj 608 441 spigot; +#X obj 653 312 + 1; +#X msg 794 124 mouse 100 280 1 0; +#X msg 794 152 mouseup 250 380 0; +#X obj 148 318 + 1; +#X obj 65 621 list append encapsulate feature error; +#X connect 1 0 3 0; +#X connect 3 1 11 0; +#X connect 4 0 17 0; +#X connect 4 0 45 0; +#X connect 5 0 4 0; +#X connect 6 0 5 1; +#X connect 7 0 5 0; +#X connect 8 0 3 0; +#X connect 9 0 0 0; +#X connect 10 0 0 0; +#X connect 11 0 28 0; +#X connect 11 1 29 0; +#X connect 11 2 15 0; +#X connect 11 3 14 0; +#X connect 11 4 13 0; +#X connect 11 5 10 0; +#X connect 11 6 44 0; +#X connect 11 7 43 0; +#X connect 11 8 9 0; +#X connect 12 0 4 1; +#X connect 13 0 0 0; +#X connect 14 0 0 0; +#X connect 15 0 0 0; +#X connect 16 0 19 0; +#X connect 17 0 16 0; +#X connect 17 1 6 0; +#X connect 18 0 21 0; +#X connect 18 1 22 0; +#X connect 18 2 23 0; +#X connect 18 3 24 0; +#X connect 18 4 25 0; +#X connect 19 0 18 0; +#X connect 20 0 30 1; +#X connect 20 0 41 1; +#X connect 20 0 19 1; +#X connect 21 0 30 0; +#X connect 22 0 30 0; +#X connect 23 0 30 0; +#X connect 24 0 30 0; +#X connect 25 0 30 0; +#X connect 26 0 41 1; +#X connect 26 0 19 1; +#X connect 27 0 38 1; +#X connect 27 0 16 1; +#X connect 28 0 32 0; +#X connect 28 1 38 0; +#X connect 28 1 16 0; +#X connect 28 2 20 0; +#X connect 29 0 36 0; +#X connect 29 0 7 0; +#X connect 29 1 26 0; +#X connect 29 2 27 0; +#X connect 29 2 12 0; +#X connect 30 0 31 0; +#X connect 30 0 32 0; +#X connect 31 0 30 1; +#X connect 32 0 46 0; +#X connect 33 0 39 0; +#X connect 33 0 42 0; +#X connect 34 0 33 0; +#X connect 35 0 34 1; +#X connect 36 0 34 0; +#X connect 37 0 33 1; +#X connect 38 0 41 0; +#X connect 39 0 38 0; +#X connect 39 1 35 0; +#X connect 40 0 21 1; +#X connect 40 1 22 1; +#X connect 40 2 23 1; +#X connect 40 3 24 1; +#X connect 40 4 25 1; +#X connect 41 0 40 0; +#X connect 42 0 33 1; +#X connect 43 0 0 0; +#X connect 44 0 0 0; +#X connect 45 0 4 1; +#X connect 46 0 2 0; diff --git a/scripts/regression_tests/iemgui_color_symbolargs.pd b/scripts/regression_tests/iemgui_color_symbolargs.pd new file mode 100644 index 0000000000000000000000000000000000000000..d355ce23c76f186c14452dd9d88850bde50c218e --- /dev/null +++ b/scripts/regression_tests/iemgui_color_symbolargs.pd @@ -0,0 +1,100 @@ +#N canvas 1 24 1329 701 12; +#X obj 877 305 bng 15 250 50 0 empty empty empty 17 7 0 10 #ff66ff +#000000 #fcccfc; +#X msg 812 124 color #ff66ff; +#X text 782 82 accept the common 6-digit hex syntas; +#X obj 838 209 unpost; +#X obj 812 163 trigger bang anything bang; +#X obj 813 268 list; +#X obj 607 305 bng 15 250 50 0 empty empty empty 17 7 0 10 #ff66ff +#000000 #fcccfc; +#X obj 568 209 unpost; +#X obj 542 163 trigger bang anything bang; +#X obj 543 268 list; +#X msg 542 124 color #f6f; +#X obj 107 365 bng 15 250 50 0 empty empty empty 17 7 0 10 #000000 +#000000 #fcccfc; +#X obj 68 269 unpost; +#X obj 42 223 trigger bang anything bang; +#X obj 43 328 list; +#X text 53 122 reject any non-standard symbols; +#X msg 42 154 symbol; +#X obj 43 387 list length; +#X obj 813 327 list length; +#X obj 813 422 list append iemgui color method should accept 6-digit +hex format; +#X msg 42 184 color \$1 \, color # \, color #a \, color #ffffff0 \, +color foo \, color ffff99, f 34; +#X obj 43 585 list append iemgui color method should reject empty symbol +and non-standard hex notation arguments; +#X obj 543 327 list length; +#X obj 543 469 list append iemgui color method should accept short +3-digit hex notation; +#X obj 43 630 outlet; +#X obj 42 34 inlet; +#X obj 42 63 trigger bang bang bang bang; +#X obj 302 181 canvasinfo; +#X msg 302 149 pointer; +#X obj 367 385 bng 15 250 50 0 empty empty empty 17 7 0 10 #000000 +#000000 #fcccfc; +#X obj 328 289 unpost; +#X obj 302 243 trigger bang anything bang; +#X obj 303 348 list; +#X obj 303 407 list length; +#X text 302 115 reject gpointer; +#X obj 303 536 list append iemgui color method should only accept symbol +and float arguments; +#X msg 302 210 color \$1; +#X text 503 75 accept the "short" hex notation; +#X obj 813 356 == 0; +#X obj 543 356 == 0; +#X obj 303 436 != 0; +#X obj 43 416 != 0; +#X connect 1 0 4 0; +#X connect 3 0 5 1; +#X connect 3 1 0 0; +#X connect 4 0 5 0; +#X connect 4 1 3 0; +#X connect 4 2 5 1; +#X connect 5 0 18 0; +#X connect 7 0 9 1; +#X connect 7 1 6 0; +#X connect 8 0 9 0; +#X connect 8 1 7 0; +#X connect 8 2 9 1; +#X connect 9 0 22 0; +#X connect 10 0 8 0; +#X connect 12 0 14 1; +#X connect 12 1 11 0; +#X connect 13 0 14 0; +#X connect 13 1 12 0; +#X connect 13 2 14 1; +#X connect 14 0 17 0; +#X connect 16 0 20 0; +#X connect 17 0 41 0; +#X connect 18 0 38 0; +#X connect 19 0 24 0; +#X connect 20 0 13 0; +#X connect 21 0 24 0; +#X connect 22 0 39 0; +#X connect 23 0 24 0; +#X connect 25 0 26 0; +#X connect 26 0 16 0; +#X connect 26 1 28 0; +#X connect 26 2 10 0; +#X connect 26 3 1 0; +#X connect 27 0 36 0; +#X connect 28 0 27 0; +#X connect 30 0 32 1; +#X connect 30 1 29 0; +#X connect 31 0 32 0; +#X connect 31 1 30 0; +#X connect 31 2 32 1; +#X connect 32 0 33 0; +#X connect 33 0 40 0; +#X connect 35 0 24 0; +#X connect 36 0 31 0; +#X connect 38 0 19 0; +#X connect 39 0 23 0; +#X connect 40 0 35 0; +#X connect 41 0 21 0; diff --git a/scripts/regression_tests/inlet~_fwd_large_message.pd b/scripts/regression_tests/inlet~_fwd_large_message.pd new file mode 100644 index 0000000000000000000000000000000000000000..e8b34272e24cfe8e500167083639d60f52234f55 --- /dev/null +++ b/scripts/regression_tests/inlet~_fwd_large_message.pd @@ -0,0 +1,23 @@ +#N canvas 240 193 835 453 12; +#X obj 57 22 inlet; +#X obj 57 260 outlet; +#X msg 57 51 bang; +#X obj 321 27 array define \$0-big; +#X obj 318 160 array size \$0-big; +#X msg 318 135 5e+06; +#X obj 132 138 array get \$0-big; +#N canvas 0 0 450 300 \$0-fwd-test~ 0; +#X obj 61 40 inlet~ fwd; +#X restore 132 176 pd \$0-fwd-test~; +#X obj 57 79 trigger bang bang bang; +#X obj 57 138 f 1; +#X obj 57 215 list append large messages to [inlet~ fwd] should not +blow the stack; +#X connect 0 0 2 0; +#X connect 2 0 8 0; +#X connect 5 0 4 0; +#X connect 8 0 9 0; +#X connect 8 1 6 0; +#X connect 8 2 5 0; +#X connect 9 0 10 0; +#X connect 10 0 1 0; diff --git a/scripts/regression_tests/inlet~_no_fwd.pd b/scripts/regression_tests/inlet~_no_fwd.pd new file mode 100644 index 0000000000000000000000000000000000000000..2ade5b6fffe6d30d76ea8b7737f2f431d7319cd1 --- /dev/null +++ b/scripts/regression_tests/inlet~_no_fwd.pd @@ -0,0 +1,23 @@ +#N canvas 239 169 507 299 12; +#X obj 57 22 inlet; +#X obj 57 230 outlet; +#N canvas 0 0 450 300 \$0-test~ 0; +#X obj 61 40 inlet~; +#X restore 171 146 pd \$0-test~; +#X obj 132 117 unpost; +#X obj 57 117 list; +#X obj 57 146 list length; +#X obj 57 185 list append non-signal message to inlet~ should trigger +an error; +#X msg 57 51 bang; +#X obj 57 79 trigger bang bang bang; +#X connect 0 0 7 0; +#X connect 3 0 4 1; +#X connect 3 1 2 0; +#X connect 4 0 5 0; +#X connect 5 0 6 0; +#X connect 6 0 1 0; +#X connect 7 0 8 0; +#X connect 8 0 4 0; +#X connect 8 1 3 0; +#X connect 8 2 4 1; diff --git a/scripts/regression_tests/log_base.pd b/scripts/regression_tests/log_base.pd new file mode 100644 index 0000000000000000000000000000000000000000..dfa72a7db3b2a0e48a452f737fd93d01a0b2aae5 --- /dev/null +++ b/scripts/regression_tests/log_base.pd @@ -0,0 +1,24 @@ +#N canvas 329 252 685 317 12; +#X obj 57 22 inlet; +#X obj 57 240 outlet; +#X obj 173 111 log; +#X msg 207 83 2; +#X msg 173 83 2; +#X obj 57 51 trigger bang bang bang; +#X obj 173 140 == 1; +#X msg 57 80 2; +#X obj 57 169 log 2; +#X obj 57 198 list append log's argument sets the base; +#X obj 173 169 list append log's right inlet sets the base; +#X connect 0 0 5 0; +#X connect 2 0 6 0; +#X connect 3 0 2 1; +#X connect 4 0 2 0; +#X connect 5 0 7 0; +#X connect 5 1 4 0; +#X connect 5 2 3 0; +#X connect 6 0 10 0; +#X connect 7 0 8 0; +#X connect 8 0 9 0; +#X connect 9 0 1 0; +#X connect 10 0 1 0; diff --git a/scripts/regression_tests/log_right_inlet.pd b/scripts/regression_tests/log_right_inlet.pd new file mode 100644 index 0000000000000000000000000000000000000000..c2b6f680402b5897d9057f85ae8e9571fcab20b7 --- /dev/null +++ b/scripts/regression_tests/log_right_inlet.pd @@ -0,0 +1,14 @@ +#N canvas 328 228 685 317 12; +#X obj 57 22 inlet; +#X obj 57 230 outlet; +#X obj 57 111 ../utils/object-test inlets; +#X msg 57 81 symbol log; +#X obj 57 140 == 2; +#X obj 57 169 list append log has a right inlet for the base; +#X obj 57 51 bang; +#X connect 0 0 6 0; +#X connect 2 0 4 0; +#X connect 3 0 2 0; +#X connect 4 0 5 0; +#X connect 5 0 1 0; +#X connect 6 0 3 0; diff --git a/scripts/regression_tests/pow~_negative_numbers.pd b/scripts/regression_tests/pow~_negative_numbers.pd new file mode 100644 index 0000000000000000000000000000000000000000..96bf34e6a42467c6b67a0bd9081f956c6449a1b9 --- /dev/null +++ b/scripts/regression_tests/pow~_negative_numbers.pd @@ -0,0 +1,27 @@ +#N canvas 320 117 911 463 12; +#X obj 41 28 inlet; +#X obj 41 404 outlet; +#X msg 41 56 bang; +#X msg 41 135 -2; +#X obj 41 164 ../utils/sigtofloat~ pow~ 2; +#X obj 41 193 == 4; +#X obj 41 222 list append pow~ should handle negative numbers correctly +for integer powers; +#X obj 41 85 trigger bang bang; +#X msg 461 135 -2; +#X obj 461 164 ../utils/sigtofloat~ pow~ 2.5; +#X obj 461 222 list append pow~ should output zero for negative numbers +when given a non-integer power; +#X obj 461 193 == 0; +#X connect 0 0 2 0; +#X connect 2 0 7 0; +#X connect 3 0 4 0; +#X connect 4 0 5 0; +#X connect 5 0 6 0; +#X connect 6 0 1 0; +#X connect 7 0 3 0; +#X connect 7 1 8 0; +#X connect 8 0 9 0; +#X connect 9 0 11 0; +#X connect 10 0 1 0; +#X connect 11 0 10 0; diff --git a/scripts/regression_tests/text_sort.pd b/scripts/regression_tests/text_sort.pd new file mode 100644 index 0000000000000000000000000000000000000000..4af684122da5ce37cd7b0f7d55d0534aaaf3aa3a --- /dev/null +++ b/scripts/regression_tests/text_sort.pd @@ -0,0 +1,116 @@ +#N canvas 24 67 1287 678 12; +#X obj 100 33 inlet; +#X obj 153 632 outlet; +#X obj 100 62 trigger bang bang; +#X msg 216 98 sort; +#X obj 216 132 text define -k \$0-test; +#A set z \; a \; a a \; a y \;; +#X obj 520 266 text get \$0-test; +#X msg 120 125 bang; +#X obj 520 295 list split 1; +#X obj 520 324 select a; +#X obj 610 324 select a; +#X obj 663 351 b; +#X obj 663 380 f 0; +#X obj 610 353 f 1; +#X obj 573 351 b; +#X obj 573 380 f 0; +#X obj 520 353 f 1; +#X obj 573 418 &&; +#X obj 573 447 list append sort method to [text] correctly sorted the +second line; +#X obj 750 216 text get \$0-test; +#X obj 750 274 select a; +#X obj 803 301 b; +#X obj 803 330 f 0; +#X obj 750 303 f 1; +#X obj 803 368 &&; +#X obj 803 397 list append sort method to [text] correctly sorted the +first line; +#X obj 750 245 trigger anything anything; +#X obj 840 274 list length; +#X obj 310 326 text get \$0-test; +#X obj 310 355 list split 1; +#X obj 310 384 select a; +#X obj 453 411 b; +#X obj 453 440 f 0; +#X obj 400 413 f 1; +#X obj 363 411 b; +#X obj 363 440 f 0; +#X obj 310 413 f 1; +#X obj 363 478 &&; +#X obj 400 384 select y; +#X obj 100 386 text get \$0-test; +#X obj 153 471 b; +#X obj 153 500 f 0; +#X obj 100 473 f 1; +#X obj 153 538 &&; +#X obj 100 415 trigger anything anything; +#X obj 190 444 list length; +#X obj 100 444 select z; +#X obj 100 161 trigger 3 2 1 0; +#X obj 363 507 list append sort method to [text] correctly sorted the +third line; +#X obj 153 567 list append sort method to [text] correctly sorted the +last line; +#X connect 0 0 2 0; +#X connect 2 0 46 0; +#X connect 2 1 3 0; +#X connect 3 0 4 0; +#X connect 5 0 7 0; +#X connect 6 0 46 0; +#X connect 7 0 8 0; +#X connect 7 1 9 0; +#X connect 8 0 15 0; +#X connect 8 1 13 0; +#X connect 9 0 12 0; +#X connect 9 1 10 0; +#X connect 10 0 11 0; +#X connect 11 0 16 1; +#X connect 12 0 16 1; +#X connect 13 0 14 0; +#X connect 14 0 16 0; +#X connect 15 0 16 0; +#X connect 16 0 17 0; +#X connect 17 0 1 0; +#X connect 18 0 25 0; +#X connect 19 0 22 0; +#X connect 19 1 20 0; +#X connect 20 0 21 0; +#X connect 21 0 23 0; +#X connect 22 0 23 0; +#X connect 23 0 24 0; +#X connect 24 0 1 0; +#X connect 25 0 19 0; +#X connect 25 1 26 0; +#X connect 26 0 23 1; +#X connect 27 0 28 0; +#X connect 28 0 29 0; +#X connect 28 1 37 0; +#X connect 29 0 35 0; +#X connect 29 1 33 0; +#X connect 30 0 31 0; +#X connect 31 0 36 1; +#X connect 32 0 36 1; +#X connect 33 0 34 0; +#X connect 34 0 36 0; +#X connect 35 0 36 0; +#X connect 36 0 47 0; +#X connect 37 0 32 0; +#X connect 37 1 30 0; +#X connect 38 0 43 0; +#X connect 39 0 40 0; +#X connect 40 0 42 0; +#X connect 41 0 42 0; +#X connect 42 0 48 0; +#X connect 43 0 45 0; +#X connect 43 1 44 0; +#X connect 44 0 42 1; +#X connect 45 0 41 0; +#X connect 45 1 39 0; +#X connect 46 0 38 0; +#X connect 46 1 27 0; +#X connect 46 2 5 0; +#X connect 46 3 18 0; +#X connect 47 0 1 0; +#X connect 48 0 1 0; diff --git a/scripts/regression_tests/wrap~_compatibility_bug.pd b/scripts/regression_tests/wrap~_compatibility_bug.pd index d5fb2e3fb456e867e07cebe82b030d68879ac1ce..ceacda737e92670e2ec2b86ac83086eec6a5eda0 100644 --- a/scripts/regression_tests/wrap~_compatibility_bug.pd +++ b/scripts/regression_tests/wrap~_compatibility_bug.pd @@ -1,4 +1,4 @@ -#N canvas 78 98 647 470 12; +#N canvas 79 122 647 470 12; #X obj 18 15 inlet; #X obj 508 171 ../utils/sigtofloat~ wrap~; #X floatatom 508 200 5 0 0 0 - - -, f 5; diff --git a/scripts/utils/creation-test.pd b/scripts/utils/creation-test.pd index 874ae99e2fb27ee85a51abafa3a2aeaf1d25a748..149bd0a6d84e719cfa6c2cf06d149d88a46fdd76 100644 --- a/scripts/utils/creation-test.pd +++ b/scripts/utils/creation-test.pd @@ -1,59 +1,18 @@ -#N canvas 311 60 683 597 12; -#X text 97 22 Simple abstraction to test object creation; -#N canvas 82 171 450 346 \$0-test 0; -#X obj 200 20 receive 1004-in; -#X obj 200 60 canvasinfo; -#X obj 200 100 send 1004-out; -#X obj 0 0 cxc/hex2dec; +#N canvas 247 65 536 318 12; +#X obj 46 36 inlet; +#X obj 46 65 object-test class; +#X obj 46 94 select text; +#X msg 46 123 0; +#X obj 120 123 b; +#X msg 120 152 1; +#X obj 46 202 outlet; +#X text 107 193 simple creation test. if the object we tried to create +has the "text" class \, we know it's a broken object. Otherwise \, +it should have created successfully.; #X connect 0 0 1 0; #X connect 1 0 2 0; -#X restore 110 329 pd \$0-test; -#X obj 28 22 inlet; -#X obj 71 141 list prepend obj 0 0; -#X obj 71 166 list trim; -#X obj 110 231 send pd-\$0-test; -#X obj 28 97 trigger anything anything bang; -#X obj 28 261 list prepend find; -#X obj 235 124 f \$0; -#X msg 262 93 bang; -#X obj 28 316 send \$0-in; -#X obj 28 345 r \$0-out; -#X msg 235 151 clear \, obj 200 20 receive \$1-in \, obj 200 60 canvasinfo -\, obj 200 100 send \$1-out \, connect 0 0 1 0 \, connect 1 0 2 0; -#X msg 28 370 list \$1; -#X obj 28 395 t b a; -#X obj 28 447 objectinfo; -#X msg 28 420 class; -#X obj 28 286 list trim; -#X text 63 53 for everything except receive \, send \, and canvasinfo -\, or comments; -#X obj 28 472 select text; -#X msg 28 497 0; -#X obj 102 497 b; -#X msg 102 522 1; -#X obj 28 559 outlet; -#X obj 71 191 unpost; -#X text 126 192 <- supress creation error message; -#X connect 2 0 6 0; -#X connect 3 0 4 0; -#X connect 4 0 24 0; -#X connect 6 0 7 0; -#X connect 6 1 3 0; -#X connect 6 2 8 0; -#X connect 7 0 17 0; -#X connect 8 0 12 0; -#X connect 9 0 8 0; -#X connect 11 0 13 0; -#X connect 12 0 5 0; -#X connect 13 0 14 0; -#X connect 14 0 16 0; -#X connect 14 1 15 1; -#X connect 15 0 19 0; -#X connect 16 0 15 0; -#X connect 17 0 10 0; -#X connect 19 0 20 0; -#X connect 19 1 21 0; -#X connect 20 0 23 0; -#X connect 21 0 22 0; -#X connect 22 0 23 0; -#X connect 24 1 5 0; +#X connect 2 0 3 0; +#X connect 2 1 4 0; +#X connect 3 0 6 0; +#X connect 4 0 5 0; +#X connect 5 0 6 0; diff --git a/scripts/utils/object-test.pd b/scripts/utils/object-test.pd new file mode 100644 index 0000000000000000000000000000000000000000..70308509056d3579d7b4f6e72b9f6333aedbc18a --- /dev/null +++ b/scripts/utils/object-test.pd @@ -0,0 +1,46 @@ +#N canvas 144 162 683 597 12; +#N canvas 82 171 450 346 \$0-test 0; +#X restore 110 329 pd \$0-test; +#X obj 28 22 inlet; +#X obj 71 141 list prepend obj 0 0; +#X obj 71 166 list trim; +#X obj 110 231 send pd-\$0-test; +#X obj 28 97 trigger anything anything bang; +#X obj 28 261 list prepend find; +#X obj 235 124 f \$0; +#X msg 262 93 bang; +#X obj 28 316 send \$0-in; +#X obj 28 345 r \$0-out; +#X msg 235 151 clear \, obj 200 20 receive \$1-in \, obj 200 60 canvasinfo +\, obj 200 100 send \$1-out \, connect 0 0 1 0 \, connect 1 0 2 0; +#X msg 28 370 list \$1; +#X obj 28 395 t b a; +#X obj 28 500 objectinfo; +#X obj 28 286 list trim; +#X text 63 53 for everything except receive \, send \, and canvasinfo +\, or comments; +#X obj 28 529 outlet; +#X obj 71 191 unpost; +#X text 126 192 <- supress creation error message; +#X obj 28 427 list append \$1; +#X text 97 22 Simple \, light wrapper around [objectinfo] methods; +#X obj 28 456 list trim; +#X connect 1 0 5 0; +#X connect 2 0 3 0; +#X connect 3 0 18 0; +#X connect 5 0 6 0; +#X connect 5 1 2 0; +#X connect 5 2 7 0; +#X connect 6 0 15 0; +#X connect 7 0 11 0; +#X connect 8 0 7 0; +#X connect 10 0 12 0; +#X connect 11 0 4 0; +#X connect 12 0 13 0; +#X connect 13 0 20 0; +#X connect 13 1 14 1; +#X connect 14 0 17 0; +#X connect 15 0 9 0; +#X connect 18 1 4 0; +#X connect 20 0 22 0; +#X connect 22 0 14 0; diff --git a/scripts/utils/sigtofloat~.pd b/scripts/utils/sigtofloat~.pd index 91c1059ad76a855281b1e0e5b53749ed16a2c140..6fdc6302e30a8154bd9c29d1571eec33986ef475 100644 --- a/scripts/utils/sigtofloat~.pd +++ b/scripts/utils/sigtofloat~.pd @@ -1,6 +1,5 @@ -#N canvas 738 437 450 381 12; +#N canvas 739 461 450 381 12; #X obj 26 20 inlet; -#X obj 149 160 \$1; #X obj 149 134 sig~; #X obj 149 189 snapshot~; #X obj 26 76 t b b a b; @@ -14,15 +13,16 @@ float is converted to leftmost signal inlet. A single block is computed to generate the float output.; #X obj 149 218 outlet; -#X connect 0 0 4 0; -#X connect 1 0 3 0; -#X connect 2 0 1 0; -#X connect 3 0 12 0; -#X connect 4 0 8 0; -#X connect 4 1 7 0; -#X connect 4 2 2 0; -#X connect 4 3 5 0; -#X connect 5 0 6 0; +#X obj 149 160 \$@; +#X connect 0 0 3 0; +#X connect 1 0 12 0; +#X connect 2 0 11 0; +#X connect 3 0 7 0; +#X connect 3 1 6 0; +#X connect 3 2 1 0; +#X connect 3 3 4 0; +#X connect 4 0 5 0; +#X connect 7 0 8 0; +#X connect 7 1 2 0; #X connect 8 0 9 0; -#X connect 8 1 3 0; -#X connect 9 0 10 0; +#X connect 12 0 2 0;