diff -Nru spiralsynthmodular-0.2.2a/aclocal.m4 spiralsynthmodular-0.2.3+git20140329/aclocal.m4 --- spiralsynthmodular-0.2.2a/aclocal.m4 2004-02-14 09:12:58.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/aclocal.m4 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -dnl aclocal.m4 generated automatically by aclocal 1.4 - -dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl This program is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without -dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A -dnl PARTICULAR PURPOSE. - -# Like AC_CONFIG_HEADER, but automatically create stamp file. - -AC_DEFUN(AM_CONFIG_HEADER, -[AC_PREREQ([2.12]) -AC_CONFIG_HEADER([$1]) -dnl When config.status generates a header, we must update the stamp-h file. -dnl This file resides in the same directory as the config header -dnl that is generated. We must strip everything past the first ":", -dnl and everything past the last "/". -AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl -ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, -<>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, -<>; do - case " <<$>>CONFIG_HEADERS " in - *" <<$>>am_file "*<<)>> - echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx - ;; - esac - am_indx=`expr "<<$>>am_indx" + 1` -done<<>>dnl>>) -changequote([,]))]) - diff -Nru spiralsynthmodular-0.2.2a/autogen.sh spiralsynthmodular-0.2.3+git20140329/autogen.sh --- spiralsynthmodular-0.2.2a/autogen.sh 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/autogen.sh 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,123 @@ +#!/bin/sh +# +# autogen.sh - Generates the initial makefiles from a pristine CVS tree +# +# $Id: autogen.sh,v 1.1 2002-10-30 22:38:35 nebogeo Exp $ +# +# USAGE: autogen.sh [configure options] +# +# If environment variable DRYRUN is set, no configuring will be done - +# (e.g. in bash) DRYRUN=1 ./autogen.sh +# will not do any configuring but will emit the programs that would be run. +# +# This script is based on similar scripts used in various tools +# commonly made available via CVS and used with GNU automake. +# Try 'locate autogen.sh' on your system and see what you get. +# + +PACKAGE=spiralsynthmodular +DIE= + +if test "X$DRYRUN" != X; then + DRYRUN=echo +fi + +autoconf_vers=2.13 +automake_vers=1.4 +aclocal_vers=1.4 + +program=`basename $0` + +if (autoconf --version) < /dev/null > /dev/null 2>&1 ; then + if (autoconf --version | awk 'NR==1 { if( $3 >= '$autoconf_vers') \ + exit 1; exit 0; }'); + then + echo "$program: ERROR: \`autoconf' is too old." + echo " (version $autoconf_vers or newer is required)" + DIE="yes" + fi +else + echo + echo "$program: ERROR: You must have \`autoconf' installed to compile $PACKAGE." + echo " (version $autoconf_vers or newer is required)" + DIE="yes" +fi + +# Ensure that these are created by the versions on this system +# (indirectly via automake) +rm -f libtool ltmain.sh +if (automake --version) < /dev/null > /dev/null 2>&1 ; then + if (automake --version | awk 'NR==1 { if( $4 >= '$automake_vers') \ + exit 1; exit 0; }'); + then + echo "$program: ERROR: \`automake' is too old." + echo " (version $automake_vers or newer is required)" + DIE="yes" + fi + if (aclocal --version) < /dev/null > /dev/null 2>&1; then + if (aclocal --version | awk 'NR==1 { if( $4 >= '$aclocal_vers' ) \ + exit 1; exit 0; }' ); + then + echo "$program: ERROR: \`aclocal' is too old." + echo " (version $aclocal_vers or newer is required)" + DIE="yes" + fi + else + echo + echo "$program: ERROR: Missing \`aclocal'" + echo " The version of automake installed doesn't appear recent enough." + DIE="yes" + fi +else + echo + echo "$program: ERROR: You must have \`automake' installed to compile $PACKAGE." + echo " (version $automake_vers or newer is required)" + DIE="yes" +fi + + +if test "X$DIE" != X; then + exit 1 +fi + +if test -z "$*"; then + echo "$program: WARNING: Running \`configure' with no arguments." + echo "If you wish to pass any to it, please specify them on the" + echo "\`$0' command line." +fi + +am_opt= + +for coin in `find $srcdir -name configure.in -print` +do + dir=`dirname $coin` + if test -f $dir/NO-AUTO-GEN; then + echo $program: Skipping $dir -- flagged as no auto-gen + else + echo $program: Processing directory $dir + ( cd $dir + aclocalinclude="$ACLOCAL_FLAGS" + echo "$program: Running aclocal $aclocalinclude" + $DRYRUN aclocal $aclocalinclude + if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then + echo "$program: Running autoheader" + $DRYRUN autoheader + fi + echo "$program: Running automake $am_opt" + $DRYRUN automake --add-missing $am_opt + echo "$program: Running autoconf" + $DRYRUN autoconf + ) + fi +done + +conf_flags= + +echo "$program: Running ./configure $conf_flags $@" +if test "X$DRYRUN" = X; then + $DRYRUN ./configure $conf_flags "$@" \ + && echo "$program: Now type \`make' to compile $PACKAGE" || exit 1 +else + $DRYRUN ./configure $conf_flags "$@" +fi + diff -Nru spiralsynthmodular-0.2.2a/CHANGES spiralsynthmodular-0.2.3+git20140329/CHANGES --- spiralsynthmodular-0.2.2a/CHANGES 2004-02-14 09:09:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/CHANGES 2012-05-31 04:13:57.000000000 +0000 @@ -1,3 +1,20 @@ +CVS 0.2.3 + +New plugin menu on canvas +New mouse clicks Button 1 = Box select devices, Move devices + Button 2 (Shift Button 1) = Drag Canvas, Multi select + Button 3 (Ctrl Button 1) = Edit and Plugin menu, Multi Select +Updated streamer - Now shows file name. + New output CV that rises from 0 to 1 as stream plays +Envelope update - Added a filter to smooth out clicks on very fast attack levels +Scope and Meter have moved to the Input/Output group +PoshSampler now has a button - ReTrigger, when this button is OFF, a sample cannot + be retriggered until it has finished playing. +PoshSampler bug fixes, now displays correct settings for Loop, PingPong, ReTrigger, + Volume, Pitch, Octave, and TrigNote when you change the sample + being displayed +New pause and Reset button on GUI to pause audio and reset all plugins. + Release 0.2.2 New GUI - less cluttered and more "traditional" toolbars. diff -Nru spiralsynthmodular-0.2.2a/config.h.in spiralsynthmodular-0.2.3+git20140329/config.h.in --- spiralsynthmodular-0.2.2a/config.h.in 2004-02-14 09:12:59.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/config.h.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ -/* config.h.in. Generated automatically from configure.in by autoheader. */ - -/* Define to empty if the keyword does not work. */ -#undef const - -/* Define as __inline if that's what the C compiler calls it. */ -#undef inline - -/* Define if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define if the X Window System is missing or not being used. */ -#undef X_DISPLAY_MISSING - -/* Define if you have the header file. */ -#undef HAVE_FL_FL_H - -/* Define if you have the header file. */ -#undef HAVE_GL_GL_H - -/* Define if you have the header file. */ -#undef HAVE_DLFCN_H - -/* Define if you have the header file. */ -#undef HAVE_MATH_H - -/* Define if you have the dl library (-ldl). */ -#undef HAVE_LIBDL - -/* Define if you have the fltk library (-lfltk). */ -#undef HAVE_LIBFLTK - -/* Define if you have the m library (-lm). */ -#undef HAVE_LIBM - -/* Enable liblrdf support for LADSPA Plugin */ -#undef HAVE_LIBLRDF - -/* Use ALSA MIDI not OSS */ -#undef USE_ALSA_MIDI - -/* Use OSS MIDI not ALSA */ -#undef USE_OSS_MIDI - -/* Enable libsndfile for waveform loading */ -#undef USE_LIBSNDFILE - diff -Nru spiralsynthmodular-0.2.2a/configure spiralsynthmodular-0.2.3+git20140329/configure --- spiralsynthmodular-0.2.2a/configure 2004-02-14 09:12:59.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/configure 1970-01-01 00:00:00.000000000 +0000 @@ -1,3386 +0,0 @@ -#! /bin/sh - -# Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13 -# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. - -# Defaults: -ac_help= -ac_default_prefix=/usr/local -# Any additions from configure.in: -ac_help="$ac_help - --with-plugindir=dir give the plugin directory" -ac_help="$ac_help - --enable-debug enable debugging " -ac_help="$ac_help - --disable-jack Do not build JackPlugin" -ac_help="$ac_help - --disable-ladspa Do not build LADSPAPlugin" -ac_help="$ac_help - --disable-lrdf Disable liblrdf for LADSPA Plugin" -ac_help="$ac_help - --disable-alsa-midi Disable alsa midi (use OSS)" -ac_help="$ac_help - --disable-sndfile Disable libsndfile for waveform loading" -ac_help="$ac_help - --with-x use the X Window System" - -# Initialize some variables set by options. -# The variables have the same names as the options, with -# dashes changed to underlines. -build=NONE -cache_file=./config.cache -exec_prefix=NONE -host=NONE -no_create= -nonopt=NONE -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -target=NONE -verbose= -x_includes=NONE -x_libraries=NONE -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' -includedir='${prefix}/include' -oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' - -# Initialize some other variables. -subdirs= -MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -ac_max_here_lines=12 - -ac_prev= -for ac_option -do - - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" - ac_prev= - continue - fi - - case "$ac_option" in - -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) ac_optarg= ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case "$ac_option" in - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir="$ac_optarg" ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build="$ac_optarg" ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file="$ac_optarg" ;; - - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) - datadir="$ac_optarg" ;; - - -disable-* | --disable-*) - ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - eval "enable_${ac_feature}=no" ;; - - -enable-* | --enable-*) - ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "enable_${ac_feature}='$ac_optarg'" ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix="$ac_optarg" ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he) - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat << EOF -Usage: configure [options] [host] -Options: [defaults in brackets after descriptions] -Configuration: - --cache-file=FILE cache test results in FILE - --help print this message - --no-create do not create output files - --quiet, --silent do not print \`checking...' messages - --version print the version of autoconf that created configure -Directory and file names: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [same as prefix] - --bindir=DIR user executables in DIR [EPREFIX/bin] - --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] - --libexecdir=DIR program executables in DIR [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data in DIR - [PREFIX/share] - --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data in DIR - [PREFIX/com] - --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] - --libdir=DIR object code libraries in DIR [EPREFIX/lib] - --includedir=DIR C header files in DIR [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] - --infodir=DIR info documentation in DIR [PREFIX/info] - --mandir=DIR man documentation in DIR [PREFIX/man] - --srcdir=DIR find the sources in DIR [configure dir or ..] - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM - run sed PROGRAM on installed program names -EOF - cat << EOF -Host type: - --build=BUILD configure for building on BUILD [BUILD=HOST] - --host=HOST configure for HOST [guessed] - --target=TARGET configure for TARGET [TARGET=HOST] -Features and packages: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR -EOF - if test -n "$ac_help"; then - echo "--enable and --with options recognized:$ac_help" - fi - exit 0 ;; - - -host | --host | --hos | --ho) - ac_prev=host ;; - -host=* | --host=* | --hos=* | --ho=*) - host="$ac_optarg" ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir="$ac_optarg" ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir="$ac_optarg" ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir="$ac_optarg" ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir="$ac_optarg" ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - localstatedir="$ac_optarg" ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir="$ac_optarg" ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir="$ac_optarg" ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix="$ac_optarg" ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix="$ac_optarg" ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix="$ac_optarg" ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name="$ac_optarg" ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir="$ac_optarg" ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir="$ac_optarg" ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site="$ac_optarg" ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir="$ac_optarg" ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir="$ac_optarg" ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target="$ac_optarg" ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.13" - exit 0 ;; - - -with-* | --with-*) - ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "with_${ac_package}='$ac_optarg'" ;; - - -without-* | --without-*) - ac_package=`echo $ac_option|sed -e 's/-*without-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - eval "with_${ac_package}=no" ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes="$ac_optarg" ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries="$ac_optarg" ;; - - -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } - ;; - - *) - if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then - echo "configure: warning: $ac_option: invalid host type" 1>&2 - fi - if test "x$nonopt" != xNONE; then - { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } - fi - nonopt="$ac_option" - ;; - - esac -done - -if test -n "$ac_prev"; then - { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } -fi - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 6 checking for... messages and results -# 5 compiler messages saved in config.log -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 -fi -exec 5>./config.log - -echo "\ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. -" 1>&5 - -# Strip out --no-create and --no-recursion so they do not pile up. -# Also quote any args containing shell metacharacters. -ac_configure_args= -for ac_arg -do - case "$ac_arg" in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ac_configure_args="$ac_configure_args '$ac_arg'" ;; - *) ac_configure_args="$ac_configure_args $ac_arg" ;; - esac -done - -# NLS nuisances. -# Only set these to C if already set. These must not be set unconditionally -# because not all systems understand e.g. LANG=C (notably SCO). -# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! -# Non-C LC_CTYPE values break the ctype check. -if test "${LANG+set}" = set; then LANG=C; export LANG; fi -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi -if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo > confdefs.h - -# A filename unique to this package, relative to the directory that -# configure is in, which we can look for to find out if srcdir is correct. -ac_unique_file=SpiralSynthModular.C - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_prog=$0 - ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` - test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. - srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } - else - { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } - fi -fi -srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` - -# Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi -fi -for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then - echo "loading site script $ac_site_file" - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - echo "loading cache $cache_file" - . $cache_file -else - echo "creating cache $cache_file" - > $cache_file -fi - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -ac_exeext= -ac_objext=o -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ac_n= ac_c=' -' ac_t=' ' - else - ac_n=-n ac_c= ac_t= - fi -else - ac_n= ac_c='\c' ac_t= -fi - - - - - - - -# Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:549: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="gcc" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:579: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_prog_rejected=no - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - break - fi - done - IFS="$ac_save_ifs" -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# -gt 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - set dummy "$ac_dir/$ac_word" "$@" - shift - ac_cv_prog_CC="$@" - fi -fi -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - if test -z "$CC"; then - case "`uname -s`" in - *win32* | *WIN32*) - # Extract the first word of "cl", so it can be a program name with args. -set dummy cl; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:630: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="cl" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - ;; - esac - fi - test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } -fi - -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:662: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -cat > conftest.$ac_ext << EOF - -#line 673 "configure" -#include "confdefs.h" - -main(){return(0);} -EOF -if { (eval echo configure:678: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - ac_cv_prog_cc_works=yes - # If we can't run a trivial program, we are probably using a cross compiler. - if (./conftest; exit) 2>/dev/null; then - ac_cv_prog_cc_cross=no - else - ac_cv_prog_cc_cross=yes - fi -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_prog_cc_works=no -fi -rm -fr conftest* -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 -if test $ac_cv_prog_cc_works = no; then - { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } -fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:704: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 -echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 -cross_compiling=$ac_cv_prog_cc_cross - -echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:709: checking whether we are using GNU C" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gcc=yes -else - ac_cv_prog_gcc=no -fi -fi - -echo "$ac_t""$ac_cv_prog_gcc" 1>&6 - -if test $ac_cv_prog_gcc = yes; then - GCC=yes -else - GCC= -fi - -ac_test_CFLAGS="${CFLAGS+set}" -ac_save_CFLAGS="$CFLAGS" -CFLAGS= -echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:737: checking whether ${CC-cc} accepts -g" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - echo 'void f(){}' > conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then - ac_cv_prog_cc_g=yes -else - ac_cv_prog_cc_g=no -fi -rm -f conftest* - -fi - -echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 -if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi - -echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:769: checking how to run the C preprocessor" >&5 -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then -if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - # This must be in double quotes, not single quotes, because CPP may get - # substituted into the Makefile and "${CC-cc}" will confuse make. - CPP="${CC-cc} -E" - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:790: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -E -traditional-cpp" - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:807: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -nologo -E" - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:824: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP=/lib/cpp -fi -rm -f conftest* -fi -rm -f conftest* -fi -rm -f conftest* - ac_cv_prog_CPP="$CPP" -fi - CPP="$ac_cv_prog_CPP" -else - ac_cv_prog_CPP="$CPP" -fi -echo "$ac_t""$CPP" 1>&6 - -ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f $ac_dir/install.sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } -fi -ac_config_guess=$ac_aux_dir/config.guess -ac_config_sub=$ac_aux_dir/config.sub -ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# ./install, which can be erroneously created by make from ./install.sh. -echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:879: checking for a BSD compatible install" >&5 -if test -z "$INSTALL"; then -if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" - for ac_dir in $PATH; do - # Account for people who put trailing slashes in PATH elements. - case "$ac_dir/" in - /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - if test -f $ac_dir/$ac_prog; then - if test $ac_prog = install && - grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - else - ac_cv_path_install="$ac_dir/$ac_prog -c" - break 2 - fi - fi - done - ;; - esac - done - IFS="$ac_save_IFS" - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL="$ac_cv_path_install" - else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the path is relative. - INSTALL="$ac_install_sh" - fi -fi -echo "$ac_t""$INSTALL" 1>&6 - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - - -echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:933: checking for ANSI C header files" >&5 -if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#include -#include -#include -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:946: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - ac_cv_header_stdc=yes -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. -cat > conftest.$ac_ext < -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "memchr" >/dev/null 2>&1; then - : -else - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. -cat > conftest.$ac_ext < -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "free" >/dev/null 2>&1; then - : -else - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. -if test "$cross_compiling" = yes; then - : -else - cat > conftest.$ac_ext < -#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int main () { int i; for (i = 0; i < 256; i++) -if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); -exit (0); } - -EOF -if { (eval echo configure:1013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - : -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_header_stdc=no -fi -rm -fr conftest* -fi - -fi -fi - -echo "$ac_t""$ac_cv_header_stdc" 1>&6 -if test $ac_cv_header_stdc = yes; then - cat >> confdefs.h <<\EOF -#define STDC_HEADERS 1 -EOF - -fi - - -echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1038: checking for working const" >&5 -if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <j = 5; -} -{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; -} - -; return 0; } -EOF -if { (eval echo configure:1092: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_c_const=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_c_const=no -fi -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_c_const" 1>&6 -if test $ac_cv_c_const = no; then - cat >> confdefs.h <<\EOF -#define const -EOF - -fi - -echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:1113: checking for inline" >&5 -if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_cv_c_inline=no -for ac_kw in inline __inline__ __inline; do - cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_c_inline=$ac_kw; break -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 -fi -rm -f conftest* -done - -fi - -echo "$ac_t""$ac_cv_c_inline" 1>&6 -case "$ac_cv_c_inline" in - inline | yes) ;; - no) cat >> confdefs.h <<\EOF -#define inline -EOF - ;; - *) cat >> confdefs.h <&6 -echo "configure:1205: checking for jack/jack.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1215: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - build_jack="y" -else - echo "$ac_t""no" 1>&6 -build_jack="n" ; jack_message="No jack/jack.h found" -fi - -fi -if test "$build_jack" = "y"; then - echo $ac_n "checking for jack_client_new in -ljack""... $ac_c" 1>&6 -echo "configure:1240: checking for jack_client_new in -ljack" >&5 -ac_lib_var=`echo jack'_'jack_client_new | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-ljack $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - build_jack="y" -else - echo "$ac_t""no" 1>&6 -build_jack="n" ; jack_message="No libjack found" -fi - -fi -if test "$build_jack" = "y" ; then - PLUGINLIST="JackPlugin $PLUGINLIST" -fi - -ladspa_message="" -# Check whether --enable-ladspa or --disable-ladspa was given. -if test "${enable_ladspa+set}" = set; then - enableval="$enable_ladspa" - build_ladspa="n" ; ladspa_message="manually disabled" -else - build_ladspa="y" - -fi - -if test "$build_ladspa" = "y"; then - ac_safe=`echo "ladspa.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for ladspa.h""... $ac_c" 1>&6 -echo "configure:1298: checking for ladspa.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1308: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - build_ladspa="y" -else - echo "$ac_t""no" 1>&6 -build_ladspa="n" ; ladspa_message="No ladspa.h found" -fi - -fi -if test "$build_ladspa" = "y" ; then - PLUGINLIST="LADSPAPlugin $PLUGINLIST" -fi - -echo "$PLUGINLIST" > SpiralSound/PluginList.txt - -lrdf_message="" -# Check whether --enable-lrdf or --disable-lrdf was given. -if test "${enable_lrdf+set}" = set; then - enableval="$enable_lrdf" - use_liblrdf="n" ; lrdf_message="manually disabled" -else - use_liblrdf="y" - -fi - -if test "$build_ladspa" = "n" ; then - use_liblrdf="n" - lrdf_message="LADSPAPlugin not used" -fi -if test "$use_liblrdf" = "y"; then - ac_safe=`echo "lrdf.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for lrdf.h""... $ac_c" 1>&6 -echo "configure:1354: checking for lrdf.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1364: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - use_liblrdf="y" -else - echo "$ac_t""no" 1>&6 -use_liblrdf="n" ; lrdf_message="No lrdf.h found" -fi - -fi -if test "$use_liblrdf" = "y"; then - echo $ac_n "checking for lrdf_init in -llrdf""... $ac_c" 1>&6 -echo "configure:1389: checking for lrdf_init in -llrdf" >&5 -ac_lib_var=`echo lrdf'_'lrdf_init | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-llrdf $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - use_liblrdf="y" -else - echo "$ac_t""no" 1>&6 -use_liblrdf="n" ; lrdf_message="No liblrdf found" -fi - -fi -if test "$use_liblrdf" = "y"; then - cat >> confdefs.h <<\EOF -#define HAVE_LIBLRDF -EOF - - LRDFLIBS="-llrdf" - -fi - -amidi_message="" -# Check whether --enable-alsa_midi or --disable-alsa_midi was given. -if test "${enable_alsa_midi+set}" = set; then - enableval="$enable_alsa_midi" - use_alsa_midi="n"; amidi_message="manually disabled" -else - use_alsa_midi="y" - -fi - -if test "$use_alsa_midi" = "y"; then - ac_safe=`echo "alsa/asoundlib.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for alsa/asoundlib.h""... $ac_c" 1>&6 -echo "configure:1452: checking for alsa/asoundlib.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1462: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - use_alsa_midi="y" -else - echo "$ac_t""no" 1>&6 -use_alsa_midi="n" ; amidi_message="No alsa/asoundlib.h found" -fi - -fi -if test "$use_alsa_midi" = "y"; then - echo $ac_n "checking for snd_seq_open in -lasound""... $ac_c" 1>&6 -echo "configure:1487: checking for snd_seq_open in -lasound" >&5 -ac_lib_var=`echo asound'_'snd_seq_open | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lasound $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - use_alsa_midi="y" -else - echo "$ac_t""no" 1>&6 -use_alsa_midi="n" ; amidi_message="No libasound found" -fi - -fi -if test "$use_alsa_midi" = "y"; then - cat >> confdefs.h <<\EOF -#define USE_ALSA_MIDI -EOF - - AMIDILIBS="-lasound" - -else - cat >> confdefs.h <<\EOF -#define USE_OSS_MIDI -EOF - -fi - -sndfile_message="" -# Check whether --enable-sndfile or --disable-sndfile was given. -if test "${enable_sndfile+set}" = set; then - enableval="$enable_sndfile" - use_sndfile="n" ; sndfile_message="manually disabled" -else - use_sndfile="y" - -fi - -if test "$use_sndfile" = "y"; then - ac_safe=`echo "sndfile.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for sndfile.h""... $ac_c" 1>&6 -echo "configure:1555: checking for sndfile.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1565: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - use_sndfile="y" -else - echo "$ac_t""no" 1>&6 -use_sndfile="n" ; sndfile_message="No sndfile.h found" -fi - -fi -if test "$use_sndfile" = "y"; then - echo $ac_n "checking for sf_open in -lsndfile""... $ac_c" 1>&6 -echo "configure:1590: checking for sf_open in -lsndfile" >&5 -ac_lib_var=`echo sndfile'_'sf_open | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lsndfile $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - use_sndfile="y" -else - echo "$ac_t""no" 1>&6 -use_sndfile="n" ; sndfile_message="No libsndfile found" -fi - -fi -if test "$use_sndfile" = "y"; then - cat >> confdefs.h <<\EOF -#define USE_LIBSNDFILE -EOF - - SFLIBS="-lsndfile" - -fi - - -for ac_hdr in math.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1645: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1655: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <&6 -fi -done - -echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6 -echo "configure:1682: checking for sin in -lm" >&5 -ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lm $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - cat >> confdefs.h <&6 -fi - - - -# Extract the first word of "fltk-config", so it can be a program name with args. -set dummy fltk-config; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1733: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_FLTK_CONFIG'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - case "$FLTK_CONFIG" in - /*) - ac_cv_path_FLTK_CONFIG="$FLTK_CONFIG" # Let the user override the test with a path. - ;; - ?:/*) - ac_cv_path_FLTK_CONFIG="$FLTK_CONFIG" # Let the user override the test with a dos path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_FLTK_CONFIG="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_FLTK_CONFIG" && ac_cv_path_FLTK_CONFIG="no" - ;; -esac -fi -FLTK_CONFIG="$ac_cv_path_FLTK_CONFIG" -if test -n "$FLTK_CONFIG"; then - echo "$ac_t""$FLTK_CONFIG" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -if test "$FLTK_CONFIG" = "no"; then - # If we find X, set shell vars x_includes and x_libraries to the -# paths, otherwise set no_x=yes. -# Uses ac_ vars as temps to allow command line to override cache and checks. -# --without-x overrides everything else, but does not touch the cache. -echo $ac_n "checking for X""... $ac_c" 1>&6 -echo "configure:1772: checking for X" >&5 - -# Check whether --with-x or --without-x was given. -if test "${with_x+set}" = set; then - withval="$with_x" - : -fi - -# $have_x is `yes', `no', `disabled', or empty when we do not yet know. -if test "x$with_x" = xno; then - # The user explicitly disabled X. - have_x=disabled -else - if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then - # Both variables are already set. - have_x=yes - else -if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - # One or both of the vars are not set, and there is no cached value. -ac_x_includes=NO ac_x_libraries=NO -rm -fr conftestdir -if mkdir conftestdir; then - cd conftestdir - # Make sure to not put "make" in the Imakefile rules, since we grep it out. - cat > Imakefile <<'EOF' -acfindx: - @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"' -EOF - if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then - # GNU make sometimes prints "make[1]: Entering...", which would confuse us. - eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` - # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. - for ac_extension in a so sl; do - if test ! -f $ac_im_usrlibdir/libX11.$ac_extension && - test -f $ac_im_libdir/libX11.$ac_extension; then - ac_im_usrlibdir=$ac_im_libdir; break - fi - done - # Screen out bogus values from the imake configuration. They are - # bogus both because they are the default anyway, and because - # using them would break gcc on systems where it needs fixed includes. - case "$ac_im_incroot" in - /usr/include) ;; - *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;; - esac - case "$ac_im_usrlibdir" in - /usr/lib | /lib) ;; - *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;; - esac - fi - cd .. - rm -fr conftestdir -fi - -if test "$ac_x_includes" = NO; then - # Guess where to find include files, by looking for this one X11 .h file. - test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h - - # First, try using that file with no special directory specified. -cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1839: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - # We can compile using X headers with no special include directory. -ac_x_includes= -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - # Look for the header file in a standard set of common directories. -# Check X11 before X11Rn because it is often a symlink to the current release. - for ac_dir in \ - /usr/X11/include \ - /usr/X11R6/include \ - /usr/X11R5/include \ - /usr/X11R4/include \ - \ - /usr/include/X11 \ - /usr/include/X11R6 \ - /usr/include/X11R5 \ - /usr/include/X11R4 \ - \ - /usr/local/X11/include \ - /usr/local/X11R6/include \ - /usr/local/X11R5/include \ - /usr/local/X11R4/include \ - \ - /usr/local/include/X11 \ - /usr/local/include/X11R6 \ - /usr/local/include/X11R5 \ - /usr/local/include/X11R4 \ - \ - /usr/X386/include \ - /usr/x386/include \ - /usr/XFree86/include/X11 \ - \ - /usr/include \ - /usr/local/include \ - /usr/unsupported/include \ - /usr/athena/include \ - /usr/local/x11r5/include \ - /usr/lpp/Xamples/include \ - \ - /usr/openwin/include \ - /usr/openwin/share/include \ - ; \ - do - if test -r "$ac_dir/$x_direct_test_include"; then - ac_x_includes=$ac_dir - break - fi - done -fi -rm -f conftest* -fi # $ac_x_includes = NO - -if test "$ac_x_libraries" = NO; then - # Check for the libraries. - - test -z "$x_direct_test_library" && x_direct_test_library=Xt - test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc - - # See if we find them without any special options. - # Don't add to $LIBS permanently. - ac_save_LIBS="$LIBS" - LIBS="-l$x_direct_test_library $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - LIBS="$ac_save_LIBS" -# We can link X programs with no special library path. -ac_x_libraries= -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - LIBS="$ac_save_LIBS" -# First see if replacing the include by lib works. -# Check X11 before X11Rn because it is often a symlink to the current release. -for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \ - /usr/X11/lib \ - /usr/X11R6/lib \ - /usr/X11R5/lib \ - /usr/X11R4/lib \ - \ - /usr/lib/X11 \ - /usr/lib/X11R6 \ - /usr/lib/X11R5 \ - /usr/lib/X11R4 \ - \ - /usr/local/X11/lib \ - /usr/local/X11R6/lib \ - /usr/local/X11R5/lib \ - /usr/local/X11R4/lib \ - \ - /usr/local/lib/X11 \ - /usr/local/lib/X11R6 \ - /usr/local/lib/X11R5 \ - /usr/local/lib/X11R4 \ - \ - /usr/X386/lib \ - /usr/x386/lib \ - /usr/XFree86/lib/X11 \ - \ - /usr/lib \ - /usr/local/lib \ - /usr/unsupported/lib \ - /usr/athena/lib \ - /usr/local/x11r5/lib \ - /usr/lpp/Xamples/lib \ - /lib/usr/lib/X11 \ - \ - /usr/openwin/lib \ - /usr/openwin/share/lib \ - ; \ -do - for ac_extension in a so sl; do - if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then - ac_x_libraries=$ac_dir - break 2 - fi - done -done -fi -rm -f conftest* -fi # $ac_x_libraries = NO - -if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then - # Didn't find X anywhere. Cache the known absence of X. - ac_cv_have_x="have_x=no" -else - # Record where we found X for the cache. - ac_cv_have_x="have_x=yes \ - ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" -fi -fi - fi - eval "$ac_cv_have_x" -fi # $with_x != no - -if test "$have_x" != yes; then - echo "$ac_t""$have_x" 1>&6 - no_x=yes -else - # If each of the values was on the command line, it overrides each guess. - test "x$x_includes" = xNONE && x_includes=$ac_x_includes - test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries - # Update the cache value to reflect the command line values. - ac_cv_have_x="have_x=yes \ - ac_x_includes=$x_includes ac_x_libraries=$x_libraries" - echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6 -fi - -if test "$no_x" = yes; then - # Not all programs may use this symbol, but it does not hurt to define it. - cat >> confdefs.h <<\EOF -#define X_DISPLAY_MISSING 1 -EOF - - X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= -else - if test -n "$x_includes"; then - X_CFLAGS="$X_CFLAGS -I$x_includes" - fi - - # It would also be nice to do this for all -L options, not just this one. - if test -n "$x_libraries"; then - X_LIBS="$X_LIBS -L$x_libraries" - # For Solaris; some versions of Sun CC require a space after -R and - # others require no space. Words are not sufficient . . . . - case "`(uname -sr) 2>/dev/null`" in - "SunOS 5"*) - echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6 -echo "configure:2021: checking whether -R must be followed by a space" >&5 - ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_R_nospace=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_R_nospace=no -fi -rm -f conftest* - if test $ac_R_nospace = yes; then - echo "$ac_t""no" 1>&6 - X_LIBS="$X_LIBS -R$x_libraries" - else - LIBS="$ac_xsave_LIBS -R $x_libraries" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_R_space=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_R_space=no -fi -rm -f conftest* - if test $ac_R_space = yes; then - echo "$ac_t""yes" 1>&6 - X_LIBS="$X_LIBS -R $x_libraries" - else - echo "$ac_t""neither works" 1>&6 - fi - fi - LIBS="$ac_xsave_LIBS" - esac - fi - - # Check for system-dependent libraries X programs must link with. - # Do this before checking for the system-independent R6 libraries - # (-lICE), since we may need -lsocket or whatever for X linking. - - if test "$ISC" = yes; then - X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" - else - # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X - # libraries were built with DECnet support. And karl@cs.umb.edu says - # the Alpha needs dnet_stub (dnet does not exist). - echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6 -echo "configure:2086: checking for dnet_ntoa in -ldnet" >&5 -ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-ldnet $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" -else - echo "$ac_t""no" 1>&6 -fi - - if test $ac_cv_lib_dnet_dnet_ntoa = no; then - echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6 -echo "configure:2127: checking for dnet_ntoa in -ldnet_stub" >&5 -ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-ldnet_stub $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" -else - echo "$ac_t""no" 1>&6 -fi - - fi - - # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, - # to get the SysV transport functions. - # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4) - # needs -lnsl. - # The nsl library prevents programs from opening the X display - # on Irix 5.2, according to dickey@clark.net. - echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure:2175: checking for gethostbyname" >&5 -if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char gethostbyname(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname) -choke me -#else -gethostbyname(); -#endif - -; return 0; } -EOF -if { (eval echo configure:2203: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_gethostbyname=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_gethostbyname=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 -fi - - if test $ac_cv_func_gethostbyname = no; then - echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:2224: checking for gethostbyname in -lnsl" >&5 -ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lnsl $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" -else - echo "$ac_t""no" 1>&6 -fi - - fi - - # lieder@skyler.mavd.honeywell.com says without -lsocket, - # socket/setsockopt and other routines are undefined under SCO ODT - # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary - # on later versions), says simon@lia.di.epfl.ch: it contains - # gethostby* variants that don't use the nameserver (or something). - # -lsocket must be given before -lnsl if both are needed. - # We assume that if connect needs -lnsl, so does gethostbyname. - echo $ac_n "checking for connect""... $ac_c" 1>&6 -echo "configure:2273: checking for connect" >&5 -if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char connect(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_connect) || defined (__stub___connect) -choke me -#else -connect(); -#endif - -; return 0; } -EOF -if { (eval echo configure:2301: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_connect=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_connect=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 -fi - - if test $ac_cv_func_connect = no; then - echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6 -echo "configure:2322: checking for connect in -lsocket" >&5 -ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lsocket $X_EXTRA_LIBS $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" -else - echo "$ac_t""no" 1>&6 -fi - - fi - - # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX. - echo $ac_n "checking for remove""... $ac_c" 1>&6 -echo "configure:2365: checking for remove" >&5 -if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char remove(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_remove) || defined (__stub___remove) -choke me -#else -remove(); -#endif - -; return 0; } -EOF -if { (eval echo configure:2393: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_remove=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_remove=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 -fi - - if test $ac_cv_func_remove = no; then - echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 -echo "configure:2414: checking for remove in -lposix" >&5 -ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lposix $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" -else - echo "$ac_t""no" 1>&6 -fi - - fi - - # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. - echo $ac_n "checking for shmat""... $ac_c" 1>&6 -echo "configure:2457: checking for shmat" >&5 -if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char shmat(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_shmat) || defined (__stub___shmat) -choke me -#else -shmat(); -#endif - -; return 0; } -EOF -if { (eval echo configure:2485: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_shmat=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_shmat=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 -fi - - if test $ac_cv_func_shmat = no; then - echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 -echo "configure:2506: checking for shmat in -lipc" >&5 -ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lipc $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" -else - echo "$ac_t""no" 1>&6 -fi - - fi - fi - - # Check for libraries that X11R6 Xt/Xaw programs need. - ac_save_LDFLAGS="$LDFLAGS" - test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" - # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to - # check for ICE first), but we must link in the order -lSM -lICE or - # we get undefined symbols. So assume we have SM if we have ICE. - # These have to be linked with before -lX11, unlike the other - # libraries we check for below, so use a different variable. - # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. - echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6 -echo "configure:2558: checking for IceConnectionNumber in -lICE" >&5 -ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lICE $X_EXTRA_LIBS $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" -else - echo "$ac_t""no" 1>&6 -fi - - LDFLAGS="$ac_save_LDFLAGS" - -fi - - LIBGL="" - CPPFLAGS="$CPPFLAGS $X_CFLAGS" - for ac_hdr in GL/gl.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2607: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2617: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <&6 -fi -done - - if test $ac_cv_header_GL_gl_h = "yes" ; then - echo $ac_n "checking for glBegin in -lGL""... $ac_c" 1>&6 -echo "configure:2645: checking for glBegin in -lGL" >&5 -ac_lib_var=`echo GL'_'glBegin | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lGL $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - LIBGL="-lGL" -else - echo "$ac_t""no" 1>&6 -fi - - fi - for ac_hdr in FL/Fl.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2689: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2699: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <&6 -fi -done - - if test $ac_cv_header_FL_Fl_h = "no" ; then - echo "*** FLTK headers missing." - exit 1 - fi - echo $ac_n "checking for main in -lfltk""... $ac_c" 1>&6 -echo "configure:2730: checking for main in -lfltk" >&5 -ac_lib_var=`echo fltk'_'main | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lfltk $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo fltk | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - cat >> confdefs.h <&6 -fi - - FLTK_CXXFLAGS="$X_CFLAGS" - FLTK_CFLAGS="$FLTK_CXXFLAGS" - FLTK_LIBS="$X_LIBS -lfltk $LIBGL" -else - FLTK_CXXFLAGS=`$FLTK_CONFIG $fltk_config_args --cxxflags` - FLTK_CFLAGS=`$FLTK_CONFIG $fltk_config_args --cxxflags` - FLTK_LIBS=`$FLTK_CONFIG $fltk_config_args --ldflags` -fi - - - - -for ac_hdr in dlfcn.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2788: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2798: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <&6 -fi -done - -echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:2825: checking for dlopen in -ldl" >&5 -ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-ldl $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - cat >> confdefs.h <&6 -fi - - - - -CFLAGS="$CFLAGS -fPIC" -CXXFLAGS="$CFLAGS -fPIC" - - - - - -trap '' 1 2 15 -cat > confcache <<\EOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. -# -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. -# -EOF -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -(set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote substitution - # turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else - if test -w $cache_file; then - echo "updating cache $cache_file" - cat confcache > $cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# Any assignment to VPATH causes Sun make to only execute -# the first set of double-colon rules, so remove it if not needed. -# If there is a colon in the path, we need to keep it. -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' -fi - -trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 - -DEFS=-DHAVE_CONFIG_H - -# Without the "./", some shells look in PATH for config.status. -: ${CONFIG_STATUS=./config.status} - -echo creating $CONFIG_STATUS -rm -f $CONFIG_STATUS -cat > $CONFIG_STATUS </dev/null | sed 1q`: -# -# $0 $ac_configure_args -# -# Compiler output produced by configure, useful for debugging -# configure, is in ./config.log if it exists. - -ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" -for ac_option -do - case "\$ac_option" in - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" - exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; - -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.13" - exit 0 ;; - -help | --help | --hel | --he | --h) - echo "\$ac_cs_usage"; exit 0 ;; - *) echo "\$ac_cs_usage"; exit 1 ;; - esac -done - -ac_given_srcdir=$srcdir -ac_given_INSTALL="$INSTALL" - -trap 'rm -fr `echo "SpiralSound/Plugins/AmpPlugin/Makefile -SpiralSound/Plugins/AnotherFilterPlugin/Makefile -SpiralSound/Plugins/BeatMatchPlugin/Makefile -SpiralSound/Plugins/ControllerPlugin/Makefile -SpiralSound/Plugins/CounterPlugin/Makefile -SpiralSound/Plugins/DelayPlugin/Makefile -SpiralSound/Plugins/DiskWriterPlugin/Makefile -SpiralSound/Plugins/DistributorPlugin/Makefile -SpiralSound/Plugins/EchoPlugin/Makefile -SpiralSound/Plugins/EnvFollowerPlugin/Makefile -SpiralSound/Plugins/EnvelopePlugin/Makefile -SpiralSound/Plugins/FilterPlugin/Makefile -SpiralSound/Plugins/FlipflopPlugin/Makefile -SpiralSound/Plugins/FormantFilterPlugin/Makefile -SpiralSound/Plugins/JackPlugin/Makefile -SpiralSound/Plugins/KeyboardPlugin/Makefile -SpiralSound/Plugins/LADSPAPlugin/Makefile -SpiralSound/Plugins/LFOPlugin/Makefile -SpiralSound/Plugins/LogicPlugin/Makefile -SpiralSound/Plugins/MasherPlugin/Makefile -SpiralSound/Plugins/MatrixPlugin/Makefile -SpiralSound/Plugins/MeterPlugin/Makefile -SpiralSound/Plugins/MidiPlugin/Makefile -SpiralSound/Plugins/MixSwitchPlugin/Makefile -SpiralSound/Plugins/MixerPlugin/Makefile -SpiralSound/Plugins/MoogFilterPlugin/Makefile -SpiralSound/Plugins/NoisePlugin/Makefile -SpiralSound/Plugins/NoteSnapPlugin/Makefile -SpiralSound/Plugins/OperatorPlugin/Makefile -SpiralSound/Plugins/OscillatorPlugin/Makefile -SpiralSound/Plugins/OutputPlugin/Makefile -SpiralSound/Plugins/PoshSamplerPlugin/Makefile -SpiralSound/Plugins/RingModPlugin/Makefile -SpiralSound/Plugins/SVFilterPlugin/Makefile -SpiralSound/Plugins/SampleHoldPlugin/Makefile -SpiralSound/Plugins/ScopePlugin/Makefile -SpiralSound/Plugins/SeqSelectorPlugin/Makefile -SpiralSound/Plugins/SmoothPlugin/Makefile -SpiralSound/Plugins/SpiralLoopPlugin/Makefile -SpiralSound/Plugins/SplitSwitchPlugin/Makefile -SpiralSound/Plugins/SplitterPlugin/Makefile -SpiralSound/Plugins/StereoMixerPlugin/Makefile -SpiralSound/Plugins/StreamPlugin/Makefile -SpiralSound/Plugins/SwitchPlugin/Makefile -SpiralSound/Plugins/TransposePlugin/Makefile -SpiralSound/Plugins/TrigPlugin/Makefile -SpiralSound/Plugins/WaveShaperPlugin/Makefile -SpiralSound/Plugins/WaveTablePlugin/Makefile -SpiralSound/Plugins/XFadePlugin/Makefile -SpiralSynthPluginLocation.h -Makefile - config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 -EOF -cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF -$ac_vpsub -$extrasub -s%@SHELL@%$SHELL%g -s%@CFLAGS@%$CFLAGS%g -s%@CPPFLAGS@%$CPPFLAGS%g -s%@CXXFLAGS@%$CXXFLAGS%g -s%@FFLAGS@%$FFLAGS%g -s%@DEFS@%$DEFS%g -s%@LDFLAGS@%$LDFLAGS%g -s%@LIBS@%$LIBS%g -s%@exec_prefix@%$exec_prefix%g -s%@prefix@%$prefix%g -s%@program_transform_name@%$program_transform_name%g -s%@bindir@%$bindir%g -s%@sbindir@%$sbindir%g -s%@libexecdir@%$libexecdir%g -s%@datadir@%$datadir%g -s%@sysconfdir@%$sysconfdir%g -s%@sharedstatedir@%$sharedstatedir%g -s%@localstatedir@%$localstatedir%g -s%@libdir@%$libdir%g -s%@includedir@%$includedir%g -s%@oldincludedir@%$oldincludedir%g -s%@infodir@%$infodir%g -s%@mandir@%$mandir%g -s%@CC@%$CC%g -s%@CPP@%$CPP%g -s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g -s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g -s%@INSTALL_DATA@%$INSTALL_DATA%g -s%@PLUGINDIR@%$PLUGINDIR%g -s%@LRDFLIBS@%$LRDFLIBS%g -s%@AMIDILIBS@%$AMIDILIBS%g -s%@SFLIBS@%$SFLIBS%g -s%@FLTK_CONFIG@%$FLTK_CONFIG%g -s%@X_CFLAGS@%$X_CFLAGS%g -s%@X_PRE_LIBS@%$X_PRE_LIBS%g -s%@X_LIBS@%$X_LIBS%g -s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g -s%@FLTK_CXXFLAGS@%$FLTK_CXXFLAGS%g -s%@FLTK_CFLAGS@%$FLTK_CFLAGS%g -s%@FLTK_LIBS@%$FLTK_LIBS%g -s%@PLUGINLIST@%$PLUGINLIST%g - -CEOF -EOF - -cat >> $CONFIG_STATUS <<\EOF - -# Split the substitutions into bite-sized pieces for seds with -# small command number limits, like on Digital OSF/1 and HP-UX. -ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. -ac_file=1 # Number of current file. -ac_beg=1 # First line for current file. -ac_end=$ac_max_sed_cmds # Line after last line for current file. -ac_more_lines=: -ac_sed_cmds="" -while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file - else - sed "${ac_end}q" conftest.subs > conftest.s$ac_file - fi - if test ! -s conftest.s$ac_file; then - ac_more_lines=false - rm -f conftest.s$ac_file - else - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f conftest.s$ac_file" - else - ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" - fi - ac_file=`expr $ac_file + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_cmds` - fi -done -if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat -fi -EOF - -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; - esac - - # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. - - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" - # A "../" for each directory in $ac_dir_suffix. - ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` - else - ac_dir_suffix= ac_dots= - fi - - case "$ac_given_srcdir" in - .) srcdir=. - if test -z "$ac_dots"; then top_srcdir=. - else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; - /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; - *) # Relative path. - srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" - top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac - - case "$ac_given_INSTALL" in - [/$]*) INSTALL="$ac_given_INSTALL" ;; - *) INSTALL="$ac_dots$ac_given_INSTALL" ;; - esac - - echo creating "$ac_file" - rm -f "$ac_file" - configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." - case "$ac_file" in - *Makefile*) ac_comsub="1i\\ -# $configure_input" ;; - *) ac_comsub= ;; - esac - - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - sed -e "$ac_comsub -s%@configure_input@%$configure_input%g -s%@srcdir@%$srcdir%g -s%@top_srcdir@%$top_srcdir%g -s%@INSTALL@%$INSTALL%g -" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file -fi; done -rm -f conftest.s* - -# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where -# NAME is the cpp macro being defined and VALUE is the value it is being given. -# -# ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' -ac_dC='\3' -ac_dD='%g' -# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". -ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='\([ ]\)%\1#\2define\3' -ac_uC=' ' -ac_uD='\4%g' -# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_eB='$%\1#\2define\3' -ac_eC=' ' -ac_eD='%g' - -if test "${CONFIG_HEADERS+set}" != set; then -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -fi -for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; - esac - - echo creating $ac_file - - rm -f conftest.frag conftest.in conftest.out - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - cat $ac_file_inputs > conftest.in - -EOF - -# Transform confdefs.h into a sed script conftest.vals that substitutes -# the proper values into config.h.in to produce config.h. And first: -# Protect against being on the right side of a sed subst in config.status. -# Protect against being in an unquoted here document in config.status. -rm -f conftest.vals -cat > conftest.hdr <<\EOF -s/[\\&%]/\\&/g -s%[\\$`]%\\&%g -s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp -s%ac_d%ac_u%gp -s%ac_u%ac_e%gp -EOF -sed -n -f conftest.hdr confdefs.h > conftest.vals -rm -f conftest.hdr - -# This sed command replaces #undef with comments. This is necessary, for -# example, in the case of _POSIX_SOURCE, which is predefined and required -# on some systems where configure will not decide to define it. -cat >> conftest.vals <<\EOF -s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% -EOF - -# Break up conftest.vals because some shells have a limit on -# the size of here documents, and old seds have small limits too. - -rm -f conftest.tail -while : -do - ac_lines=`grep -c . conftest.vals` - # grep -c gives empty output for an empty file on some AIX systems. - if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi - # Write a limited-size here document to conftest.frag. - echo ' cat > conftest.frag <> $CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS - echo 'CEOF - sed -f conftest.frag conftest.in > conftest.out - rm -f conftest.in - mv conftest.out conftest.in -' >> $CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail - rm -f conftest.vals - mv conftest.tail conftest.vals -done -rm -f conftest.vals - -cat >> $CONFIG_STATUS <<\EOF - rm -f conftest.frag conftest.h - echo "/* $ac_file. Generated automatically by configure. */" > conftest.h - cat conftest.in >> conftest.h - rm -f conftest.in - if cmp -s $ac_file conftest.h 2>/dev/null; then - echo "$ac_file is unchanged" - rm -f conftest.h - else - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - fi - rm -f $ac_file - mv conftest.h $ac_file - fi -fi; done - -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h - -exit 0 -EOF -chmod +x $CONFIG_STATUS -rm -fr confdefs* $ac_clean_files -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 - - -echo -e "\nConfig options:" -echo -n "libsndfile support for wave loading - " -if test "$use_sndfile" = "y"; then - echo "Enabled" -else - echo "Disabled - $sndfile_message" -fi -echo -n " ALSA support for MidiPlugin - " -if test "$use_alsa_midi" = "y"; then - echo "Enabled" -else - echo "Disabled - $amidi_message - Using OSS instead" -fi -echo -n " Jack support (via JackPlugin) - " -if test "$build_jack" = "y"; then - echo "Enabled" -else - echo "Disabled - $jack_message" -fi -echo -n " LADSPA support (via LADSPAPlugin) - " -if test "$build_ladspa" = "y"; then - echo "Enabled" -else - echo "Disabled - $ladspa_message" -fi -echo -n " liblrdf support for LADSPAPlugin - " -if test "$use_liblrdf" = "y"; then - echo "Enabled" -else - echo "Disabled - $lrdf_message" -fi -echo "" diff -Nru spiralsynthmodular-0.2.2a/configure.in spiralsynthmodular-0.2.3+git20140329/configure.in --- spiralsynthmodular-0.2.2a/configure.in 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/configure.in 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,301 @@ +dnl Process this file with autoconf to produce a configure script. +AC_INIT(SpiralSynthModular.C) + +dnl Automake (can't use AC_CONFIG_HEADER - get complaints!) +AM_CONFIG_HEADER(config.h) + +dnl Checks for programs. +AC_PROG_CC +AC_PROG_CPP +AC_PROG_INSTALL + +dnl Checks for header files. +AC_HEADER_STDC + +dnl Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_C_INLINE + +dnl Check plugin directory +AC_ARG_WITH(plugindir, + [ --with-plugindir=dir give the plugin directory], + plugindir="$withval", + plugindir="/usr/lib/SpiralPlugins") +AC_SUBST(PLUGINDIR, $plugindir) + +dnl Check whether to enable debugging +AC_ARG_ENABLE(debug, [ --enable-debug enable debugging ], + ac_arg_debug="Y", ac_arg_debug="N") + +if test $ac_arg_debug = "Y" ; then + CFLAGS="-pipe -Wall -O0 -ggdb " + CXXFLAGS="-pipe -Wall -O0 -ggdb " +else + CFLAGS="-pipe -Wall -O3 -ffast-math -DNO_DEBUG -Wno-unused " + CXXFLAGS="-pipe -Wall -O3 -ffast-math -DNO_DEBUG -Wno-unused " +fi + +dnl build plugin list - plugins that do not require an optional component +dnl (i.e. Jack, and LADSPA) + +PLUGINLIST="AmpPlugin AnotherFilterPlugin BeatMatchPlugin ControllerPlugin \ +CounterPlugin DelayPlugin DiskWriterPlugin DistributorPlugin EchoPlugin \ +EnvFollowerPlugin EnvelopePlugin FilterPlugin FlipflopPlugin FormantFilterPlugin \ +KeyboardPlugin LFOPlugin LogicPlugin MasherPlugin MatrixPlugin \ +MeterPlugin MidiPlugin MixSwitchPlugin MixerPlugin MoogFilterPlugin NoisePlugin \ +NoteSnapPlugin OperatorPlugin OscillatorPlugin OutputPlugin PoshSamplerPlugin \ +RingModPlugin SVFilterPlugin SampleHoldPlugin ScopePlugin SeqSelectorPlugin \ +SmoothPlugin SpiralLoopPlugin SplitSwitchPlugin SplitterPlugin StereoMixerPlugin \ +StreamPlugin SwitchPlugin TranslatePlugin TransposePlugin TrigPlugin WaveShaperPlugin \ +WaveTablePlugin XFadePlugin" + +dnl Check whether jack is present or has been disabled +jack_message="" +AC_ARG_ENABLE( + jack, + [ --disable-jack Do not build JackPlugin], + [build_jack="n" ; jack_message="manually disabled"], + [build_jack="y"] +) +if test "$build_jack" = "y"; then + AC_CHECK_HEADER(jack/jack.h, [build_jack="y"], [build_jack="n" ; jack_message="No jack/jack.h found"]) +fi +if test "$build_jack" = "y"; then + AC_CHECK_LIB(jack, jack_client_new, [build_jack="y"], [build_jack="n" ; jack_message="No libjack found"]) +fi +if test "$build_jack" = "y" ; then + PLUGINLIST="JackPlugin $PLUGINLIST" +fi + +dnl Check whether LADSPA is present or has been disabled +ladspa_message="" +AC_ARG_ENABLE( + ladspa, + [ --disable-ladspa Do not build LADSPAPlugin], + [build_ladspa="n" ; ladspa_message="manually disabled"], + [build_ladspa="y"] +) +if test "$build_ladspa" = "y"; then + AC_CHECK_HEADER(ladspa.h, [build_ladspa="y"], [build_ladspa="n" ; ladspa_message="No ladspa.h found"]) +fi +if test "$build_ladspa" = "y" ; then + PLUGINLIST="LADSPAPlugin $PLUGINLIST" +fi + +dnl build plugin list +echo "$PLUGINLIST" > SpiralSound/PluginList.txt + +dnl Check whether liblrdf is present or has been disabled +lrdf_message="" +AC_ARG_ENABLE( + lrdf, + [ --disable-lrdf Disable liblrdf for LADSPA Plugin], + [use_liblrdf="n" ; lrdf_message="manually disabled"], + [use_liblrdf="y"] +) +if test "$build_ladspa" = "n" ; then + use_liblrdf="n" + lrdf_message="LADSPAPlugin not used" +fi +if test "$use_liblrdf" = "y"; then + AC_CHECK_HEADER(lrdf.h, [use_liblrdf="y"], [use_liblrdf="n" ; lrdf_message="No lrdf.h found"]) +fi +if test "$use_liblrdf" = "y"; then + AC_CHECK_LIB(lrdf, lrdf_init, [use_liblrdf="y"], [use_liblrdf="n" ; lrdf_message="No liblrdf found"]) +fi +if test "$use_liblrdf" = "y"; then + AC_DEFINE(HAVE_LIBLRDF, , [Enable liblrdf support for LADSPA Plugin]) + LRDFLIBS="-llrdf" + AC_SUBST(LRDFLIBS) +fi + +dnl Check whether alsa-midi is present or has been disabled +amidi_message="" +AC_ARG_ENABLE( + alsa_midi, + [ --disable-alsa-midi Disable alsa midi (use OSS)], + [use_alsa_midi="n"; amidi_message="manually disabled"], + [use_alsa_midi="y"] +) +if test "$use_alsa_midi" = "y"; then + AC_CHECK_HEADER(alsa/asoundlib.h, [use_alsa_midi="y"], [use_alsa_midi="n" ; amidi_message="No alsa/asoundlib.h found"]) +fi +if test "$use_alsa_midi" = "y"; then + AC_CHECK_LIB(asound, snd_seq_open, [use_alsa_midi="y"], [use_alsa_midi="n" ; amidi_message="No libasound found"]) +fi +if test "$use_alsa_midi" = "y"; then + AC_DEFINE(USE_ALSA_MIDI, , [Use ALSA MIDI not OSS]) + AMIDILIBS="-lasound" + AC_SUBST(AMIDILIBS) +else + AC_DEFINE(USE_OSS_MIDI, , [Use OSS MIDI not ALSA]) +fi + +dnl Check whether libsndfile is present or has been disabled +sndfile_message="" +AC_ARG_ENABLE( + sndfile, + [ --disable-sndfile Disable libsndfile for waveform loading], + [use_sndfile="n" ; sndfile_message="manually disabled"], + [use_sndfile="y"] +) +if test "$use_sndfile" = "y"; then + AC_CHECK_HEADER(sndfile.h, [use_sndfile="y"], [use_sndfile="n" ; sndfile_message="No sndfile.h found"]) +fi +if test "$use_sndfile" = "y"; then + AC_CHECK_LIB(sndfile, sf_open, [use_sndfile="y"], [use_sndfile="n" ; sndfile_message="No libsndfile found"]) +fi +if test "$use_sndfile" = "y"; then + AC_DEFINE(USE_LIBSNDFILE, , [Enable libsndfile for waveform loading]) + SFLIBS="-lsndfile" + AC_SUBST(SFLIBS) +fi + +dnl Checks for library functions. + +AC_CHECK_HEADERS(math.h) +AC_CHECK_LIB(m, sin) + +dnl AC_CHECK_HEADERS(X11/Xlib.h) +dnl AC_CHECK_LIB(X11, XDisplayName) +dnl AC_CHECK_LIB(Xext, main) + +AC_PATH_PROG(FLTK_CONFIG, fltk-config, no) +if test "$FLTK_CONFIG" = "no"; then + AC_PATH_XTRA + LIBGL="" + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + AC_CHECK_HEADERS(GL/gl.h) + if test $ac_cv_header_GL_gl_h = "yes" ; then + AC_CHECK_LIB(GL, glBegin, LIBGL="-lGL") + fi + AC_CHECK_HEADERS(FL/Fl.h) + if test $ac_cv_header_FL_Fl_h = "no" ; then + echo "*** FLTK headers missing." + exit 1 + fi + AC_CHECK_LIB(fltk, main) + FLTK_CXXFLAGS="$X_CFLAGS" + FLTK_CFLAGS="$FLTK_CXXFLAGS" + FLTK_LIBS="$X_LIBS -lfltk $LIBGL" +else + FLTK_CXXFLAGS=`$FLTK_CONFIG $fltk_config_args --cxxflags` + FLTK_CFLAGS=`$FLTK_CONFIG $fltk_config_args --cxxflags` + FLTK_LIBS=`$FLTK_CONFIG $fltk_config_args --ldflags` +dnl This caused problems for debian users, +dnl It would be nice to find a more robust way of doing it. +dnl if test "${FLTK_LIBS/*-rpath*/yes}" != "yes"; then +dnl echo "*** FLTK needs to be configured with --enable-shared" +dnl exit 1 +dnl fi +fi +AC_SUBST(FLTK_CXXFLAGS) +AC_SUBST(FLTK_CFLAGS) +AC_SUBST(FLTK_LIBS) + +AC_CHECK_HEADERS(dlfcn.h) +AC_CHECK_LIB(dl, dlopen) + +dnl Do we need png????? +dnl AC_CHECK_HEADERS(png.h) +dnl AC_CHECK_LIB(png, png_get_copyright) + +dnl This is normally done with libtool but since we aren't using libtool +dnl yet to it here. + +dnl FIXME: forced to add -fPIC here.. +CFLAGS="$CFLAGS -fPIC" +CXXFLAGS="$CFLAGS -fPIC" + +AC_SUBST(CFLAGS) +AC_SUBST(CXXFLAGS) +AC_SUBST(PLUGINLIST) + +dnl Modify the output files. +AC_OUTPUT( +SpiralSound/Plugins/AmpPlugin/Makefile +SpiralSound/Plugins/AnotherFilterPlugin/Makefile +SpiralSound/Plugins/BeatMatchPlugin/Makefile +SpiralSound/Plugins/ControllerPlugin/Makefile +SpiralSound/Plugins/CounterPlugin/Makefile +SpiralSound/Plugins/DelayPlugin/Makefile +SpiralSound/Plugins/DiskWriterPlugin/Makefile +SpiralSound/Plugins/DistributorPlugin/Makefile +SpiralSound/Plugins/EchoPlugin/Makefile +SpiralSound/Plugins/EnvFollowerPlugin/Makefile +SpiralSound/Plugins/EnvelopePlugin/Makefile +SpiralSound/Plugins/FilterPlugin/Makefile +SpiralSound/Plugins/FlipflopPlugin/Makefile +SpiralSound/Plugins/FormantFilterPlugin/Makefile +SpiralSound/Plugins/JackPlugin/Makefile +SpiralSound/Plugins/KeyboardPlugin/Makefile +SpiralSound/Plugins/LADSPAPlugin/Makefile +SpiralSound/Plugins/LFOPlugin/Makefile +SpiralSound/Plugins/LogicPlugin/Makefile +SpiralSound/Plugins/MasherPlugin/Makefile +SpiralSound/Plugins/MatrixPlugin/Makefile +SpiralSound/Plugins/MeterPlugin/Makefile +SpiralSound/Plugins/MidiPlugin/Makefile +SpiralSound/Plugins/MixSwitchPlugin/Makefile +SpiralSound/Plugins/MixerPlugin/Makefile +SpiralSound/Plugins/MoogFilterPlugin/Makefile +SpiralSound/Plugins/NoisePlugin/Makefile +SpiralSound/Plugins/NoteSnapPlugin/Makefile +SpiralSound/Plugins/OperatorPlugin/Makefile +SpiralSound/Plugins/OscillatorPlugin/Makefile +SpiralSound/Plugins/OutputPlugin/Makefile +SpiralSound/Plugins/PoshSamplerPlugin/Makefile +SpiralSound/Plugins/RingModPlugin/Makefile +SpiralSound/Plugins/SVFilterPlugin/Makefile +SpiralSound/Plugins/SampleHoldPlugin/Makefile +SpiralSound/Plugins/ScopePlugin/Makefile +SpiralSound/Plugins/SeqSelectorPlugin/Makefile +SpiralSound/Plugins/SmoothPlugin/Makefile +SpiralSound/Plugins/SpiralLoopPlugin/Makefile +SpiralSound/Plugins/SplitSwitchPlugin/Makefile +SpiralSound/Plugins/SplitterPlugin/Makefile +SpiralSound/Plugins/StereoMixerPlugin/Makefile +SpiralSound/Plugins/StreamPlugin/Makefile +SpiralSound/Plugins/SwitchPlugin/Makefile +SpiralSound/Plugins/TranslatePlugin/Makefile +SpiralSound/Plugins/TransposePlugin/Makefile +SpiralSound/Plugins/TrigPlugin/Makefile +SpiralSound/Plugins/WaveShaperPlugin/Makefile +SpiralSound/Plugins/WaveTablePlugin/Makefile +SpiralSound/Plugins/XFadePlugin/Makefile +SpiralSynthPluginLocation.h +Makefile +) + +echo -e "\nConfig options:" +echo -n "libsndfile support for wave loading - " +if test "$use_sndfile" = "y"; then + echo "Enabled" +else + echo "Disabled - $sndfile_message" +fi +echo -n " ALSA support for MidiPlugin - " +if test "$use_alsa_midi" = "y"; then + echo "Enabled" +else + echo "Disabled - $amidi_message - Using OSS instead" +fi +echo -n " Jack support (via JackPlugin) - " +if test "$build_jack" = "y"; then + echo "Enabled" +else + echo "Disabled - $jack_message" +fi +echo -n " LADSPA support (via LADSPAPlugin) - " +if test "$build_ladspa" = "y"; then + echo "Enabled" +else + echo "Disabled - $ladspa_message" +fi +echo -n " liblrdf support for LADSPAPlugin - " +if test "$use_liblrdf" = "y"; then + echo "Enabled" +else + echo "Disabled - $lrdf_message" +fi +echo "" diff -Nru spiralsynthmodular-0.2.2a/createlinks spiralsynthmodular-0.2.3+git20140329/createlinks --- spiralsynthmodular-0.2.2a/createlinks 2002-11-05 16:11:12.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/createlinks 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -#!/bin/bash -if [ $# -gt 0 ] ; then - if ! [ -e links/$1.so ] ; then - echo Creating link for $1 - ln -s ../SpiralSound/Plugins/$1/$1.so links/$1.so - fi -else - if ! [ -d links ] ; then - if [ -e links ] ; then - echo A file \"links\" alredy exists, can\'t create the directory - exit - fi - mkdir links - fi - xargs -n 1 $0 < SpiralSound/PluginList.txt -fi diff -Nru spiralsynthmodular-0.2.2a/debian/changelog spiralsynthmodular-0.2.3+git20140329/debian/changelog --- spiralsynthmodular-0.2.2a/debian/changelog 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/debian/changelog 2014-03-29 16:56:12.000000000 +0000 @@ -1,235 +1,5 @@ -spiralsynthmodular (0.2.2a-4.1ubuntu1) intrepid; urgency=low +spiralsynthmodular (1:0.2.3+git20140329-1kxstudio1) lucid; urgency=low - * Merge from Debian unstable, remaining Ubuntu changes: - + debian/spiralsynthmodular.desktop: - - Desktop file added, now Freedesktop compliant. - + debian/rules: - - Install desktop file in /usr/share/applications. - + debian/spiralsynthmodular.dirs: - - Create /usr/share/applications directory. - + debian/control: - - Update Maintainer field as per spec. + * Initial release. - -- Luca Falavigna Sun, 01 Jun 2008 14:58:10 +0200 - -spiralsynthmodular (0.2.2a-4.1) unstable; urgency=low - - * Non-maintainer upload. - * Fix gcc-4.3 FTBFS, patch by KiBi (Closes: #455389) - - -- Marc 'HE' Brockschmidt Sun, 16 Mar 2008 18:49:26 +0100 - -spiralsynthmodular (0.2.2a-4ubuntu1) gutsy; urgency=low - - * Merge from Debian unstable. Remaining Ubuntu changes: - - HIGify debian/spiralsynthmodular.desktop. - - .desktop file updated deleting key "Encoding", now deprecated. - - Modify Maintainer value to match Debian-Maintainer-Field Spec - - -- Andrea Veri Fri, 22 Jun 2007 23:34:53 +0200 - -spiralsynthmodular (0.2.2a-4) unstable; urgency=low - - * Incorporated changes from NMU (closes: #375756) - * Added patch from Adam C. Emerson to make LADSPA plugins work on amd64 - (closes: #421520) - * Added patch from Martin Michlmayr to make SSM compile with g++ 4.3 - (closes: #417702) - * Upped Standards-Version to 3.7.2 (no changes required) - * Added libasound-dev to Build-Depends to enable ALSA support in MIDI plugin - - -- Chris Butler Fri, 22 Jun 2007 15:06:43 +0100 - -spiralsynthmodular (0.2.2a-3.1ubuntu1) edgy; urgency=low - - [ Luke Yelavich ] - * Merge from Debian unstable. - - [ Daniel T. Chen ] - * HIGify debian/spiralsynthmodular.desktop. - - -- Luke Yelavich Fri, 11 Aug 2006 19:31:10 -0400 - -spiralsynthmodular (0.2.2a-3.1) unstable; urgency=high - - * Non-maintainer upload. - * Replace unsatisfiable build-dependency on xlibmesa-glu-dev with - libglu1-mesa-dev; fixes FTBFS. (Closes: #374592) - - -- Steinar H. Gunderson Tue, 27 Jun 2006 22:25:25 +0200 - -spiralsynthmodular (0.2.2a-3) unstable; urgency=low - - * Incorporate changes from NMU (closes: #317223) - * applied patch from Martin Michlmayr to fix FTBFS issues with gcc-4.1 - (closes: #356115) - * Bumped Standards-Version to 3.6.2 - - -- Chris Butler Thu, 1 Dec 2005 13:54:16 +0000 - -spiralsynthmodular (0.2.2a-2.1ubuntu2) dapper; urgency=low - - * Added a .desktop file from Emmet Hikory (Closes: #28880) - - -- Dana Olson Fri, 24 Feb 2006 10:19:09 -0500 - -spiralsynthmodular (0.2.2a-2.1ubuntu1) dapper; urgency=low - - * Resynchronise with Debian. - * Merged spiralsynthmodular 0.2.2a-2.1 to 0.2.2a-2.1ubuntu2 - (closes: 5391) - * debian/control: Update Build-Depends to comply with GL/GLU transition. - - -- Luke Yelavich Wed, 7 Dec 2005 06:07:01 +0000 - -spiralsynthmodular (0.2.2a-2.1) unstable; urgency=low - - * Non-maintainer upload. - * build-depend on libjack0.100.0-dev. Closes: #317223 - - -- Andreas Barth Sun, 31 Jul 2005 13:45:04 +0200 - -spiralsynthmodular (0.2.2a-2ubuntu2) breezy; urgency=low - - * Rebuild because of unmet deps - - -- Barry deFreese Mon, 5 Sep 2005 21:31:15 +0200 - -spiralsynthmodular (0.2.2a-2ubuntu1) breezy; urgency=low - - * Fix for GL/GLU transition. - * Rebuild for correct libfltk1.1 dep. - - -- Michiel Sikkes Fri, 26 Aug 2005 23:49:00 +0200 - -spiralsynthmodular (0.2.2a-2build1) breezy; urgency=low - - * Rebuild for new C++ ABI - - -- Matthias Klose Tue, 7 Jun 2005 14:24:01 +0000 - -spiralsynthmodular (0.2.2a-2) unstable; urgency=low - - * Due to some issues with svn-buildpackage on my system, I ended up - with the .diff.gz reversing all the changes between 0.2.2 and - 0.2.2a. Whoops. The package really is on version 0.2.2a now. - * Include a menu icon in the package (closes: #299420) - - -- Chris Butler Tue, 15 Mar 2005 17:37:18 +0000 - -spiralsynthmodular (0.2.2a-1) unstable; urgency=low - - * New upstream release - - Fixed JACK plugin support (closes: #244155) - * Now compiled against latest libsndfile (closes: #229652) - - -- Chris Butler Tue, 22 Feb 2005 19:52:15 +0000 - -spiralsynthmodular (0.2.2-2) unstable; urgency=low - - * Fix const declarations in LADSPAPlugin (closes: #231868) - - -- Chris Butler Mon, 9 Feb 2004 19:05:08 +0000 - -spiralsynthmodular (0.2.2-1) unstable; urgency=low - - * New upstream version - * Updated libjack build-deps to 0.80.0 (closes: #228789) - * Bumped Standards-Version to 3.6.1 - - -- Chris Butler Sun, 25 Jan 2004 17:54:47 +0000 - -spiralsynthmodular (0.2.1-2) unstable; urgency=low - - * Adopted orphaned package - * Bumped Standards-Version to 3.5.10 - * Changed libjack build-deps to 0.71.2 - * Updated all references to fltk headers to use .H instead of .h - - -- Chris Butler Fri, 23 May 2003 19:07:18 +0100 - -spiralsynthmodular (0.2.1-1.1) unstable; urgency=low - - * Orphan at maintainer's request. - * FLTK 1.1 Xft2 transition: Build against fltk1.1-dev (>= 1.1.3-2.1) - and drop build-conflicts on libxft2-dev. (Closes: #192201, #193908) - - -- Aaron M. Ucko Thu, 22 May 2003 22:33:52 -0400 - -spiralsynthmodular (0.2.1-1) unstable; urgency=low - - * New upstream release - * Built against libjack0.50.0-dev - * new build deps: ladspa-sdk, xlibmesa-gl-dev, xlibmesa-glu-dev - * removed build-dep xlibmesa-dev - * Build-Conflicts with libxft2-dev (build fails otherwise) - - -- Stefan Schwandter Wed, 19 Mar 2003 14:19:08 +0100 - -spiralsynthmodular (0.2.0-3) unstable; urgency=low - - * Build against libjack0.44.0-dev - - -- Stefan Schwandter Tue, 14 Jan 2003 15:45:56 +0100 - -spiralsynthmodular (0.2.0-2) unstable; urgency=low - - * Ooops, build against the libjack version that's in the archive. - * Put libjack0.40.1-dev into Build-Depends - - -- Stefan Schwandter Fri, 10 Jan 2003 22:58:29 +0100 - -spiralsynthmodular (0.2.0-1) unstable; urgency=low - - * New upstream version - * Recompiled against libfltk1.1c102 (closes: #176146) - - -- Stefan Schwandter Fri, 10 Jan 2003 17:37:20 +0100 - -spiralsynthmodular (0.1.1-3) unstable; urgency=low - - * gcc-3.2 build fix (closes: #166614) - - -- Stefan Schwandter Sun, 27 Oct 2002 22:35:58 +0100 - -spiralsynthmodular (0.1.1-2) unstable; urgency=low - - * build against libpng12-0-dev and new glibc - - -- Stefan Schwandter Sun, 27 Oct 2002 11:45:26 +0100 - -spiralsynthmodular (0.1.1-1) unstable; urgency=low - - * New upstream release - - -- Stefan Schwandter Sat, 19 Oct 2002 14:47:46 +0200 - -spiralsynthmodular (0.1.0-5) unstable; urgency=low - - * -fPIC for CXXFLAGS _and_ CFLAGS (closes: #164415) - - -- Stefan Schwandter Sun, 13 Oct 2002 18:38:05 +0200 - -spiralsynthmodular (0.1.0-4) unstable; urgency=low - - * added -fPIC, should fix build on hppa (closes: #164415) - - -- Stefan Schwandter Sat, 12 Oct 2002 20:51:04 +0200 - -spiralsynthmodular (0.1.0-3) unstable; urgency=low - - * added xlibmesa-dev build dep - - -- Stefan Schwandter Fri, 11 Oct 2002 22:38:47 +0200 - -spiralsynthmodular (0.1.0-2) unstable; urgency=low - - * debian/SpiralSynthModular.1: fixed upstream's name - - -- Stefan Schwandter Sat, 5 Oct 2002 11:58:25 +0200 - -spiralsynthmodular (0.1.0-1) unstable; urgency=low - - * Initial release (closes: #158102) - - -- Stefan Schwandter Sat, 5 Oct 2002 10:59:21 +0200 + -- falkTX Thu, 20 Mar 2014 12:39:15 +0000 diff -Nru spiralsynthmodular-0.2.2a/debian/compat spiralsynthmodular-0.2.3+git20140329/debian/compat --- spiralsynthmodular-0.2.2a/debian/compat 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/debian/compat 2013-05-19 17:49:11.000000000 +0000 @@ -1,2 +1 @@ -4 - +8 diff -Nru spiralsynthmodular-0.2.2a/debian/control spiralsynthmodular-0.2.3+git20140329/debian/control --- spiralsynthmodular-0.2.2a/debian/control 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/debian/control 2014-03-29 15:59:44.000000000 +0000 @@ -1,16 +1,27 @@ Source: spiralsynthmodular Section: sound -Priority: optional -Maintainer: Ubuntu MOTU Developers -XSBC-Original-Maintainer: Chris Butler -Build-Depends: debhelper (>> 4.0.0), libfltk1.1-dev (>= 1.1.3-2.1), libpng12-dev, libjack0.100.0-dev, ladspa-sdk, xlibmesa-gl-dev, libglu1-mesa-dev, libsndfile1-dev, liblrdf-dev, libasound-dev -Standards-Version: 3.7.2 +Priority: extra +Maintainer: falkTX +Build-Depends: debhelper (>= 8.0.0), dh-autoreconf, + autotools-dev, automake, libtool, autoconf, pkg-config, + ladspa-sdk, +# TODO: liblrdf + libasound2-dev, + libjack-dev, + libx11-dev, + libxext-dev, + libsndfile-static, + ntk-static +Standards-Version: 3.8.4 Package: spiralsynthmodular Architecture: any -Depends: ${shlibs:Depends} -Description: An Object orientated modular softsynth / sequencer / sampler +Pre-Depends: xz-utils +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: object orientated music studio + SpiralSynth Modular is an object orientated music studio with an emphasis on live use. You can use it in a fairly straight forward way to make tracks with, - or get very experimental. Audio or control data can be freely passed - between the plugins, there is no difference. Data can also be fed - back on itself for chaotic effects. + or get very experimental. + . + Audio or control data can be freely passed between the plugins. + Data can also be fed back on itself for chaotic effects. diff -Nru spiralsynthmodular-0.2.2a/debian/copyright spiralsynthmodular-0.2.3+git20140329/debian/copyright --- spiralsynthmodular-0.2.2a/debian/copyright 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/debian/copyright 2014-03-20 12:42:22.000000000 +0000 @@ -1,10 +1,23 @@ -This package was debianized by Stefan Schwandter on -Tue, 14 May 2002 17:46:52 +0200. +This package was debianized by falkTX on +Thu, 20 Mar 2014 12:39:15 +0000. -It was downloaded from http://www.pawfal.org/Software/SSM/ +License: -Upstream Author: Dave Griffiths + This package 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. -Copyright: + This package 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 package; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + 02110-1301 USA + +On Debian systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL-2'. -GPL version 2, see /usr/share/common-licenses/GPL-2 diff -Nru spiralsynthmodular-0.2.2a/debian/patches/fix-ntk-detect.patch spiralsynthmodular-0.2.3+git20140329/debian/patches/fix-ntk-detect.patch --- spiralsynthmodular-0.2.2a/debian/patches/fix-ntk-detect.patch 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/debian/patches/fix-ntk-detect.patch 2014-03-29 16:14:29.000000000 +0000 @@ -0,0 +1,24 @@ +--- spiralsynthmodular-0.2.3+git20140329.orig/configure.in ++++ spiralsynthmodular-0.2.3+git20140329/configure.in +@@ -160,7 +160,7 @@ dnl AC_CHECK_HEADERS(X11/Xlib.h) + dnl AC_CHECK_LIB(X11, XDisplayName) + dnl AC_CHECK_LIB(Xext, main) + +-AC_PATH_PROG(FLTK_CONFIG, fltk-config, no) ++AC_PATH_PROG(PKG_CONFIG, pkg-config, no) + if test "$FLTK_CONFIG" = "no"; then + AC_PATH_XTRA + LIBGL="" +@@ -179,9 +179,9 @@ if test "$FLTK_CONFIG" = "no"; then + FLTK_CFLAGS="$FLTK_CXXFLAGS" + FLTK_LIBS="$X_LIBS -lfltk $LIBGL" + else +- FLTK_CXXFLAGS=`$FLTK_CONFIG $fltk_config_args --cxxflags` +- FLTK_CFLAGS=`$FLTK_CONFIG $fltk_config_args --cxxflags` +- FLTK_LIBS=`$FLTK_CONFIG $fltk_config_args --ldflags` ++ FLTK_CXXFLAGS=`$PKG_CONFIG --cflags ntk_images ntk` ++ FLTK_CFLAGS=`$PKG_CONFIG --cflags ntk_images ntk` ++ FLTK_LIBS=`$PKG_CONFIG --libs ntk_images ntk` + dnl This caused problems for debian users, + dnl It would be nice to find a more robust way of doing it. + dnl if test "${FLTK_LIBS/*-rpath*/yes}" != "yes"; then diff -Nru spiralsynthmodular-0.2.2a/debian/patches/series spiralsynthmodular-0.2.3+git20140329/debian/patches/series --- spiralsynthmodular-0.2.2a/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/debian/patches/series 2014-03-29 16:15:32.000000000 +0000 @@ -0,0 +1,2 @@ +fix-ntk-detect.patch +sndfile-libs.patch diff -Nru spiralsynthmodular-0.2.2a/debian/patches/sndfile-libs.patch spiralsynthmodular-0.2.3+git20140329/debian/patches/sndfile-libs.patch --- spiralsynthmodular-0.2.2a/debian/patches/sndfile-libs.patch 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/debian/patches/sndfile-libs.patch 2014-03-29 16:15:38.000000000 +0000 @@ -0,0 +1,11 @@ +--- spiralsynthmodular-0.2.3+git20140329.orig/configure.in ++++ spiralsynthmodular-0.2.3+git20140329/configure.in +@@ -147,7 +147,7 @@ if test "$use_sndfile" = "y"; then + fi + if test "$use_sndfile" = "y"; then + AC_DEFINE(USE_LIBSNDFILE, , [Enable libsndfile for waveform loading]) +- SFLIBS="-lsndfile" ++ SFLIBS="-lsndfile -lFLAC -lvorbisenc -lvorbis -logg -lm" + AC_SUBST(SFLIBS) + fi + diff -Nru spiralsynthmodular-0.2.2a/debian/rules spiralsynthmodular-0.2.3+git20140329/debian/rules --- spiralsynthmodular-0.2.2a/debian/rules 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/debian/rules 2014-03-29 16:35:56.000000000 +0000 @@ -1,75 +1,83 @@ #!/usr/bin/make -f -# Sample debian/rules that uses debhelper. -# GNU copyright 1997 to 1999 by Joey Hess. -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 +FLAGS=-g -O2 -pipe -ffast-math -mtune=generic -msse -msse2 -mfpmath=sse -fPIC -DPIC -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 +export CFLAGS=$(FLAGS) +export CXXFLAGS=$(FLAGS) +export LDFLAGS=-Wl,-O1 -Wl,-Bsymbolic-functions -Wl,--strip-all -Wl,-z,relro,-z,now -Wl,--no-undefined + +export PKG_CONFIG_PATH=/opt/kxstudio/lib/pkgconfig + +override_dh_auto_install: + mkdir -p $(CURDIR)/debian/spiralsynthmodular/usr/bin/ + mkdir -p $(CURDIR)/debian/spiralsynthmodular/usr/lib/ + + dh_auto_install -- \ + bindir=$(CURDIR)/debian/spiralsynthmodular/usr/bin/ \ + libdir=$(CURDIR)/debian/spiralsynthmodular/usr/lib/ + +override_dh_auto_clean: + dh_auto_clean + + rm -f Makefile + rm -f SpiralSound/PluginList.txt + rm -f SpiralSound/Plugins/AmpPlugin/Makefile + rm -f SpiralSound/Plugins/AnotherFilterPlugin/Makefile + rm -f SpiralSound/Plugins/BeatMatchPlugin/Makefile + rm -f SpiralSound/Plugins/ControllerPlugin/Makefile + rm -f SpiralSound/Plugins/CounterPlugin/Makefile + rm -f SpiralSound/Plugins/DelayPlugin/Makefile + rm -f SpiralSound/Plugins/DiskWriterPlugin/Makefile + rm -f SpiralSound/Plugins/DistributorPlugin/Makefile + rm -f SpiralSound/Plugins/EchoPlugin/Makefile + rm -f SpiralSound/Plugins/EnvFollowerPlugin/Makefile + rm -f SpiralSound/Plugins/EnvelopePlugin/Makefile + rm -f SpiralSound/Plugins/FilterPlugin/Makefile + rm -f SpiralSound/Plugins/FlipflopPlugin/Makefile + rm -f SpiralSound/Plugins/FormantFilterPlugin/Makefile + rm -f SpiralSound/Plugins/JackPlugin/Makefile + rm -f SpiralSound/Plugins/KeyboardPlugin/Makefile + rm -f SpiralSound/Plugins/LADSPAPlugin/Makefile + rm -f SpiralSound/Plugins/LFOPlugin/Makefile + rm -f SpiralSound/Plugins/LogicPlugin/Makefile + rm -f SpiralSound/Plugins/MasherPlugin/Makefile + rm -f SpiralSound/Plugins/MatrixPlugin/Makefile + rm -f SpiralSound/Plugins/MeterPlugin/Makefile + rm -f SpiralSound/Plugins/MidiPlugin/Makefile + rm -f SpiralSound/Plugins/MixSwitchPlugin/Makefile + rm -f SpiralSound/Plugins/MixerPlugin/Makefile + rm -f SpiralSound/Plugins/MoogFilterPlugin/Makefile + rm -f SpiralSound/Plugins/NoisePlugin/Makefile + rm -f SpiralSound/Plugins/NoteSnapPlugin/Makefile + rm -f SpiralSound/Plugins/OperatorPlugin/Makefile + rm -f SpiralSound/Plugins/OscillatorPlugin/Makefile + rm -f SpiralSound/Plugins/OutputPlugin/Makefile + rm -f SpiralSound/Plugins/PoshSamplerPlugin/Makefile + rm -f SpiralSound/Plugins/RingModPlugin/Makefile + rm -f SpiralSound/Plugins/SVFilterPlugin/Makefile + rm -f SpiralSound/Plugins/SampleHoldPlugin/Makefile + rm -f SpiralSound/Plugins/ScopePlugin/Makefile + rm -f SpiralSound/Plugins/SeqSelectorPlugin/Makefile + rm -f SpiralSound/Plugins/SmoothPlugin/Makefile + rm -f SpiralSound/Plugins/SpiralLoopPlugin/Makefile + rm -f SpiralSound/Plugins/SplitSwitchPlugin/Makefile + rm -f SpiralSound/Plugins/SplitterPlugin/Makefile + rm -f SpiralSound/Plugins/StereoMixerPlugin/Makefile + rm -f SpiralSound/Plugins/StreamPlugin/Makefile + rm -f SpiralSound/Plugins/SwitchPlugin/Makefile + rm -f SpiralSound/Plugins/TranslatePlugin/Makefile + rm -f SpiralSound/Plugins/TransposePlugin/Makefile + rm -f SpiralSound/Plugins/TrigPlugin/Makefile + rm -f SpiralSound/Plugins/WaveShaperPlugin/Makefile + rm -f SpiralSound/Plugins/WaveTablePlugin/Makefile + rm -f SpiralSound/Plugins/XFadePlugin/Makefile + rm -f SpiralSynthPluginLocation.h + rm -f config.h + rm -f config.log + rm -f config.status + +override_dh_builddeb: + dh_builddeb -- -Zlzma -z9 -DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) -DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) - -ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) - confflags += $(DEB_HOST_GNU_TYPE) -else - confflags += --host $(DEB_BUILD_GNU_TYPE) --build $(DEB_HOST_GNU_TYPE) -endif - -configure: configure-stamp -configure-stamp: - dh_testdir - - ./configure $(confflags) --prefix=/usr - - touch configure-stamp - -build: build-stamp - -build-stamp: configure-stamp - dh_testdir - - $(MAKE) - - touch build-stamp - -clean: - dh_testdir - dh_testroot - rm -f configure-stamp build-stamp - - -$(MAKE) distclean - - dh_clean - -install: build - dh_testdir - dh_testroot - dh_clean -k - dh_installdirs - dh_install debian/spiralsynthmodular.desktop usr/share/applications - - $(MAKE) install prefix=$(CURDIR)/debian/spiralsynthmodular/usr - install -m 644 GUI/SpiralIcon32x32.xpm debian/spiralsynthmodular/usr/share/pixmaps/spiralsynthmodular.xpm - - -binary-indep: build install - -binary-arch: build install - dh_testdir - dh_testroot - dh_installdocs - dh_installexamples - dh_installmenu - dh_installman - dh_installchangelogs CHANGES - dh_strip - dh_compress - dh_fixperms - dh_installdeb - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb - -binary: binary-indep binary-arch -.PHONY: configure build clean binary-indep binary-arch binary install +%: + dh $@ --with=autoreconf diff -Nru spiralsynthmodular-0.2.2a/debian/source/format spiralsynthmodular-0.2.3+git20140329/debian/source/format --- spiralsynthmodular-0.2.2a/debian/source/format 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/debian/source/format 2012-05-15 00:34:21.000000000 +0000 @@ -0,0 +1 @@ +3.0 (quilt) diff -Nru spiralsynthmodular-0.2.2a/debian/source/options spiralsynthmodular-0.2.3+git20140329/debian/source/options --- spiralsynthmodular-0.2.2a/debian/source/options 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/debian/source/options 2014-03-24 14:33:31.000000000 +0000 @@ -0,0 +1,2 @@ +compression = "xz" +compression-level = 9 diff -Nru spiralsynthmodular-0.2.2a/debian/spiralsynthmodular.1 spiralsynthmodular-0.2.3+git20140329/debian/spiralsynthmodular.1 --- spiralsynthmodular-0.2.2a/debian/spiralsynthmodular.1 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/debian/spiralsynthmodular.1 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -.TH SPIRALSYNTHMODULAR "1" "October 2002" "0.1.0" -.SH NAME -SpiralSynthModular - A virtual modular synthesizer -.SH SYNOPSYS -.B spiralsynthmodular -.SH DESCRIPTION -.B spiralsynthmodular -starts SpiralSynthModular. See /usr/share/doc/spiralsynthmodular/README for details. -.SH AUTHORS -Dave Griffith -.PP -This manpage was written by Stefan Schwandter diff -Nru spiralsynthmodular-0.2.2a/debian/spiralsynthmodular.desktop spiralsynthmodular-0.2.3+git20140329/debian/spiralsynthmodular.desktop --- spiralsynthmodular-0.2.2a/debian/spiralsynthmodular.desktop 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/debian/spiralsynthmodular.desktop 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -[Desktop Entry] -Type=Application -Name=SpiralSynthModular -Comment=Create and edit audio tracks for live use -Icon=spiralsynthmodular -Exec=spiralsynthmodular -Terminal=false -Categories=AudioVideo;Audio; diff -Nru spiralsynthmodular-0.2.2a/debian/spiralsynthmodular.dirs spiralsynthmodular-0.2.3+git20140329/debian/spiralsynthmodular.dirs --- spiralsynthmodular-0.2.2a/debian/spiralsynthmodular.dirs 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/debian/spiralsynthmodular.dirs 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -usr/bin -usr/share/pixmaps -usr/share/applications diff -Nru spiralsynthmodular-0.2.2a/debian/spiralsynthmodular.docs spiralsynthmodular-0.2.3+git20140329/debian/spiralsynthmodular.docs --- spiralsynthmodular-0.2.2a/debian/spiralsynthmodular.docs 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/debian/spiralsynthmodular.docs 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -README diff -Nru spiralsynthmodular-0.2.2a/debian/spiralsynthmodular.examples spiralsynthmodular-0.2.3+git20140329/debian/spiralsynthmodular.examples --- spiralsynthmodular-0.2.2a/debian/spiralsynthmodular.examples 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/debian/spiralsynthmodular.examples 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Examples/*.ssm diff -Nru spiralsynthmodular-0.2.2a/debian/spiralsynthmodular.manpages spiralsynthmodular-0.2.3+git20140329/debian/spiralsynthmodular.manpages --- spiralsynthmodular-0.2.2a/debian/spiralsynthmodular.manpages 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/debian/spiralsynthmodular.manpages 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -debian/spiralsynthmodular.1 diff -Nru spiralsynthmodular-0.2.2a/debian/spiralsynthmodular.menu spiralsynthmodular-0.2.3+git20140329/debian/spiralsynthmodular.menu --- spiralsynthmodular-0.2.2a/debian/spiralsynthmodular.menu 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/debian/spiralsynthmodular.menu 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -?package(spiralsynthmodular):\ -needs="x11"\ -section="Apps/Sound"\ -title="SpiralSynthModular"\ -icon="/usr/share/pixmaps/spiralsynthmodular.xpm"\ -command="/usr/bin/spiralsynthmodular" diff -Nru spiralsynthmodular-0.2.2a/Examples/Sequence.ssm spiralsynthmodular-0.2.3+git20140329/Examples/Sequence.ssm --- spiralsynthmodular-0.2.2a/Examples/Sequence.ssm 2003-02-23 23:24:48.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/Examples/Sequence.ssm 2012-05-31 04:13:57.000000000 +0000 @@ -1,11 +1,11 @@ SpiralSynthModular File Ver 4 -298 115 700 600 0 0 0 0 +0 19 800 581 0 0 0 0 SectionList 9 Device 0 Plugin 18 -81 92 6 Matrix 0 91 92 -4 0 0.122984 16 1 0 +81 193 6 Matrix 0 91 193 +4 0 0.0458505 14 1 0 32 6.6 3 1 1 1 7 1 1 13 1 1 15 1 1 19 1 1 23 1 1 25 1 1 29 1 1 30 3 1 0 4 1 2 4 1 6 4 1 10 4 1 12 4 1 14 4 1 18 4 1 20 4 1 24 4 1 28 4 1 31 6 1 4 11 1 8 11 1 16 11 1 22 11 1 26 11 1 -1 32 1 0 -1 32 1 0 @@ -26,35 +26,35 @@ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Device 1 Plugin 4 -162 61 10 Oscillator 0 172 61 -1 2 1 1 0.21 0 nan 1 +162 162 10 Oscillator 0 172 162 +1 2 1 1 0.21 0 0 1 Device 2 Plugin 0 -464 59 3 OSS 0 474 59 +464 160 3 OSS 0 474 160 Device 3 Plugin 8 -390 60 12 Stereo Mixer 0 400 60 +390 161 12 Stereo Mixer 0 400 161 1 0.39 0 0.36 1 1 0.5 1 0.5 Device 4 Plugin 14 -316 35 4 Echo 0 326 35 -1 0.321 0.31 +316 136 4 Echo 0 326 136 +2 0.321 0.31 0 Device 5 Plugin 13 -244 79 11 Moog Filter 0 254 79 +244 180 11 Moog Filter 0 254 180 1 0 0.37002 Device 7 Plugin 5 -164 136 8 Envelope 0 174 136 +164 237 8 Envelope 0 174 237 1 0.0121 0.16 0 0 0.92 0 Device 9 Plugin 14 -317 101 4 Echo 0 327 101 -1 0.34 0.31 +317 202 4 Echo 0 327 202 +2 0.34 0.31 0 Device 11 Plugin -1 -83 17 0 0 0 0 +83 118 0 0 0 0 1 51 Using the Matrix plugin to create a robotic melody. diff -Nru spiralsynthmodular-0.2.2a/GUI/SpiralIcon32x32.xpm spiralsynthmodular-0.2.3+git20140329/GUI/SpiralIcon32x32.xpm --- spiralsynthmodular-0.2.2a/GUI/SpiralIcon32x32.xpm 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/GUI/SpiralIcon32x32.xpm 1970-01-01 00:00:00.000000000 +0000 @@ -1,162 +0,0 @@ -/* XPM */ -static char *SpiralIcon32x32[] = { -/* columns rows colors chars-per-pixel */ -"32 32 124 2", -" c #0087008100A5", -". c #06F606510998", -"X c #081F07E60905", -"o c #0B6D0AE20D99", -"O c #0E550D8F1173", -"+ c #10890F931469", -"@ c #12FC12A4146A", -"# c #14AD13421A56", -"$ c #189C17B21C3C", -"% c #1B931B101DA8", -"& c #196917C52057", -"* c #1DE21C752393", -"= c #20832018222E", -"- c #211D1F0E2966", -"; c #22C52254247D", -": c #259724062BE9", -"> c #29F5296F2C1F", -", c #264123783193", -"< c #2C322A5733A2", -"1 c #312B2EB73AE2", -"2 c #321F31D43349", -"3 c #362F35073AB8", -"4 c #3B493B243BED", -"5 c #36D1342C4164", -"6 c #392A36B64265", -"7 c #3EF03E6B40FE", -"8 c #3D0839E149E4", -"9 c #41303FB44723", -"0 c #41A73F1F4BDD", -"q c #42D842B6436F", -"w c #461E44094E61", -"e c #48C0481A4B90", -"r c #4A904A3D4BD8", -"t c #482945CD51AB", -"y c #4DAA4BB4557A", -"u c #4DE34B3058A9", -"i c #50C44F8755DA", -"p c #52324FC75C16", -"a c #53E053905514", -"s c #555253015EB7", -"d c #589C57365E71", -"f c #5B8D5B505C9B", -"g c #576D548D62FF", -"h c #57A852446D0F", -"j c #5A08576A6494", -"k c #5A97568D6B48", -"l c #5DBA5BD26551", -"z c #5F135C466A83", -"x c #5BD5563271E8", -"c c #61B75F1D6C19", -"v c #60A45BA87438", -"b c #63BE5E447942", -"n c #640B63BB6552", -"m c #661C64776C92", -"M c #694E67887063", -"N c #6BAE6B136E12", -"B c #67B8655C714F", -"V c #6A6E65B97D47", -"C c #6F2D6DFB73DF", -"Z c #6E866ADE7D2C", -"A c #71756EA17CB6", -"S c #73C6738E748C", -"D c #769075847ABC", -"F c #7C7E7C377D92", -"G c #724F6DD2842F", -"H c #75E9725A845B", -"J c #7D217B398493", -"K c #7E1B7B298A0C", -"L c #7F127AB190A3", -"P c #82CC7FB28F07", -"I c #84A7846085B4", -"U c #861284138E63", -"Y c #88D087908DCA", -"T c #8AFC8AB48BFC", -"R c #85DD82559418", -"E c #89DA86B89722", -"W c #8F008D8D94D9", -"Q c #90A6901B9338", -"! c #91E38F4E9BE3", -"~ c #9223918194BF", -"^ c #96D7952D9DA4", -"/ c #9BCF9B9E9C96", -"( c #92918EEBA161", -") c #96F393AAA3F3", -"_ c #998196C2A4B6", -"` c #9E6C9D26A39E", -"' c #A06B9DAEAB90", -"] c #A10F9FACA6A0", -"[ c #A28FA010ACC8", -"{ c #A41DA3DCA515", -"} c #A586A336AE7D", -"| c #A98DA956AA48", -" . c #AAC2A845B51D", -".. c #ADFFAC47B4AF", -"X. c #B153AFCEB724", -"o. c #B2A9B0ADBA4D", -"O. c #B5DFB569B794", -"+. c #B57AB3C3BC61", -"@. c #B9A6B803BFD4", -"#. c #BB24BAD3BC1D", -"$. c #BF7FBE59C412", -"%. c #C0EFC043C398", -"&. c #C0F7BEF1C907", -"*. c #C4AEC445C654", -"=. c #C62BC4ADCBFD", -"-. c #C988C7E1D016", -";. c #CE75CE29CFA7", -":. c #CD6CCBD9D335", -">. c #D15DD027D640", -",. c #D607D5A5D780", -"<. c #D4A8D383D903", -"1. c #D90ED7FADD23", -"2. c #DDC5DD46DF92", -"3. c #DEE7DE2BE1E7", -"4. c #E131E077E445", -"5. c #E542E4C8E715", -"6. c #E6AFE5E1E9DF", -"7. c #E8FFE8E0E980", -"8. c #EC17EBC8ED5A", -"9. c #F059EFDCF246", -"0. c #F529F503F5BB", -"q. c #F869F83DF911", -"w. c #FD52FD42FD8A", -"e. c None", -/* pixels */ -"e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.", -"e.e.e.e.e.e.e.e. e.e.e.e.e.e.e.e.e.e.e.", -"e.e.e.e.e.e. . o o $ 3 < O . * : o e.e.e.e.e.e.e.e.e.e.e.", -"e.e.e.e.e.e. * c ~ l y :.&.u , } *.U t O e.e.e.e.e.e.e.e.e.e.", -"e.e.e. . A 7.0.R 6 2.5.f y :.w.0.#.< e.e.e.e.e.e.e.e.", -"e.e.e. o : & c >.7.Q 8 >.*.> 3 -.8.~ l 5 i ; e.e.e.e.e.e.e.e.", -"e.e. o l -.] k w m @.h ] #.% 4 ;.{ % o u ,.| * e.e.e.e.e.e.e.", -" 0 :.w.,.n o @ Q E ( #.* f *.a X @ F 2.*.w e.e.e.e.e.e.", -" : _ w.w.2.D % X 4 / _ { $ S / ; @ N o.L b G w e.e.e.e.e.e.", -" @ U 9.w.w.w.8./ 4 @ 3 c j * t r % M U Z ` <.6.U . e.e.e.e.e.e.", -" 3 >.w.q.q.0.0.9.;.m @ O X o . o % s P +.,.7.8.R . e.e.e.e.e.e.", -". j 8.q.O.S N n D I r o @ > 3 < > a } u . e.e.e.e.e.e.", -"o Z 3.$.w . X X X X X . o 9 4 @ . X o $ o e.e.e.e.e.e.", -". 5 G h * . X O o X & s m 3 : n *./ r 3 a o e.e.e.e.e.e.e.", -"- ~ 5.$.a ; 2 q n / N @ D *.l D S % Q 8.6.<.X.< e.e.e.e.e.e.", -"5 =.w.0.1.,.2.7.5.%.f % u B 3 | I o ; #.0.X.0 $ o e.e.e.e.e.e.", -"< @.w.w.w.w.q.2.T > O : . # C 8.T % ; { } 0 3 W B O e.e.e.e.e.e.", -"$ ^ w.w.w.7.{ q o * u * O u W a # o < - $ ! q.:.s O e.e.e.", -"O U w.w.*.f $ ; ` 3.U , < $ o O @ # # : Q q.w.:.c O e.e.e.", -". p 7.q.Q O @ Q 0.3.H ' o.3 O a Y 3 o > { 0.w.1.m + e.e.", -" 3 :.w...: . S 8.q.! G 8.*.2 3 ;.{ = ; ` w.w.3.J - e.", -" * ! &.R z % r ,.w.;.x ..q.{ @ : *.0.S X 3 *.w.w.8.) * ", -"e. * g ..3.` $.0.0.R v 5.9.F o { q.#.% . a 3.w.w.@.< ", -"e. o C 8.w.q.w.w.3.x ! w.8.C o Q 0.5.4 o m 6.w.:.p . ", -"e. : / 8.w.w.q.( h =.w.8.m T 0.q.F o O < ~ 2. .w o e.", -"e. * J 3.w.:.0 K 0.w.3.a X . T q.w.,.T l # % < $ . e.e.", -"e.e.e.e. # d ` j : } q.w.0.#.C w M *.q.w.w.6.H . e.e.", -"e.e.e.e. O . 1 $.0.q.q.q.+.V -.w.q.0.3.) , e.e.e.e.e.e.e.", -"e.e.e.e.e.e. o 3 Z U I T s < ~ :.{ J w $ e.e.e.e.e.e.e.", -"e.e.e.e.e.e.e.e. . . X X . * 1 $ o e.e.e.e.e.e.e.e.", -"e.e.e.e.e.e.e.e.e.e. e.e.e.e.e.e.e.e.e.e.", -"e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e." -}; Binary files /tmp/ulTiGKX_Pq/spiralsynthmodular-0.2.2a/GUI/SSM.xcf and /tmp/jmKeSo9oMY/spiralsynthmodular-0.2.3+git20140329/GUI/SSM.xcf differ diff -Nru spiralsynthmodular-0.2.2a/GUI/SSM.xpm spiralsynthmodular-0.2.3+git20140329/GUI/SSM.xpm --- spiralsynthmodular-0.2.2a/GUI/SSM.xpm 2004-01-06 19:41:10.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/GUI/SSM.xpm 2012-05-31 04:13:57.000000000 +0000 @@ -489,23 +489,23 @@ ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", -". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . * + % % $ & - . . . . . . . . . . . . . . . * + % % $ & - . . . . . . . . . . . . . * + % % $ & - . . . . . . . . . . ", -". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . # % % % % % % % # . . . . . . . . . . . . . & % % % % % % $ # . . . . . . . . . . . & % % % % % % $ # . . . . . . . . . ", -". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . # % % % % % % % % % # . . . . . . . . . . . # % % = + % % % % % - . . . . . . . . . # % % = + % % % % % - . . . . . . . . ", -". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - $ % % % % % % % % % $ . . . . . . . . . . . $ % % = - $ % & = % + . . . . . . . . . $ % % = - $ % & = % + . . . . . . . . ", -". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . @ % % % % % $ % % % % % @ . . . . . . . . . - % % % % . - - - % % % . . . . . . . . - % % % % . - - - % % % . . . . . . . . ", -". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . = % % % % % - % % % % % + . . . . . . . . . # % % + * . . . + % % % . . . . . . . . # % % + * . . . + % % % . . . . . . . . ", -". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . % % % % % = . = % % % % % . . . . . . . . . . % % + & . . . - $ % $ . . . . . . . . . % % + & . . . - $ % $ . . . . . . . . ", -". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - % % % + # * . * # @ $ % % . . . . . . . . . . = % % = . * % = + % & . . . . . . . . . = % % = . * % = + % & . . . . . . . . ", -". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . * % % % % # . . . # $ % % % . . . . . . . . . . - $ % * . = % % % % - . . . . . . . . . - $ % * . = % % % % - . . . . . . . . ", -". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . % % % % + . . . = % % % % . . . - # * . . . . . - @ . * % % % % & . . . . - # * . . . . - @ . * % % % % & . . . . . . . . . ", -". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . % % % % @ & % @ & % % % $ . . & % + % $ - . . . . . . = % % % % - . . . & % + % $ - . . . . . = % % % % - . . . . . . . . . ", -". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . + % % % % % % % $ % % % + . * % % * + % = . . . . . @ % % % % & . - . * % % * + % = . . . . @ % % % % & . - . . . . . . . . ", -". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . * % % % % % % % % % % % * . + + . . . - $ . . . . . $ % % % % % % % . + + . . . - $ . . . . $ % % % % % % % . . . . . . . . ", -". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . + % % % % % % % % % = . . & % # . . % % . . . . @ % % % % % % % % . & % # . . % % . . . @ % % % % % % % % . . . . . . . . ", -". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . $ % % % % % % % $ - . . * % # @ @ & = . . . - % % % % % % % % % . * % # @ @ & = . . - % % % % % % % % % . . . . . . . . ", -". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . & % % % % % & - . . . . & $ % % = - . . . & % % % % % % % % % . . & $ % % = - . . & % % % % % % % % % . . . . . . . . ", -". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . # # # . . . . . . . . - # * . . . . . # # # # # # # # # # . . . - # * . . . . # # # # # # # # # # . . . . . . . . ", +". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - @ + + + # . . . . . . . . . . . . . . . * @ + + + @ - . . . . . . . . . . . . . . * & + + + & * . . . . . . . . . . . . . . . . - # + + + + + & + + @ . . . . . @ + * . * @ + + + + + * . . . . . . . . . ", +". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - = % = + $ % & - . . . . . . . . . . . . . + % % % % % = * . . . . . . . . . . . . . + = + + = % $ * . . . . . . . . . . . . . . @ = % % + + + = = = % % . . . . * $ % * @ $ % $ + + + $ + . . . . . . . . . ", +". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . # % = - . * % % # . . . . . . . . . . . . . + # # # = % % $ . . . . . . . . . . . . . * - . . - % % = . . . . . . . . . . . . . * % % % # . . . - * + % % . . . . # % % . $ % = * . . . * * . . . . . . . . . ", +". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . % % @ . . . & % + . . . . . . . . . . . . . . . . . - = % % . . . . . . . . . . . . . . . . . . % % % . . . . . . . . . . . . . = % = - . . . . . . # % % # . . . + % & . % % + . . . . . . . . . . . . . . . ", +". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . * % % # . . . # % $ * . . . . . . . . . . . . . . . . . + % % . . . . . . . . . . . . . . . . . * % % & . . . . . . . . . . . . * % % @ . . . . . . . # % % = . . * $ % # . % % % + * . . . . . . . . . . . . . ", +". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . # % % # . . . # % % # . . . . . . . . . . . . . . . . - = % + . . . . . . . . . . . . . . * # & % % = * . . . . . . . . . . . . # % % # . . . . . . . . + % % . . # % % . . @ % % % % & - . . . . . . . . . . . ", +". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . # % % # . . . # % % # . . . . . . . . . . . . . . . . + % = . . . . . . . . . . . . . . . + % % = # - . . . . . . . . . . . . . # % % # . . . . . . . . & % % * . & % = . . . @ = % % % % & . . . . . . . . . . ", +". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . # % % # . . . # % % # . . . . . . . . . . . . . . . # $ = - . . . . . . . . . . . . . . . * # @ = % + - . . . . . . . . . . . . # % % # . . . . . . . . # % % + . % % # . . . . - @ = % % % & . . . . . . . . . ", +". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . # % % # . . . # % % # . . . . . . . . . . . . . . @ $ + - . . . . . . . . . . . . . . . . . . . * % % & . . . . . . . . . . . . # % % @ . . . . . . . . * $ % $ * % = - . . . . . . - @ $ % % @ . . . . . . . . ", +". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - % % # . . . # % = - . . . . . . . . . . . . . * % = - . . . . . . . . . . . . . . . . . . . . . % % % . . . . . . . . . . . . - % % + . . . . . . . . . + % % # % + . . . . . . . . . * % % + . . . . . . . . ", +". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . % % & . . . = % + . . . . . . . . . . . . . @ % % # . . . . . . . . . . . . . . . . . . . . . . % % % . . . . . . . . . . . . . & % % = . . . . . * . . * % % % % @ . . . * . . . . . @ % % + . . . . . . . . ", +". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . # % = - . * % % # . . . . + % % + . . . . . % % = # # # # # . . . . # % % % . . . . . - . . . & % % # . . . . . . . . . . . . . * % % % % # # # = + . . . % % % % # . . . % % # # # & % % % @ . . . . . . . . ", +". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . = % % % % % @ . . . . . + % % + . . . . . % % % % % % % % . . . . # % % % . . . . . + % % % % % & . . . . . . . . . . . . . . . * = % % % % % % + . . . $ % % + . . . . % % % % % % % % @ . . . . . . . . . ", +". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . * + + + . . . . . . . @ + + @ . . . . . + + + + + + + + . . . . * + + + . . . . . * + + + @ . . . . . . . . . . . . . . . . . . . . + + + + * . . . . @ + + @ . . . . . + + + + + * . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", diff -Nru spiralsynthmodular-0.2.2a/GUI/Widgets/Fl_Canvas.C spiralsynthmodular-0.2.3+git20140329/GUI/Widgets/Fl_Canvas.C --- spiralsynthmodular-0.2.2a/GUI/Widgets/Fl_Canvas.C 2004-02-11 18:30:44.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/GUI/Widgets/Fl_Canvas.C 2012-05-31 04:13:57.000000000 +0000 @@ -14,26 +14,34 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ +*/ #include "FL/fl_draw.H" +#include #include "Fl_Canvas.h" #include "Fl_DeviceGUI.h" #include #include "../../SpiralSound/SpiralInfo.h" +#include // no of calls to handle when dragged, before the widget is redrawn // to allow the wire (connection currently being made) to be redrawn static const int UPDATE_TICKS = 5; +static int Numbers[512]; + //////////////////////////////////////////////////////////////////////// Fl_Canvas::Fl_Canvas(int x, int y, int w, int h, char *name) : Fl_Group(x,y,w,h,name), +m_Menu(NULL), +m_BG(NULL), +m_BGData(NULL), cb_Connection(NULL), cb_Unconnect(NULL), cb_AddDevice(NULL), -m_ToolMenu(false), +m_CanPaste(false), +m_Selecting(false), m_UpdateTimer(0) { m_IncompleteWire.OutputID=-1; @@ -42,30 +50,29 @@ m_IncompleteWire.InputID=-1; m_IncompleteWire.InputPort=-1; m_IncompleteWire.InputTerminal=false; - - m_BG=NULL; - m_BGData=NULL; + for (int n=0; n<512; n++) Numbers[n]=n; } //////////////////////////////////////////////////////////////////////// Fl_Canvas::~Fl_Canvas() { + if (m_Menu) delete m_Menu; } //////////////////////////////////////////////////////////////////////// void Fl_Canvas::draw() -{ +{ Fl_Widget*const* a = array(); - + if (damage() & ~FL_DAMAGE_CHILD) // redraw the entire thing: - { + { if (m_BG) { int X=0,Y=0; while (Ydraw(parent()->x()+X,parent()->y()+Y); @@ -73,8 +80,8 @@ X+=m_BG->w; #else X+=m_BG->w(); -#endif - } +#endif + } #if FL_MAJOR_VERSION == 1 && FL_MINOR_VERSION == 0 Y+=m_BG->h; #else @@ -87,93 +94,271 @@ { draw_box(); } - + // draw minimised modules first - for (int i=children(); i--;) + for (int i=children(); i--;) { Fl_Widget& o = **a++; if (((Fl_DeviceGUI*)&o)->IsMinimised()) { draw_child(o); draw_outside_label(o); + + std::vector::iterator sel = std::find( m_Selection.m_DeviceIds.begin(), m_Selection.m_DeviceIds.end(), ((Fl_DeviceGUI*)&o)->GetID() ); + + if (sel != m_Selection.m_DeviceIds.end()) + { + fl_color(FL_YELLOW); + fl_rect(o.x(), o.y(), o.w(), o.h()); + } } } - + DrawWires(); - + // draw maximised modules on top of everything else Fl_Widget*const* a = array(); - for (int i=children(); i--;) + for (int i=children(); i--;) { Fl_Widget& o = **a++; if (!((Fl_DeviceGUI*)&o)->IsMinimised()) { draw_child(o); draw_outside_label(o); + + std::vector::iterator sel = std::find( m_Selection.m_DeviceIds.begin(), m_Selection.m_DeviceIds.end(), ((Fl_DeviceGUI*)&o)->GetID() ); + + if (sel != m_Selection.m_DeviceIds.end()) + { + fl_color(FL_YELLOW); + fl_rect(o.x(), o.y(), o.w(), o.h()); + } } } } else // only redraw the children that need it: - { + { for (int i=children(); i--;) update_child(**a++); } + DrawSelection(); +} + +//////////////////////////////////////////////////////////////////////// + +void Fl_Canvas::Poll() +{ + // bit of a workaround... + if (UserMakingConnection()) m_UpdateTimer++; + + if (m_UpdateTimer>UPDATE_TICKS) + { + m_UpdateTimer=0; + redraw(); + } +} + +//////////////////////////////////////////////////////////////////////// + +void Fl_Canvas::DrawSelection() +{ + if (m_Selecting) + { + int X, Y, W, H; + + fl_color(FL_YELLOW); + + X = min(m_StartSelectX, m_EndSelectX); + Y = min(m_StartSelectY, m_EndSelectY); + W = max(m_StartSelectX, m_EndSelectX) - X; + H = max(m_StartSelectY, m_EndSelectY) - Y; + + fl_rect(X-1, Y-1, W+2, H+2); + } +} + +bool widget_intersects_rectangle (Fl_Widget* o, int X, int Y, int W, int H) +{ + int src1_x1=o->x(), src1_y1=o->y(); + int src1_x2=o->x()+o->w(), src1_y2=o->y()+o->h(); + + int src2_x1=X, src2_y1=Y; + int src2_x2=X+W, src2_y2=Y+H; + + int width=0, height=0; - if (m_ToolMenu) + if (X < o->x()) + { + src1_x1=X; + src1_y1=Y; + src1_x2=X+W; + src1_y2=Y+H; + + src2_x1=o->x(); + src2_y1=o->y(); + src2_x2=o->w(); + src2_y2=o->h(); + } + + if (src2_x1 < src1_x2) { - int Pos=0,X=0,Y=0,textw,texth; - int DegreesPerItem=30; - float conv=3.151/180.0f; - bool selected=false; - m_Selected=-1; + if (src1_x2 < src2_x2) + width = src1_x2 - src2_x1; + else + width = src2_x2 - src2_x1; + + if (width == 0) + return false; - fl_font(fl_font(),10); - for (vector< pair >::iterator i=m_PluginNameList.begin(); - i!=m_PluginNameList.end(); ++i) - { - textw=0; - fl_font(fl_font(),10); - fl_measure(i->first.c_str(), textw, texth); + if (src2_y1 < src1_y1) + { + int tmp; + + tmp = src2_x1; + src2_x1=src1_x1; + src1_x1=tmp; + + tmp = src2_y1; + src2_y1=src1_y1; + src1_y1=tmp; + + tmp = src2_x2; + src2_x2=src1_x2; + src1_x2=tmp; - X=m_x-(textw/2); - Y=m_y-(m_PluginNameList.size()*5)+Pos*10; - - if (Fl::event_y()>Y-10 && Fl::event_y()X && Fl::event_x()first.c_str(), textw, texth); - X=m_x-(textw/2); - m_Selected=i->second; - selected=true; - } - else selected=false; - - fl_color(FL_GRAY); - - fl_color(FL_WHITE); - fl_draw(i->first.c_str(),X-1,Y+1); + tmp = src2_y2; + src2_y2=src1_y2; + src1_y2=tmp; - if (selected) fl_color(FL_BLUE); - else fl_color(FL_BLACK); + } - fl_draw(i->first.c_str(),X,Y); - - Pos+=1; + if (src2_y1 < src1_y2) + { + if (src1_y2 < src2_y2) + height = src1_y2 - src2_y1; + else + height = src2_y2 - src2_y1; + + if ((height == 0)) + return false; + else + return true; } } + + return false; } -//////////////////////////////////////////////////////////////////////// +void Fl_Canvas::CalculateSelection() +{ + Fl_Widget*const* a = array(); + int X, Y, W, H; -void Fl_Canvas::Poll() + X = min(m_StartSelectX, m_EndSelectX); + Y = min(m_StartSelectY, m_EndSelectY); + W = max(m_StartSelectX, m_EndSelectX) - X; + H = max(m_StartSelectY, m_EndSelectY) - Y; + + m_HaveSelection = false; + m_Selection.Clear(); + + for (int i=0; iGetID()); + ((Fl_DeviceGUI*)&o)->SetOnDragCallback(cb_OnDrag_s, this); + } + } +} + +void Fl_Canvas::DeleteSelection (void) { + if (! m_HaveSelection) return; + // show some warning here + for (unsigned int i=0; ivalue(0); + group->add(m_Menu); + Fl_Menu_Item *cut=(Fl_Menu_Item*)&(m_Menu->menu()[1]); + Fl_Menu_Item *copy=(Fl_Menu_Item*)&(m_Menu->menu()[2]); + Fl_Menu_Item *paste=(Fl_Menu_Item*)&(m_Menu->menu()[3]); + Fl_Menu_Item *merge=(Fl_Menu_Item*)&(m_Menu->menu()[4]); + Fl_Menu_Item *deleteitems=(Fl_Menu_Item*)&(m_Menu->menu()[5]); + if ((cb_CopyDeviceGroup) && (m_HaveSelection)) copy->activate(); else copy->deactivate(); + if ((cb_CutDeviceGroup) && (m_HaveSelection)) cut->activate(); else cut->deactivate(); + if ((cb_PasteDeviceGroup) && (m_CanPaste)) paste->activate(); else paste->deactivate(); + if (m_HaveSelection) deleteitems->activate(); else deleteitems->deactivate(); + m_Menu->popup(); + group->remove(m_Menu); +} + +void Fl_Canvas::AddPluginName (const string &s, int ID) { + // There's a bug here, that there's no menu at all if no plugins are found + // This isn't IMMEDIATELY important, as if you've no plugins - there's nothing to copy/paste/etc anyway. + if (! (m_Menu)) { + m_Menu = new Fl_Menu_Button (0, 0, 4, 4, NULL); + m_Menu->type (Fl_Menu_Button::POPUP123); + m_Menu->textsize (10); + m_Menu->add ("Edit/Cut Currently Selected Devices", 0, (Fl_Callback*)cb_CutDeviceGroup, user_data()); + m_Menu->add ("Edit/Copy Currently Selected Devices", 0, (Fl_Callback*)cb_CopyDeviceGroup, user_data()); + m_Menu->add ("Edit/Paste Previously Copied Devices", 0, (Fl_Callback*)cb_PasteDeviceGroup, user_data(), FL_MENU_DIVIDER); + m_Menu->add ("Edit/Merge Existing Patch", 0, (Fl_Callback*)cb_MergePatch, user_data(), FL_MENU_DIVIDER); + m_Menu->add ("Edit/Delete Currently Selected Devices", 0, (Fl_Callback*)cb_DeleteDeviceGroup, this); + } + m_Menu->add (s.c_str(), 0, (Fl_Callback*)cb_AddDeviceFromMenu, &Numbers[ID]); +} + +void Fl_Canvas::StreamSelectionWiresIn(istream &s, std::map NewDeviceIds, bool merge, bool paste) { - // bit of a workaround... - if (UserMakingConnection()) m_UpdateTimer++; - - if (m_UpdateTimer>UPDATE_TICKS) + MapNewDeviceIds = NewDeviceIds; + StreamWiresIn(s, merge, paste); +} + +void Fl_Canvas::StreamSelectionWiresOut(ostream &s) +{ + int total_wires = 0, curpos=0; + + curpos = s.tellp(); + + s<<-1<0) + for(vector::iterator i=m_WireVec.begin(); + i!=m_WireVec.end(); i++) + { + std::vector::iterator output = std::find( m_Selection.m_DeviceIds.begin(), m_Selection.m_DeviceIds.end(), i->OutputID ); + std::vector::iterator input = std::find( m_Selection.m_DeviceIds.begin(), m_Selection.m_DeviceIds.end(), i->InputID ); + + if ((input != m_Selection.m_DeviceIds.end()) && (output != m_Selection.m_DeviceIds.end())) + { + s<OutputID<<" "; + s<<0<<" "; + s<OutputPort<<" "; + s<OutputTerminal<<" "; + s<InputID<<" "; + s<<0<<" "; + s<InputPort<<" "; + s<InputTerminal<= 1) { - m_UpdateTimer=0; - redraw(); + s.seekp(curpos, ios::beg); + s<::iterator i=m_WireVec.begin(); i!=m_WireVec.end(); i++) - { + { Fl_DeviceGUI* SourceDevice = FindDevice(i->OutputID); Fl_DeviceGUI* DestDevice = FindDevice(i->InputID); - - if (!SourceDevice || !DestDevice) + + if (!SourceDevice || !DestDevice) { SpiralInfo::Alert("Cant find source or dest device while drawing wires"); return; @@ -202,15 +389,52 @@ case 4: col = (Fl_Color) WIRE_COL4; break; default: col = (Fl_Color) WIRE_COL0; } - fl_color(col); + fl_color(col); + +#ifdef NTK_MAJOR_VERSION + fl_color( fl_color_add_alpha( fl_color(), 127 ) ); +#endif - fl_line(SourceDevice->GetPortX(i->OutputPort+SourceDevice->GetInfo()->NumInputs), - SourceDevice->GetPortY(i->OutputPort+SourceDevice->GetInfo()->NumInputs), - DestDevice->GetPortX(i->InputPort), - DestDevice->GetPortY(i->InputPort)); + double ep1_x, ep1_y, ep2_x, ep2_y, + ep1_mix_x, + ep1_new_x, + ep1_mid_x, + ep2_mid_x, + ep2_new_x, + ep1_mid_y, + ep2_mid_y; + + ep1_x = SourceDevice->GetPortX(i->OutputPort+SourceDevice->GetInfo()->NumInputs); + + ep1_y = SourceDevice->GetPortY(i->OutputPort+SourceDevice->GetInfo()->NumInputs); + ep1_mid_y = ep1_y + 7.5; + + + ep2_x = DestDevice->GetPortX(i->InputPort); + ep2_y = DestDevice->GetPortY(i->InputPort); + ep2_mid_y = 7.5 + ep2_y; + + ep1_mid_x = fabs(ep1_x-ep2_x)/2; + ep1_new_x = ep1_x+ep1_mid_x; + + ep2_mid_x = fabs(ep1_x-ep2_x)/2; + ep2_new_x = ep2_x-ep2_mid_x; + + fl_begin_line(); + + fl_curve( ep1_x, ep1_y, ep1_new_x, ep1_mid_y, ep2_new_x, ep2_mid_y, ep2_x, ep2_y ); + + fl_end_line(); + + /* fl_line(SourceDevice->GetPortX(i->OutputPort+SourceDevice->GetInfo()->NumInputs), */ + /* SourceDevice->GetPortY(i->OutputPort+SourceDevice->GetInfo()->NumInputs), */ + /* DestDevice->GetPortX(i->InputPort), */ + /* DestDevice->GetPortY(i->InputPort)); */ } - + DrawIncompleteWire(); + + fl_line_style( FL_SOLID, 0 ); } //////////////////////////////////////////////////////////////////////// @@ -223,19 +447,19 @@ //////////////////////////////////////////////////////////////////////// void Fl_Canvas::DrawIncompleteWire() -{ +{ // draw the wire we are currently connecting if(m_IncompleteWire.InputID!=-1) { Fl_DeviceGUI* Device = FindDevice(m_IncompleteWire.InputID); - - if (!Device) + + if (!Device) { SpiralInfo::Alert("Cant find source or dest device while drawing wires"); return; } - - + + Fl_Color col = (Fl_Color) WIRE_COL0; switch (Device->GetPortType(m_IncompleteWire.InputPort)) { case 0: col = (Fl_Color) WIRE_COL0; break; @@ -250,20 +474,20 @@ fl_line(Device->GetPortX(m_IncompleteWire.InputPort), Device->GetPortY(m_IncompleteWire.InputPort), Fl::event_x(), - Fl::event_y()); + Fl::event_y()); } - + if(m_IncompleteWire.OutputID!=-1) { Fl_DeviceGUI* Device = FindDevice(m_IncompleteWire.OutputID); - - if (!Device) + + if (!Device) { SpiralInfo::Alert("Cant find source or dest device while drawing wires"); return; } - - + + Fl_Color col = (Fl_Color) WIRE_COL0; switch (Device->GetPortType(m_IncompleteWire.OutputPort+Device->GetInfo()->NumInputs)) { case 0: col = (Fl_Color) WIRE_COL0; break; @@ -278,7 +502,7 @@ fl_line(Device->GetPortX(m_IncompleteWire.OutputPort+Device->GetInfo()->NumInputs), Device->GetPortY(m_IncompleteWire.OutputPort+Device->GetInfo()->NumInputs), Fl::event_x(), - Fl::event_y()); + Fl::event_y()); } } @@ -291,7 +515,7 @@ { FindDevice(m_IncompleteWire.OutputID)->RemoveConnection(m_IncompleteWire.OutputPort+FindDevice(m_IncompleteWire.OutputID)->GetInfo()->NumInputs); } - + if (m_IncompleteWire.InputID!=-1) { FindDevice(m_IncompleteWire.InputID)->RemoveConnection(m_IncompleteWire.InputPort); @@ -300,55 +524,150 @@ } //////////////////////////////////////////////////////////////////////// +// Event handlers for the canvas and the deviceGUIs -int Fl_Canvas::handle(int event) -{ - if (Fl_Group::handle(event)) return 1; - - if (event==FL_PUSH) - { - ClearIncompleteWire(); - redraw(); - m_DragX=Fl::event_x(); - m_DragY=Fl::event_y(); - } - - if (Fl::event_button()==1 && event==FL_DRAG) - { - position(x()+(Fl::event_x()-m_DragX),y()+(Fl::event_y()-m_DragY)); - m_DragX=Fl::event_x(); - m_DragY=Fl::event_y(); - redraw(); - } - - if (Fl::event_button()==2) - { - if (event==FL_PUSH) - { - m_ToolMenu=true; - m_x=Fl::event_x(); - m_y=Fl::event_y(); - redraw(); - } - - if (event==FL_DRAG) redraw(); - - if (event==FL_RELEASE) - { - m_ToolMenu=false; - if (m_Selected!=-1 && cb_AddDevice) - { - int args[3]; - args[0]=m_Selected; - args[1]=m_x; - args[2]=m_y; - cb_AddDevice(this,args); - } - redraw(); - } - } +int Fl_Canvas::handle (int event) { + if (Fl_Group::handle (event)) return 1; + if (event==FL_PUSH) { + ClearIncompleteWire(); + redraw(); + m_DragX=Fl::event_x(); + m_DragY=Fl::event_y(); + } + if ((Fl::event_button() == 1) && ((Fl::event_state() & FL_SHIFT) == 0) && ((Fl::event_state() & FL_CTRL) == 0)) { + // Left-Click (or plain click for those who are mouse-button challenged) + // Select / Multi-select / move devices + // Handled below - If on a non-selected plugin, deselect and move + // Handled below - If on a selected plugin, move selection + // Handled Here - If on canvas - multi select + if (event==FL_PUSH) { + if (m_HaveSelection) { + m_Selection.Clear(); + m_HaveSelection = false; + } + m_Selecting = true; + m_StartSelectX=Fl::event_x(); + m_StartSelectY=Fl::event_y(); + m_EndSelectX=Fl::event_x(); + m_EndSelectY=Fl::event_y(); + ClearIncompleteWire(); + redraw(); + m_DragX=Fl::event_x(); + m_DragY=Fl::event_y(); + } + if ((event==FL_DRAG) && m_Selecting) { + m_EndSelectX = Fl::event_x(); + m_EndSelectY = Fl::event_y(); + Fl_Scroll* scroll = (Fl_Scroll *)parent(); + int newx = 0, xp = scroll->xposition(); + int newy = 0, yp = scroll->yposition(); + if ((m_EndSelectX < m_StartSelectX) && ((m_EndSelectX - x() - xp) <= 15)) + newx = 10; + if ((m_EndSelectY < m_StartSelectY) && ((m_EndSelectY - y() - yp) <= 15)) + newy = 10; + if ((m_EndSelectX > m_StartSelectX) && ((scroll->x() + scroll->w() - m_EndSelectX - 15) <= 15)) + newx = -10; + if ((m_EndSelectY > m_StartSelectY) && ((scroll->y() + scroll->h() - m_EndSelectY - 15) <= 5)) + newy = -10; + if ((newx!=0) || (newy!=0)) { + position(x()+newx,y()+newy); + m_StartSelectX += newx; + m_StartSelectY += newy; + } + m_DragX=Fl::event_x(); + m_DragY=Fl::event_y(); + redraw(); + } + if ((event==FL_RELEASE) && m_Selecting) { + m_Selecting = false; + if ((m_EndSelectX != m_StartSelectX) && (m_EndSelectY != m_StartSelectY)) + CalculateSelection(); + redraw(); + } + } + if ((Fl::event_button() == 2) || ((Fl::event_button() == 1) && ((Fl::event_state() & FL_SHIFT) != 0))) { + // Middle-Click (or shift-click for the mouse button challenged) - old left click + // Handled Below - If on items allows selecting of individual items + // Handled Here - If on canvas, drags canvas + if (event==FL_PUSH) { + ClearIncompleteWire(); + redraw(); + m_DragX=Fl::event_x(); + m_DragY=Fl::event_y(); + } + if (event==FL_DRAG) { + position (x() + (Fl::event_x() - m_DragX), y() + (Fl::event_y() - m_DragY)); + m_DragX=Fl::event_x(); + m_DragY=Fl::event_y(); + redraw(); + } + } + if ((Fl::event_button() == 3) || ((Fl::event_button() == 1) && ((Fl::event_state() & FL_CTRL) != 0))) { + // Right-Click (or Ctrl-click for the M.B.C.) + // Pop-up Edit/Plugins menu + if (event==FL_PUSH) { + m_x=Fl::event_x(); + m_y=Fl::event_y(); + PopupEditMenu (this); + } + } + return 1; +} + +void Fl_Canvas::cb_OnDrag_s (Fl_Widget* widget, int x, int y, void* data) { + ((Fl_Canvas *)data)->cb_OnDrag_i (widget, x, y); +} - return 1; +inline void Fl_Canvas::cb_OnDrag_i (Fl_Widget* widget, int xoffset, int yoffset) { + if ((widget) && (widget->parent())) { + int moved_device_id = ((Fl_DeviceGUI*)(widget->parent()))->GetID(); + if (m_HaveSelection) { + if (m_Selection.m_DeviceIds.size() <= 0) + m_HaveSelection = false; + for (unsigned int i=0; iposition (o->x() + xoffset, o->y() + yoffset); + } + } + } + } + return; +} + +void Fl_Canvas::cb_OnDragClick_s (Fl_Widget* widget, int button, int shift_state, void* data) { + ((Fl_Canvas *)data)->cb_OnDragClick_i (widget, button, shift_state); +} + +inline void Fl_Canvas::cb_OnDragClick_i(Fl_Widget* widget, int button,int shift_state) { + // this bit seems to be unnecessary - andy preston + // if ((button==3) && ((shift_state & FL_CTRL) != 0)) { + // PopupEditMenu(widget->parent()); + // } + if ((widget) && (button==1)) { + int ID = ((Fl_DeviceGUI*)(widget->parent()))->GetID(); + std::vector::iterator device_iter = std::find(m_Selection.m_DeviceIds.begin(), m_Selection.m_DeviceIds.end(), ID); + if (((shift_state & FL_SHIFT) != 0) || ((shift_state & FL_CTRL) != 0)) { + if (m_HaveSelection) { + if (device_iter != m_Selection.m_DeviceIds.end()) + m_Selection.m_DeviceIds.erase(device_iter); + else + m_Selection.m_DeviceIds.push_back(ID); + } + else { + m_Selection.Clear(); + m_HaveSelection = true; + m_Selection.m_DeviceIds.push_back(ID); + } + } + else { + m_Selection.Clear(); + m_HaveSelection = true; + m_Selection.m_DeviceIds.push_back(ID); + } + redraw(); + } } //////////////////////////////////////////////////////////////////////// @@ -363,7 +682,7 @@ { // make sure we don't make a output->output connection if (m_IncompleteWire.OutputID==-1) - { + { m_IncompleteWire.OutputPort=Port; m_IncompleteWire.OutputID=Device->GetID(); m_IncompleteWire.OutputTerminal=Device->IsTerminal(); @@ -376,8 +695,8 @@ else { // make sure we don't make a input->input connection - if (m_IncompleteWire.InputID==-1) - { + if (m_IncompleteWire.InputID==-1) + { m_IncompleteWire.InputPort=Port; m_IncompleteWire.InputID=Device->GetID(); m_IncompleteWire.InputTerminal=Device->IsTerminal(); @@ -391,35 +710,35 @@ // if both have now been set... if (m_IncompleteWire.InputID!=-1 && m_IncompleteWire.OutputID!=-1) { - m_WireVec.push_back(m_IncompleteWire); - + m_WireVec.push_back(m_IncompleteWire); + // send the connect callback cb_Connection(this,(void*)&m_IncompleteWire); m_Graph.AddConnection(m_IncompleteWire.OutputID,m_IncompleteWire.OutputTerminal, m_IncompleteWire.InputID,m_IncompleteWire.InputTerminal); - + // Turn on both ports Fl_DeviceGUI* ODGUI = FindDevice(m_IncompleteWire.OutputID); ODGUI->AddConnection(m_IncompleteWire.OutputPort+ODGUI->GetInfo()->NumInputs); - + Fl_DeviceGUI* IDGUI = FindDevice(m_IncompleteWire.InputID); IDGUI->AddConnection(m_IncompleteWire.InputPort); - + m_IncompleteWire.Clear(); - + redraw(); } } } else // Turned off the port - { + { // Find connections using this port bool Found=true; - + while (Found) { Found=false; - + for(vector::iterator i=m_WireVec.begin(); i!=m_WireVec.end(); i++) { @@ -429,26 +748,26 @@ // Turn off both ports Fl_DeviceGUI* ODGUI = FindDevice(i->OutputID); ODGUI->RemoveConnection(i->OutputPort+ODGUI->GetInfo()->NumInputs); - + Fl_DeviceGUI* IDGUI = FindDevice(i->InputID); IDGUI->RemoveConnection(i->InputPort); - - // send the unconnect callback + + // send the unconnect callback cb_Unconnect(this,(void*)&(*i)); - m_Graph.RemoveConnection(i->OutputID,i->InputID); + m_Graph.RemoveConnection(i->OutputID,i->InputID); // Remove the wire m_WireVec.erase(i); - + Found=true; break; } } } - + redraw(); - - // Clear the current selection + + // Clear the current m_Selection m_IncompleteWire.Clear(); } } @@ -458,21 +777,21 @@ void Fl_Canvas::ClearConnections(Fl_DeviceGUI* Device) { bool removedall=false; - + //make sure we don't leave a dangling incomplete wire this will cause errors/seg-faults - if (UserMakingConnection() && Device && ((Device->GetID() == m_IncompleteWire.OutputID) || + if (UserMakingConnection() && Device && ((Device->GetID() == m_IncompleteWire.OutputID) || (Device->GetID() == m_IncompleteWire.InputID))) { ClearIncompleteWire(); - } - + } + while (!removedall) { removedall=true; - + for (vector::iterator i=m_WireVec.begin(); i!=m_WireVec.end(); i++) - { + { if (i->OutputID==Device->GetID() || i->InputID==Device->GetID()) { @@ -483,7 +802,7 @@ // send the unconnect callback cb_Unconnect(this,(void*)&(*i)); m_Graph.RemoveConnection(i->OutputID,i->InputID); - + m_WireVec.erase(i); removedall=false; break; @@ -493,29 +812,29 @@ } //////////////////////////////////////////////////////////////////////// - + void Fl_Canvas::RemoveDevice(Fl_DeviceGUI* Device) { ClearConnections(Device); remove(Device); - redraw(); + redraw(); } //////////////////////////////////////////////////////////////////////// - -void Fl_Canvas::Clear() -{ + +void Fl_Canvas::Clear() +{ m_Graph.Clear(); int kids=children(); for(int n=0; np) // after the widget in the list - { + { // move the widgets up a[n-1]=a[n]; } } - + a[children()-1]=o; // put the raised one at the top of the list } void Fl_Canvas::ToBot(Fl_DeviceGUI *o) { if (children()<2) return; //no need to do anything - + // cast away the const :P Fl_Widget** a=(Fl_Widget**)array(); int p=find(o); - if (p<0) + if (p<0) { cerr<<"ToBot couldn't find widget!"<>(istream &s, Fl_Canvas &o) + +void Fl_Canvas::StreamWiresIn(istream &s, bool merge, bool paste) { int NumWires; + s>>NumWires; - + // my bad, didn't version this stream - remove one day... - if (NumWires==-1) + if (paste || NumWires==-1) { int version; - s>>version; - s>>NumWires; - + + if (!paste) + { + s>>version; + s>>NumWires; + } + for(int n=0; n>NewWire.OutputID; s>>dummy; s>>NewWire.OutputPort; s>>NewWire.OutputTerminal; s>>NewWire.InputID; s>>dummy; - s>>NewWire.InputPort; + s>>NewWire.InputPort; s>>NewWire.InputTerminal; - - // if we can turn on both ports - if (o.FindDevice(NewWire.OutputID)->AddConnection(NewWire.OutputPort+ - o.FindDevice(NewWire.OutputID)->GetInfo()->NumInputs) && - o.FindDevice(NewWire.InputID)->AddConnection(NewWire.InputPort)) + + if (paste || merge) { - o.m_WireVec.push_back(NewWire); + std::map::iterator inputID = MapNewDeviceIds.find( NewWire.InputID); + std::map::iterator outputID = MapNewDeviceIds.find(NewWire.OutputID); - // Notify connection by callback - o.cb_Connection(&o,(void*)&NewWire); - o.m_Graph.AddConnection(NewWire.OutputID,NewWire.OutputTerminal,NewWire.InputID,NewWire.InputTerminal); - } + if ((inputID != MapNewDeviceIds.end()) && (outputID != MapNewDeviceIds.end())) + { + NewWire.InputID = inputID->second; + NewWire.OutputID = outputID->second; + } + } + // if we can turn on both ports + if (FindDevice(NewWire.OutputID)->AddConnection(NewWire.OutputPort+ + FindDevice(NewWire.OutputID)->GetInfo()->NumInputs) && + FindDevice(NewWire.InputID)->AddConnection(NewWire.InputPort)) + { + m_WireVec.push_back(NewWire); + // Notify connection by callback + cb_Connection(this,(void*)&NewWire); + m_Graph.AddConnection(NewWire.OutputID,NewWire.OutputTerminal,NewWire.InputID,NewWire.InputTerminal); + } } - } else - { + { for(int n=0; n>NewWire.OutputID; s>>dummy; s>>NewWire.OutputPort; s>>NewWire.InputID; s>>dummy; - s>>NewWire.InputPort; - + s>>NewWire.InputPort; + + if (paste || merge) + { + std::map::iterator inputID = MapNewDeviceIds.find( NewWire.InputID); + std::map::iterator outputID = MapNewDeviceIds.find(NewWire.OutputID); + + if ((inputID != MapNewDeviceIds.end()) && (outputID != MapNewDeviceIds.end())) + { + NewWire.InputID = inputID->second; + NewWire.OutputID = outputID->second; + } + } + // if we can turn on both ports - if (o.FindDevice(NewWire.OutputID)->AddConnection(NewWire.OutputPort+ - o.FindDevice(NewWire.OutputID)->GetInfo()->NumInputs) && - o.FindDevice(NewWire.InputID)->AddConnection(NewWire.InputPort)) + if (FindDevice(NewWire.OutputID)->AddConnection(NewWire.OutputPort+ + FindDevice(NewWire.OutputID)->GetInfo()->NumInputs) && + FindDevice(NewWire.InputID)->AddConnection(NewWire.InputPort)) { - o.m_WireVec.push_back(NewWire); + m_WireVec.push_back(NewWire); // Notify connection by callback - o.cb_Connection(&o,(void*)&NewWire); - o.m_Graph.AddConnection(NewWire.OutputID,false,NewWire.InputID,false); - } + cb_Connection(this,(void*)&NewWire); + m_Graph.AddConnection(NewWire.OutputID,false,NewWire.InputID,false); + } } - } - return s; + } +} + + +void Fl_Canvas::cb_DeleteDeviceGroup (Fl_Widget* widget, void* data) { + ((Fl_Canvas *)data)->cb_DeleteDeviceGroup_i(); +} + +inline void Fl_Canvas::cb_DeleteDeviceGroup_i() { + DeleteSelection (); +} + +void Fl_Canvas::cb_AddDeviceFromMenu (Fl_Widget* widget, void* data) { + ((Fl_Canvas *)widget->parent())->cb_AddDeviceFromMenu_i (widget, data); +} + +inline void Fl_Canvas::cb_AddDeviceFromMenu_i (Fl_Widget* widget, void* data) { + if (cb_AddDevice) { + int args[3]; + args[0]=*(int*)data; + args[1]=m_x; + args[2]=m_y; + cb_AddDevice (this, args); + } } //////////////////////////////////////////////////////////////////////// +istream &operator>>(istream &s, Fl_Canvas &o) +{ + o.StreamWiresIn(s, false, false); + return s; +} + ostream &operator<<(ostream &s, Fl_Canvas &o) { int version=0; s<<-1<<" "<::iterator i=o.m_WireVec.begin(); @@ -692,7 +1065,7 @@ s<OutputTerminal<<" "; s<InputID<<" "; s<<0<<" "; - s<InputPort<<" "; + s<InputPort<<" "; s<InputTerminal< #include #include +#include #include #include #include "../../GraphSort.h" +#include "Fl_DeviceGUI.h" #ifndef CANVAS_WIDGET #define CANVAS_WIDGET @@ -34,8 +36,8 @@ { public: CanvasWire() { Clear(); } - - void Clear() + + void Clear() { OutputPort=-1; OutputID=-1; @@ -55,14 +57,30 @@ bool DelMe; }; +class CanvasGroup +{ +public: + CanvasGroup() { Clear(); } + + void Clear() + { + m_DeviceIds.clear(); + } + + vector m_DeviceIds; +}; + class Fl_Canvas : public Fl_Group { public: Fl_Canvas(int x, int y, int w, int h, char *name); ~Fl_Canvas(); - + Fl_Menu_Button *m_Menu; + virtual void draw(); virtual int handle(int event); + int globalhandle(int event); + void PortClicked(Fl_DeviceGUI* Device, int Type, int Port, bool Value); void Rename(Fl_DeviceGUI* Device); @@ -70,48 +88,98 @@ void SetUnconnectCallback(Fl_Callback* s) { cb_Unconnect=s; } void SetAddDeviceCallback(Fl_Callback* s) { cb_AddDevice=s; } void SetRenameCallback(Fl_Callback* s) { cb_Rename=s; } - + void SetCutDeviceGroupCallback(Fl_Callback* s) { cb_CutDeviceGroup=s; } + void SetCopyDeviceGroupCallback(Fl_Callback* s) { cb_CopyDeviceGroup=s; } + void SetPasteDeviceGroupCallback(Fl_Callback* s) { cb_PasteDeviceGroup=s; } + void SetMergePatchCallback (Fl_Callback* s) { cb_MergePatch=s; } + + void DeleteSelection (void); void ClearConnections(Fl_DeviceGUI* Device); void RemoveDevice(Fl_DeviceGUI* Device); void Clear(); - void AddPluginName(const string &s, int ID) - { m_PluginNameList.push_back(pair(s,ID)); } - GraphSort* GetGraph() { return &m_Graph; } - + void AddPluginName(const string &s, int ID); + + GraphSort* GetGraph() { return &m_Graph; } + void Poll(); void ToTop(Fl_DeviceGUI *o); void ToBot(Fl_DeviceGUI *o); -private: + void StreamSelectionWiresIn(istream &s, map NewDeviceIds, bool merge, bool paste); + void StreamSelectionWiresOut(ostream &s); + + void StreamWiresIn(istream &s, bool merge, bool paste); + static void AppendSelection(int DeviceId, Fl_Canvas *data) + { + Fl_DeviceGUI *o = data->FindDevice(DeviceId); + if (o) + { + data->m_HaveSelection = true; + data->m_Selection.m_DeviceIds.push_back(DeviceId); + o->SetOnDragCallback(Fl_Canvas::cb_OnDrag_s, data); + data->redraw(); + } + } + + + static void ClearSelection(Fl_Canvas *data) + { + data->m_HaveSelection=false; + data->m_Selection.Clear(); + data->redraw(); + } + + static void EnablePaste(Fl_Canvas *data) { data->m_CanPaste=true; } + + bool HaveSelection() {return m_HaveSelection; } + CanvasGroup Selection() { return m_Selection; } + + static void SetDeviceCallbacks(Fl_DeviceGUI *device, Fl_Canvas *data) + { + device->SetOnDragCallback(Fl_Canvas::cb_OnDrag_s, data); + device->SetOnClickCallback(Fl_Canvas::cb_OnDragClick_s, data); + } + +private: + void PopupEditMenu (Fl_Group *group); + void DrawSelection(); + void CalculateSelection(); void DrawWires(); void ClearIncompleteWire(); void DrawIncompleteWire(); bool UserMakingConnection(); Fl_DeviceGUI *FindDevice(int ID); - - Fl_Image *m_BG; - char *m_BGData; - + Fl_Image *m_BG; + char *m_BGData; void (*cb_Connection)(Fl_Widget*, void*); void (*cb_Unconnect)(Fl_Widget*, void*); void (*cb_AddDevice)(Fl_Widget*, void*); void (*cb_Rename)(Fl_Widget*, void*); - + void (*cb_CutDeviceGroup)(Fl_Widget*, void*); + void (*cb_CopyDeviceGroup)(Fl_Widget*, void*); + void (*cb_PasteDeviceGroup)(Fl_Widget*, void*); + void (*cb_MergePatch)(Fl_Widget*, void*); + map MapNewDeviceIds; vector m_WireVec; - CanvasWire m_IncompleteWire; - - bool m_ToolMenu, m_ButtonDown; - int m_x,m_y,m_Selected; - vector< pair > m_PluginNameList; - + CanvasWire m_IncompleteWire; GraphSort m_Graph; - int m_UpdateTimer; - int m_DragX,m_DragY; - + CanvasGroup m_Selection; + bool m_CanPaste, m_HaveSelection, m_Selecting; + int m_x, m_y, m_UpdateTimer, m_DragX, m_DragY; + int m_StartSelectX, m_StartSelectY, m_EndSelectX,m_EndSelectY; friend istream &operator>>(istream &s, Fl_Canvas &o); - friend ostream &operator<<(ostream &s, Fl_Canvas &o); + friend ostream &operator<<(ostream &s, Fl_Canvas &o); + // Callbacks + static void cb_OnDrag_s (Fl_Widget* widget, int x, int y, void* data); + inline void cb_OnDrag_i (Fl_Widget* widget, int x,int y); + static void cb_OnDragClick_s (Fl_Widget* widget, int button, int shift_state, void* data); + inline void cb_OnDragClick_i(Fl_Widget* widget, int button,int shift_state); + static void cb_DeleteDeviceGroup (Fl_Widget* widget, void* data); + inline void cb_DeleteDeviceGroup_i(); + static void cb_AddDeviceFromMenu (Fl_Widget* widget, void* data); + inline void cb_AddDeviceFromMenu_i (Fl_Widget* widget, void* data); }; istream &operator>>(istream &s, Fl_Canvas &o); diff -Nru spiralsynthmodular-0.2.2a/GUI/Widgets/Fl_DeviceGUI.C spiralsynthmodular-0.2.3+git20140329/GUI/Widgets/Fl_DeviceGUI.C --- spiralsynthmodular-0.2.2a/GUI/Widgets/Fl_DeviceGUI.C 2004-02-08 18:36:17.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/GUI/Widgets/Fl_DeviceGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -141,6 +141,7 @@ Minimise(); if (m_IconButton) m_IconButton->show(); } + return 1; } diff -Nru spiralsynthmodular-0.2.2a/GUI/Widgets/Fl_DeviceGUI.h spiralsynthmodular-0.2.3+git20140329/GUI/Widgets/Fl_DeviceGUI.h --- spiralsynthmodular-0.2.2a/GUI/Widgets/Fl_DeviceGUI.h 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/GUI/Widgets/Fl_DeviceGUI.h 2012-05-31 04:13:57.000000000 +0000 @@ -104,6 +104,10 @@ int GetPortType (int n) { return m_Info.PortTypes[n]; } // do we belong to a plugin that is an output? bool IsTerminal() { return m_IsTerminal; } + + void SetOnDragCallback(void (*cb)(Fl_Widget*, int x,int y, void*), void* data) { m_DragBar->cb_OnDrag = cb; m_DragBar->cb_OnDrag_Data = data; } + void SetOnClickCallback(void (*cb)(Fl_Widget*, int button, int shift_state, void*), void* data) { m_DragBar->cb_OnClick = cb; m_DragBar->cb_OnClick_Data = data; } + static void Kill(Fl_DeviceGUI *device) { if (device) device->m_DelMe = true; } protected: DeviceGUIInfo m_Info; Fl_DragBar* m_DragBar; diff -Nru spiralsynthmodular-0.2.2a/GUI/Widgets/Fl_DragBar.cxx spiralsynthmodular-0.2.3+git20140329/GUI/Widgets/Fl_DragBar.cxx --- spiralsynthmodular-0.2.2a/GUI/Widgets/Fl_DragBar.cxx 2002-07-28 23:18:14.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/GUI/Widgets/Fl_DragBar.cxx 2012-05-31 04:13:57.000000000 +0000 @@ -3,7 +3,11 @@ #include "Fl_DragBar.H" #include -Fl_DragBar::Fl_DragBar(int x,int y,int w,int h,const char *l): Fl_Widget(x,y,w,h,l) { +Fl_DragBar::Fl_DragBar(int x,int y,int w,int h,const char *l): +Fl_Widget(x,y,w,h,l), +cb_OnDrag(NULL), +cb_OnDrag_Data(NULL) +{ _type = Fl_DragBar::NICEFLDRAG; } @@ -119,6 +123,12 @@ { fl_cursor(FL_CURSOR_DEFAULT); do_callback(); + + if ((Fl::event_is_click()) && (cb_OnClick)) + { + cb_OnClick(this, Fl::event_button(), Fl::event_state(), cb_OnClick_Data); + } + return 1; } case FL_DRAG: @@ -129,11 +139,30 @@ yy = ry - old_ry; if (_type < (int)Fl_DragBar::FLDRAG) { + if (cb_OnDrag) { + int xoffset, yoffset; + + xoffset = (rx - window()->x()) - old_rx; + yoffset = (ry - window()->y()) - old_ry; + + cb_OnDrag(this, xoffset, yoffset, cb_OnDrag_Data); + } + window()->position(xx,yy); } else { + if (cb_OnDrag) { + int xoffset, yoffset; + + xoffset = (rx - parent()->x()) - old_rx; + yoffset = (ry - parent()->y()) - old_ry; + + cb_OnDrag(this, xoffset, yoffset, cb_OnDrag_Data); + } + parent()->position(xx,yy); + if (parent()->parent()) parent()->parent()->redraw(); else diff -Nru spiralsynthmodular-0.2.2a/GUI/Widgets/Fl_DragBar.fld spiralsynthmodular-0.2.3+git20140329/GUI/Widgets/Fl_DragBar.fld --- spiralsynthmodular-0.2.2a/GUI/Widgets/Fl_DragBar.fld 2002-07-28 23:18:14.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/GUI/Widgets/Fl_DragBar.fld 2012-05-31 04:13:57.000000000 +0000 @@ -18,9 +18,16 @@ } { decl {int old_rx,old_ry;} {} decl {int _type;} {} + decl {void (*cb_OnDrag)(Fl_Widget*, int xoffset,int yoffset, void*);} {public} + decl {void *cb_OnDrag_Data;} {public} + decl {void (*cb_OnClick)(Fl_Widget*, int button, int shift_state, void*);} {public} + decl {void *cb_OnClick_Data;} {public} decl {enum DragType {WINDRAG=0,NICEWINDRAG,FLDRAG,NICEFLDRAG};} {public } - Function {Fl_DragBar(int x,int y,int w,int h,const char *l=0): Fl_Widget(x,y,w,h,l)} {open + Function {Fl_DragBar(int x,int y,int w,int h,const char *l=0): Fl_Widget(x,y,w,h,l), +cb_OnDrag(NULL), +cb_OnDrag_Data(NULL) +} {open } { code {_type = Fl_DragBar::NICEFLDRAG;} {} } @@ -133,6 +140,10 @@ { fl_cursor(FL_CURSOR_DEFAULT); do_callback(); + if (((Fl::event_is_click()) && (cb_OnClick)) + { + cb_OnClick(this, cb_OnClick_Data); + } return 1; } case FL_DRAG: @@ -141,13 +152,33 @@ { xx = rx - old_rx; yy = ry - old_ry; + if (_type < (int)Fl_DragBar::FLDRAG) { + if (cb_OnDrag) { + int xoffset, yoffset; + + xoffset = (rx - window()->x()) - old_rx; + yoffset = (ry - window()->y()) - old_ry; + + cb_OnDrag(this, xoffset, yoffset, cb_OnDrag_Data); + } + window()->position(xx,yy); } else { + if (cb_OnDrag) { + int xoffset, yoffset; + + xoffset = (rx - parent()->x()) - old_rx; + yoffset = (ry - parent()->y()) - old_ry; + + cb_OnDrag(this, xoffset, yoffset, cb_OnDrag_Data); + } + parent()->position(xx,yy); + if (parent()->parent()) parent()->parent()->redraw(); else diff -Nru spiralsynthmodular-0.2.2a/GUI/Widgets/Fl_DragBar.H spiralsynthmodular-0.2.3+git20140329/GUI/Widgets/Fl_DragBar.H --- spiralsynthmodular-0.2.2a/GUI/Widgets/Fl_DragBar.H 2002-07-28 23:18:14.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/GUI/Widgets/Fl_DragBar.H 2012-05-31 04:13:57.000000000 +0000 @@ -11,9 +11,16 @@ int old_rx,old_ry; int _type; public: - enum DragType {WINDRAG=0,NICEWINDRAG,FLDRAG,NICEFLDRAG}; Fl_DragBar(int x,int y,int w,int h,const char *l=0); ~Fl_DragBar(); + + enum DragType {WINDRAG=0,NICEWINDRAG,FLDRAG,NICEFLDRAG}; + + void (*cb_OnClick)(Fl_Widget*, int button, int shift_state, void*); + void *cb_OnClick_Data; + + void (*cb_OnDrag)(Fl_Widget*, int xoffset,int yoffset, void*); + void *cb_OnDrag_Data; private: void draw(); int handle(int event); diff -Nru spiralsynthmodular-0.2.2a/main.cpp spiralsynthmodular-0.2.3+git20140329/main.cpp --- spiralsynthmodular-0.2.2a/main.cpp 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/main.cpp 2012-05-31 04:13:57.000000000 +0000 @@ -83,7 +83,7 @@ // put the brakes on if there is no blocking output running if (!synth->IsBlockingOutputPluginReady()|| - synth->IsPaused()) + synth->IsFrozen()) { usleep(10000); } diff -Nru spiralsynthmodular-0.2.2a/Makefile.in spiralsynthmodular-0.2.3+git20140329/Makefile.in --- spiralsynthmodular-0.2.2a/Makefile.in 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -17,9 +17,6 @@ MOC = moc UIC = -TAR = tar -cf -GZIP = gzip -9f - INSTALL = @INSTALL@ ###### Autoconf variables @@ -126,10 +123,9 @@ all: $(TARGET) - set -e; \ list='$(SUBDIRS)'; \ for subdir in $$list; do \ - $(MAKE) -C SpiralSound/Plugins/$$subdir; \ + (cd SpiralSound/Plugins/$$subdir ; make) \ done; $(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) @@ -137,38 +133,20 @@ moc: $(SRCMOC) -tmake: Makefile - -Makefile: SpiralSynthModular.pro - tmake SpiralSynthModular.pro -o Makefile - -dist: - $(TAR) SpiralSynthModular.tar SpiralSynthModular.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) SpiralSynthModular.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core list='$(SUBDIRS)'; \ for subdir in $$list; do \ - $(MAKE) -C SpiralSound/Plugins/$$subdir clean; \ - done; - -distclean: clean - -rm -f config.h config.log config.cache config.status Makefile \ - SpiralSound/PluginList.txt SpiralSynthPluginLocation.h - list='$(SUBDIRS)'; \ - for subdir in $$list; do \ - (cd SpiralSound/Plugins/$$subdir ; rm -f Makefile) \ + (cd SpiralSound/Plugins/$$subdir ; make clean) \ done; install: spiralsynthmodular $(INSTALL) spiralsynthmodular $(bindir) $(INSTALL) -d $(SpiralPlugins) - set -e; \ list='$(SUBDIRS)'; \ for subdir in $$list; do \ - $(MAKE) -C SpiralSound/Plugins/$$subdir install; \ + (cd SpiralSound/Plugins/$$subdir ; make install) \ done; uninstall: diff -Nru spiralsynthmodular-0.2.2a/missing spiralsynthmodular-0.2.3+git20140329/missing --- spiralsynthmodular-0.2.2a/missing 2005-02-24 16:58:07.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/missing 1970-01-01 00:00:00.000000000 +0000 @@ -1,336 +0,0 @@ -#! /bin/sh -# Common stub for a few missing GNU programs while installing. -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003 Free Software Foundation, Inc. -# Originally by Fran,cois Pinard , 1996. - -# 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, 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, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -if test $# -eq 0; then - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 -fi - -run=: - -# In the cases where this matters, `missing' is being run in the -# srcdir already. -if test -f configure.ac; then - configure_ac=configure.ac -else - configure_ac=configure.in -fi - -case "$1" in ---run) - # Try to run requested program, and just exit if it succeeds. - run= - shift - "$@" && exit 0 - ;; -esac - -# If it does not exist, or fails to run (possibly an outdated version), -# try to emulate it. -case "$1" in - - -h|--h|--he|--hel|--help) - echo "\ -$0 [OPTION]... PROGRAM [ARGUMENT]... - -Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an -error status if there is no known handling for PROGRAM. - -Options: - -h, --help display this help and exit - -v, --version output version information and exit - --run try to run the given command, and emulate it if it fails - -Supported PROGRAM values: - aclocal touch file \`aclocal.m4' - autoconf touch file \`configure' - autoheader touch file \`config.h.in' - automake touch all \`Makefile.in' files - bison create \`y.tab.[ch]', if possible, from existing .[ch] - flex create \`lex.yy.c', if possible, from existing .c - help2man touch the output file - lex create \`lex.yy.c', if possible, from existing .c - makeinfo touch the output file - tar try tar, gnutar, gtar, then tar without non-portable flags - yacc create \`y.tab.[ch]', if possible, from existing .[ch]" - ;; - - -v|--v|--ve|--ver|--vers|--versi|--versio|--version) - echo "missing 0.4 - GNU automake" - ;; - - -*) - echo 1>&2 "$0: Unknown \`$1' option" - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 - ;; - - aclocal*) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - fi - - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified \`acinclude.m4' or \`${configure_ac}'. You might want - to install the \`Automake' and \`Perl' packages. Grab them from - any GNU archive site." - touch aclocal.m4 - ;; - - autoconf) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - fi - - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified \`${configure_ac}'. You might want to install the - \`Autoconf' and \`GNU m4' packages. Grab them from any GNU - archive site." - touch configure - ;; - - autoheader) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - fi - - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified \`acconfig.h' or \`${configure_ac}'. You might want - to install the \`Autoconf' and \`GNU m4' packages. Grab them - from any GNU archive site." - files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` - test -z "$files" && files="config.h" - touch_files= - for f in $files; do - case "$f" in - *:*) touch_files="$touch_files "`echo "$f" | - sed -e 's/^[^:]*://' -e 's/:.*//'`;; - *) touch_files="$touch_files $f.in";; - esac - done - touch $touch_files - ;; - - automake*) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - fi - - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. - You might want to install the \`Automake' and \`Perl' packages. - Grab them from any GNU archive site." - find . -type f -name Makefile.am -print | - sed 's/\.am$/.in/' | - while read f; do touch "$f"; done - ;; - - autom4te) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - fi - - echo 1>&2 "\ -WARNING: \`$1' is needed, and you do not seem to have it handy on your - system. You might have modified some files without having the - proper tools for further handling them. - You can get \`$1' as part of \`Autoconf' from any GNU - archive site." - - file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` - test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` - if test -f "$file"; then - touch $file - else - test -z "$file" || exec >$file - echo "#! /bin/sh" - echo "# Created by GNU Automake missing as a replacement of" - echo "# $ $@" - echo "exit 0" - chmod +x $file - exit 1 - fi - ;; - - bison|yacc) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified a \`.y' file. You may need the \`Bison' package - in order for those modifications to take effect. You can get - \`Bison' from any GNU archive site." - rm -f y.tab.c y.tab.h - if [ $# -ne 1 ]; then - eval LASTARG="\${$#}" - case "$LASTARG" in - *.y) - SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" y.tab.c - fi - SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" y.tab.h - fi - ;; - esac - fi - if [ ! -f y.tab.h ]; then - echo >y.tab.h - fi - if [ ! -f y.tab.c ]; then - echo 'main() { return 0; }' >y.tab.c - fi - ;; - - lex|flex) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified a \`.l' file. You may need the \`Flex' package - in order for those modifications to take effect. You can get - \`Flex' from any GNU archive site." - rm -f lex.yy.c - if [ $# -ne 1 ]; then - eval LASTARG="\${$#}" - case "$LASTARG" in - *.l) - SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" lex.yy.c - fi - ;; - esac - fi - if [ ! -f lex.yy.c ]; then - echo 'main() { return 0; }' >lex.yy.c - fi - ;; - - help2man) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - fi - - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified a dependency of a manual page. You may need the - \`Help2man' package in order for those modifications to take - effect. You can get \`Help2man' from any GNU archive site." - - file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` - if test -z "$file"; then - file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` - fi - if [ -f "$file" ]; then - touch $file - else - test -z "$file" || exec >$file - echo ".ab help2man is required to generate this page" - exit 1 - fi - ;; - - makeinfo) - if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then - # We have makeinfo, but it failed. - exit 1 - fi - - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified a \`.texi' or \`.texinfo' file, or any other file - indirectly affecting the aspect of the manual. The spurious - call might also be the consequence of using a buggy \`make' (AIX, - DU, IRIX). You might want to install the \`Texinfo' package or - the \`GNU make' package. Grab either from any GNU archive site." - file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` - if test -z "$file"; then - file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` - file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` - fi - touch $file - ;; - - tar) - shift - if test -n "$run"; then - echo 1>&2 "ERROR: \`tar' requires --run" - exit 1 - fi - - # We have already tried tar in the generic part. - # Look for gnutar/gtar before invocation to avoid ugly error - # messages. - if (gnutar --version > /dev/null 2>&1); then - gnutar "$@" && exit 0 - fi - if (gtar --version > /dev/null 2>&1); then - gtar "$@" && exit 0 - fi - firstarg="$1" - if shift; then - case "$firstarg" in - *o*) - firstarg=`echo "$firstarg" | sed s/o//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - case "$firstarg" in - *h*) - firstarg=`echo "$firstarg" | sed s/h//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - fi - - echo 1>&2 "\ -WARNING: I can't seem to be able to run \`tar' with the given arguments. - You may want to install GNU tar or Free paxutils, or check the - command line arguments." - exit 1 - ;; - - *) - echo 1>&2 "\ -WARNING: \`$1' is needed, and you do not seem to have it handy on your - system. You might have modified some files without having the - proper tools for further handling them. Check the \`README' file, - it often tells you about the needed prerequisites for installing - this package. You may also peek at any GNU archive site, in case - some other package would contain this missing \`$1' program." - exit 1 - ;; -esac - -exit 0 diff -Nru spiralsynthmodular-0.2.2a/mkinstalldirs spiralsynthmodular-0.2.3+git20140329/mkinstalldirs --- spiralsynthmodular-0.2.2a/mkinstalldirs 2005-02-24 16:58:07.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/mkinstalldirs 1970-01-01 00:00:00.000000000 +0000 @@ -1,111 +0,0 @@ -#! /bin/sh -# mkinstalldirs --- make directory hierarchy -# Author: Noah Friedman -# Created: 1993-05-16 -# Public domain - -errstatus=0 -dirmode="" - -usage="\ -Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." - -# process command line arguments -while test $# -gt 0 ; do - case $1 in - -h | --help | --h*) # -h for help - echo "$usage" 1>&2 - exit 0 - ;; - -m) # -m PERM arg - shift - test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } - dirmode=$1 - shift - ;; - --) # stop option processing - shift - break - ;; - -*) # unknown option - echo "$usage" 1>&2 - exit 1 - ;; - *) # first non-opt arg - break - ;; - esac -done - -for file -do - if test -d "$file"; then - shift - else - break - fi -done - -case $# in - 0) exit 0 ;; -esac - -case $dirmode in - '') - if mkdir -p -- . 2>/dev/null; then - echo "mkdir -p -- $*" - exec mkdir -p -- "$@" - fi - ;; - *) - if mkdir -m "$dirmode" -p -- . 2>/dev/null; then - echo "mkdir -m $dirmode -p -- $*" - exec mkdir -m "$dirmode" -p -- "$@" - fi - ;; -esac - -for file -do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` - shift - - pathcomp= - for d - do - pathcomp="$pathcomp$d" - case $pathcomp in - -*) pathcomp=./$pathcomp ;; - esac - - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" - - mkdir "$pathcomp" || lasterr=$? - - if test ! -d "$pathcomp"; then - errstatus=$lasterr - else - if test ! -z "$dirmode"; then - echo "chmod $dirmode $pathcomp" - lasterr="" - chmod "$dirmode" "$pathcomp" || lasterr=$? - - if test ! -z "$lasterr"; then - errstatus=$lasterr - fi - fi - fi - fi - - pathcomp="$pathcomp/" - done -done - -exit $errstatus - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# End: -# mkinstalldirs ends here diff -Nru spiralsynthmodular-0.2.2a/README spiralsynthmodular-0.2.3+git20140329/README --- spiralsynthmodular-0.2.2a/README 2004-02-14 09:12:06.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/README 2012-05-31 04:13:57.000000000 +0000 @@ -1,6 +1,6 @@ ****** SpiralSynthModular ****** -Last changed Tuesday 6-January-2004. +Last changed Tuesday 11-March-2004. SpiralSynthModular is open source software, distributed under the General Public License (GPL). See the file COPYING. @@ -109,13 +109,9 @@ *** Trying it out without installing *** -You can try SpiralSynthModular out by following the following steps. - -1. Run the script ./createlinks to create a dummy plugin directory in your source - directory - -2. To run use the command: - ./spiralsynthmodular --PluginPath /path/to/your/ssm/source/links +You can try SpiralSynthModular by running the script ./test-run +which creates a dummy plugin directory in your source directory +and runs SpiralSynthModular using these uninstalled plugins. Disclaimer: diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/ChannelHandler.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/ChannelHandler.C --- spiralsynthmodular-0.2.2a/SpiralSound/ChannelHandler.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/ChannelHandler.C 2012-05-31 04:13:57.000000000 +0000 @@ -18,8 +18,8 @@ #include "ChannelHandler.h" #include -#include #include +#include using namespace std; @@ -216,6 +216,24 @@ pthread_mutex_unlock(m_Mutex); } +void ChannelHandler::ReplaceData(const std::string &ID, void *pData, int size) +{ + map::iterator i=m_ChannelMap.find(ID); + if (i==m_ChannelMap.end()) + { + cerr<<"ChannelHandler: Channel ["<second->data = pData; + i->second->size = size; + free(i->second->data_buf); + i->second->data_buf = malloc(size); + memcpy(i->second->data_buf,i->second->data,size); + pthread_mutex_unlock(m_Mutex); +} + void ChannelHandler::SetData(const string &ID, void *s) { map::iterator i=m_ChannelMap.find(ID); diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/ChannelHandler.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/ChannelHandler.h --- spiralsynthmodular-0.2.2a/SpiralSound/ChannelHandler.h 2002-10-20 00:01:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/ChannelHandler.h 2012-05-31 04:13:57.000000000 +0000 @@ -79,6 +79,8 @@ void Set(const std::string &ID, const float& s) { SetData(ID,(void*)&s); } void Set(const std::string &ID, const double& s) { SetData(ID,(void*)&s); } + void ReplaceData(const std::string &ID, void *pData, int size); + void SetCommand(char command); // initialises the data from the audio side to the internal buffers diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/AmpPlugin/AmpPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/AmpPlugin/AmpPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/AmpPlugin/AmpPluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/AmpPlugin/AmpPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -17,6 +17,7 @@ */ #include +#include #include "AmpPluginGUI.h" using namespace std; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/AmpPlugin/AmpPlugin.pro spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/AmpPlugin/AmpPlugin.pro --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/AmpPlugin/AmpPlugin.pro 2002-07-28 23:18:15.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/AmpPlugin/AmpPlugin.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -HEADERS = ../SpiralPlugin.h \ - ../SpiralPluginGUI.h \ - ../Widgets/Fl_Knob.H \ - ../Widgets/Fl_DragBar.H \ - ../../Sample.h \ - AmpPlugin.h \ - AmpPluginGUI.h - -SOURCES = ../SpiralPlugin.C \ - ../SpiralPluginGUI.C \ - ../Widgets/Fl_Knob.cxx \ - ../Widgets/Fl_DragBar.cxx \ - ../../Sample.C \ - AmpPlugin.C \ - AmpPluginGUI.C - -TARGET = AmpPlugin.so diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/AmpPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/AmpPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/AmpPlugin/Makefile.in 2004-01-17 10:32:41.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/AmpPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -15,9 +15,6 @@ MOC = moc UIC = -TAR = tar -cf -GZIP = gzip -9f - INSTALL = @INSTALL@ ###### Autoconf variables @@ -96,13 +93,6 @@ moc: $(SRCMOC) -tmake: - tmake AmpPlugin.pro - -dist: - $(TAR) AmpPlugin.tar AmpPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) AmpPlugin.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/AnotherFilterPlugin/AnotherFilterPlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/AnotherFilterPlugin/AnotherFilterPlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/AnotherFilterPlugin/AnotherFilterPlugin.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/AnotherFilterPlugin/AnotherFilterPlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -87,6 +87,13 @@ this,m_AudioCH,m_HostInfo); } +void AnotherFilterPlugin::Reset() +{ + ResetPorts(); + vibrapos = 0.0f; + vibraspeed = 0.0f; +} + void AnotherFilterPlugin::Execute() { float in; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/AnotherFilterPlugin/AnotherFilterPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/AnotherFilterPlugin/AnotherFilterPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/AnotherFilterPlugin/AnotherFilterPluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/AnotherFilterPlugin/AnotherFilterPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -18,6 +18,7 @@ #include "AnotherFilterPluginGUI.h" #include +#include using namespace std; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/AnotherFilterPlugin/AnotherFilterPlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/AnotherFilterPlugin/AnotherFilterPlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/AnotherFilterPlugin/AnotherFilterPlugin.h 2003-08-08 17:04:47.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/AnotherFilterPlugin/AnotherFilterPlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -34,6 +34,8 @@ virtual PluginInfo &Initialise(const HostInfo *Host); virtual SpiralGUIType *CreateGUI(); virtual void Execute(); + virtual void Reset(); + virtual void StreamOut(std::ostream &s); virtual void StreamIn(std::istream &s); @@ -41,8 +43,6 @@ float GetResonance() { return Resonance; } void Randomise(); - void Clear(); - private: float Cutoff, Resonance; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/AnotherFilterPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/AnotherFilterPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/AnotherFilterPlugin/Makefile.in 2004-01-17 10:32:42.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/AnotherFilterPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -10,13 +10,10 @@ CXXFLAGS= @CXXFLAGS@ @FLTK_CXXFLAGS@ INCPATH = -I/usr/X11R6/include LINK = g++ -shared -LFLAGS = +LFLAGS = LIBS = @FLTK_LIBS@ MOC = moc -UIC = - -TAR = tar -cf -GZIP = gzip -9f +UIC = INSTALL = @INSTALL@ @@ -99,13 +96,6 @@ moc: $(SRCMOC) -tmake: - tmake AnotherFilterPlugin.pro - -dist: - $(TAR) AnotherFilterPlugin.tar AnotherFilterPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) AnotherFilterPlugin.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/BeatMatchPlugin/BeatMatchPlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/BeatMatchPlugin/BeatMatchPlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/BeatMatchPlugin/BeatMatchPlugin.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/BeatMatchPlugin/BeatMatchPlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -82,6 +82,16 @@ this,m_AudioCH,m_HostInfo); } +void BeatMatchPlugin::Reset() +{ + ResetPorts(); + m_Triggered = false; + m_EstimatedDuration = 100; + m_BeatTime = 100; + m_NextBeat = 100; + m_OutputLevel = 1.0f; +} + void BeatMatchPlugin::Execute() { for (int n=0; nBUFSIZE; n++) diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/BeatMatchPlugin/BeatMatchPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/BeatMatchPlugin/BeatMatchPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/BeatMatchPlugin/BeatMatchPluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/BeatMatchPlugin/BeatMatchPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -18,6 +18,7 @@ #include "BeatMatchPluginGUI.h" #include +#include using namespace std; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/BeatMatchPlugin/BeatMatchPlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/BeatMatchPlugin/BeatMatchPlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/BeatMatchPlugin/BeatMatchPlugin.h 2003-08-08 17:55:49.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/BeatMatchPlugin/BeatMatchPlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -31,6 +31,8 @@ virtual PluginInfo& Initialise(const HostInfo *Host); virtual SpiralGUIType* CreateGUI(); virtual void Execute(); + virtual void Reset(); + virtual void ExecuteCommands(); virtual void StreamOut(std::ostream &s); virtual void StreamIn(std::istream &s); diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/BeatMatchPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/BeatMatchPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/BeatMatchPlugin/Makefile.in 2004-01-17 10:32:42.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/BeatMatchPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -15,9 +15,6 @@ MOC = moc UIC = -TAR = tar -cf -GZIP = gzip -9f - INSTALL = @INSTALL@ ###### Autoconf variables diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/ComplexEnvelopePlugin/Bezier.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/ComplexEnvelopePlugin/Bezier.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/ComplexEnvelopePlugin/Bezier.C 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/ComplexEnvelopePlugin/Bezier.C 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,102 @@ +/* Copyleft (C) 2002 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "Bezier.h" + +void Bezier(Vec2 &Out, Vec2 a, Vec2 b, Vec2 c, Vec2 d, float t) +{ + float tc=t*t*t; + float ts=t*t; + + Out.x=(-a.x+3*b.x-3*c.x+d.x)*tc + (3*a.x-6*b.x+3*c.x)*ts + (-3*a.x+3*b.x)*t + a.x; + Out.y=(-a.y+3*b.y-3*c.y+d.y)*tc + (3*a.y-6*b.y+3*c.y)*ts + (-3*a.y+3*b.y)*t + a.y; +} + +void CalculateBezierCurve(vector *List, float x1,float y1,float x2,float y2,float x3,float y3,float x4,float y4,int Sections) +{ + Vec2 g1(x1,y1); Vec2 g2(x2,y2); Vec2 g3(x3,y3); Vec2 g4(x4,y4); + + float t=0; + Vec2 p(0,0),lp(0,0); + + for (int n=0; n<=Sections; n++) + { + Bezier(p,g1,g2,g3,g4,t); + List->push_back(Vec2(p.x,p.y)); + lp.x=p.x; lp.y=p.y; + t+=0.1; + } +} + +void AddToSpline(const Vec2 &CV) +{ + Spline.push_back(CV); +} + +void CalculateBezierSpline(vector *List,int Sections) +{ + + if (Spline.size()==0) return; + + Vec2 SplineSection[4]; + SplineSection[0].x=Spline[0].x; + SplineSection[0].y=Spline[0].y; + SplineSection[1].x=Spline[0].x; + SplineSection[1].y=Spline[0].y; + SplineSection[2].x=Spline[0].x; + SplineSection[2].y=Spline[0].y; + SplineSection[3].x=Spline[0].x; + SplineSection[3].y=Spline[0].y; + int SCount=0; + + for(vector::iterator i=Spline.begin(); + i!=Spline.end(); ++i) + { + + SplineSection[3].x=i->x; + SplineSection[3].y=i->y; + + if (SCount>3) + { + vector BezierLineList; + CalculateBezierCurve(&BezierLineList, + SplineSection[0].x,SplineSection[0].y, + SplineSection[1].x,SplineSection[1].y, + SplineSection[2].x,SplineSection[2].y, + SplineSection[3].x,SplineSection[3].y, + Sections); + + for (vector::iterator bi=BezierLineList.begin(); + bi!=BezierLineList.end(); bi++) + { + List->push_back(*bi); + } + + SCount=1; + } + + for (int m=0; m<3; m++) + { + SplineSection[m].x=SplineSection[m+1].x; + SplineSection[m].y=SplineSection[m+1].y; + } + + SCount++; + } + + Spline.clear(); +} diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/ComplexEnvelopePlugin/Bezier.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/ComplexEnvelopePlugin/Bezier.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/ComplexEnvelopePlugin/Bezier.h 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/ComplexEnvelopePlugin/Bezier.h 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,43 @@ +/* Copyleft (C) 2002 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include + +#ifndef BEZIER_CURVE_STUFF +#define BEZIER_CURVE_STUFF + +struct Vec2 +{ + Vec2(float a=0, float b=0) { x=a; y=b;} + float x; float y; +}; + +using std::vector; + +static vector Spline; + +void Bezier(Vec2 &Out, Vec2 a, Vec2 b, Vec2 c, Vec2 d, float t); + +void CalculateBezierCurve(vector *List, + float x1,float y1,float x2,float y2, + float x3,float y3,float x4,float y4, + int Sections=16); + +void AddToSpline(const Vec2 &CV); +void CalculateBezierSpline(vector *List,int Sections=16); + +#endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/ComplexEnvelopePlugin/ComplexEnvelopePlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/ComplexEnvelopePlugin/ComplexEnvelopePlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/ComplexEnvelopePlugin/ComplexEnvelopePlugin.C 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/ComplexEnvelopePlugin/ComplexEnvelopePlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,238 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include "ComplexEnvelopePlugin.h" +#include "ComplexEnvelopePluginGUI.h" +#include +#include "SpiralIcon.xpm" + +extern "C" { +SpiralPlugin* SpiralPlugin_CreateInstance() +{ + return new ComplexEnvelopePlugin; +} + +char** SpiralPlugin_GetIcon() +{ + return SpiralIcon_xpm; +} + +int SpiralPlugin_GetID() +{ + return 33; +} + +string SpiralPlugin_GetGroupName() +{ + return "SpiralSound"; +} +} + +/////////////////////////////////////////////////////// + +ComplexEnvelopePlugin::ComplexEnvelopePlugin() : +m_Triggered(0), +m_Position(-1), +m_SampleTime(2.0f) +{ + m_PluginInfo.Name="ComplexEnv"; + m_PluginInfo.Width=320; + m_PluginInfo.Height=200; + m_PluginInfo.NumInputs=2; + m_PluginInfo.NumOutputs=2; + m_PluginInfo.PortTips.push_back("Trigger CV"); + m_PluginInfo.PortTips.push_back("Input"); + m_PluginInfo.PortTips.push_back("CV"); + m_PluginInfo.PortTips.push_back("Output"); +} + +ComplexEnvelopePlugin::~ComplexEnvelopePlugin() +{ +} + +PluginInfo &ComplexEnvelopePlugin::Initialise(const HostInfo *Host) +{ + PluginInfo& Info = SpiralPlugin::Initialise(Host); + CVListToEnvelope(m_CVVec); + return Info; +} + +SpiralGUIType *ComplexEnvelopePlugin::CreateGUI() +{ + m_GUI = new ComplexEnvelopePluginGUI(m_PluginInfo.Width, + m_PluginInfo.Height, + this,m_HostInfo); + m_GUI->hide(); + return m_GUI; +} + +void ComplexEnvelopePlugin::CVListToEnvelope(const vector &CVVec) +{ + m_EnvSample.Zero(); + + m_CVVec=CVVec; + + // check length + if (m_EnvSample.GetLength()/m_HostInfo->SAMPLERATE!=m_SampleTime) + { + m_EnvSample.Clear(); + m_EnvSample.Allocate((int)m_SampleTime*m_HostInfo->SAMPLERATE); + } + + vector Lines; + + if (m_Bezier) + { + // calculate the bezier spline that forms the line segments + for (vector::const_iterator i=CVVec.begin(); + i!=CVVec.end(); i++) + { + AddToSpline(*i); + } + CalculateBezierSpline(&Lines,10); + } + else + { + // use the CV's as line endpoints for straight line interpolation + Lines=CVVec; + } + + vector::const_iterator i=Lines.begin(); + if (i==Lines.end()) return; // no lines + vector::const_iterator ni=i+1; + if (ni==Lines.end()) return; // no lines + + for (int n=0; nx)/(ni->x-i->x); + if (t<0) t=0; + + // see if we need to find the next line + if (gt>=ni->x) + { + i++; + ni++; + // env has ended before the sample length + if (ni==Lines.end()) + { + // todo: fill the rest with last value + return; + } + t=Linear(i->x,ni->x,gt,0.0f,1.0f); + if (t<0) t=0; + } + float aa=Linear(0.0f,1.0f,t,ni->y,i->y); + m_EnvSample.Set(n,aa); + } +} + +void ComplexEnvelopePlugin::Execute() +{ + float temp=0; + bool Freeze=false; + + if (m_EnvSample.GetLength()==0) return; + + if (GetInput(0,0)>0) + { + if(!m_Triggered) + { + m_Triggered=1.0f; + m_Position=0; + } + } + else + { + if(m_Triggered) + { + m_Triggered=0; + } + } + + if (m_Position==-1) + { + GetOutputBuf(0)->Zero(); + return; + } + + + if (!InputExists(1)) + { + for (int n=0; nBUFSIZE; n++) + { + // see if we've fallen off the end + if (m_Position>m_EnvSample.GetLength()) + { + m_Position=-1; + break; + } + + SetOutput(0,n,m_EnvSample[m_Position]); + m_Position++; + } + } + else + { + for (int n=0; nBUFSIZE; n++) + { + // see if we've fallen off the end + if (m_Position>m_EnvSample.GetLength()) + { + m_Position=-1; + break; + } + + SetOutput(0,n,m_EnvSample[m_Position]); + SetOutput(1,n,GetInput(1,n)*m_EnvSample[m_Position]); + m_Position++; + } + } +} + +void ComplexEnvelopePlugin::StreamOut(ostream &s) +{ + s<::iterator i=m_CVVec.begin(); + i!=m_CVVec.end(); i++) + { + s<x<<" "<y<>version; + s>>m_Position>>m_SampleTime>>m_Bezier; + + m_CVVec.clear(); + int size; + s>>size; + for(int n=0; n>t.x>>t.y; + m_CVVec.push_back(t); + } + + ((ComplexEnvelopePluginGUI*)m_GUI)->SetCVList(m_CVVec); + CVListToEnvelope(m_CVVec); +} diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/ComplexEnvelopePlugin/ComplexEnvelopePluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/ComplexEnvelopePlugin/ComplexEnvelopePluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/ComplexEnvelopePlugin/ComplexEnvelopePluginGUI.C 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/ComplexEnvelopePlugin/ComplexEnvelopePluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,366 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include "ComplexEnvelopePluginGUI.h" +#include +#include + +static const float TIMED_SLIDER_MAX = 3.0f; + +///////////////////////////////////////////////////////////////////////// + +Fl_Envelope::Fl_Handle::Fl_Handle(int x,int y, int w, int h, char *Name) : +Fl_Widget(x,y,w,h,Name), +m_DelMe(false), +m_Changed(false), +m_Coincident(false) +{ +} + +Fl_Envelope::Fl_Handle::~Fl_Handle() +{ +} + +int Fl_Envelope::Fl_Handle::handle(int event) +{ + int Mousebutton=Fl::event_button(); + if (event==FL_DRAG && Mousebutton==1) + { + x(Fl::event_x()-(w()/2)); + y(Fl::event_y()-(h()/2)); + + // restrict the movement to the parent's area + if (x()x()) x(parent()->x()); + if (x()>parent()->x()+parent()->w()-w()) x(parent()->x()+parent()->w()-w()); + if (y()y()) y(parent()->y()); + if (y()>parent()->y()+parent()->h()-h()) y(parent()->y()+parent()->h()-h()); + + m_Changed=true; + + parent()->redraw(); + redraw(); + } + + if (event==FL_PUSH && Mousebutton==3) + { + m_DelMe=true; + } + + return 1; +} + +void Fl_Envelope::Fl_Handle::draw() +{ + if (m_Coincident) + { + fl_color(FL_BLACK); + fl_rect(x(),y(),w()+1,h()+1); + fl_line(x(),y(),x()+w(),y()+h()); + fl_line(x(),y()+h(),x()+w(),y()); + } + else + { + fl_color(FL_RED); + fl_arc( x(),y(),w()+1,h()+1,0,360); + } +} + + + +Fl_Envelope::Fl_Envelope(int x,int y, int w, int h, char *Name) : +Fl_Group(x,y,w,h,Name), +m_Length(1.0), +m_Bezier(true) +{ + m_Origin_x=x+10; + m_Origin_y=y+h-10; + + // default setting + Fl_Handle * newhandle = new Fl_Handle(28,20,10,10,""); + m_HandleList.push_back(newhandle); + add(newhandle); + + newhandle = new Fl_Handle(14,122,10,10,""); + m_HandleList.push_back(newhandle); + add(newhandle); + + newhandle = new Fl_Handle(48,63,10,10,""); + m_HandleList.push_back(newhandle); + add(newhandle); + + newhandle = new Fl_Handle(76,91,10,10,""); + m_HandleList.push_back(newhandle); + add(newhandle); + + newhandle = new Fl_Handle(131,86,10,10,""); + m_HandleList.push_back(newhandle); + add(newhandle); + + newhandle = new Fl_Handle(194,81,10,10,""); + m_HandleList.push_back(newhandle); + add(newhandle); + + newhandle = new Fl_Handle(294,131,10,10,""); + m_HandleList.push_back(newhandle); + add(newhandle); + + newhandle = new Fl_Handle(216,124 ,10,10,""); + m_HandleList.push_back(newhandle); + add(newhandle); + + show(); +} + +Fl_Envelope::~Fl_Envelope() +{ + end(); +} + +int Fl_Envelope::handle(int event) +{ + int ret=Fl_Group::handle(event); + + // search for deleted handles + for(list::iterator i = m_HandleList.begin(); + i!=m_HandleList.end(); ++i) + { + // if it's been modified, update the env via the callback + if ((*i)->Changed()) do_callback(); + + if ((*i)->Deleted()) + { + remove(*i); + m_HandleList.erase(i); + break; // one at a time + } + } + + if (!ret) + { + int Mousebutton=Fl::event_button(); + if (event==FL_PUSH && Mousebutton==2) + { + Fl_Handle * newhandle = new + Fl_Handle(Fl::event_x()-5,Fl::event_y()-5,10,10,""); + m_HandleList.push_back(newhandle); + add(newhandle); + } + + redraw(); + } + + return ret; +} + +void Fl_Envelope::draw() +{ + fl_push_clip(x(),y(),w()+1,h()+1); + fl_color(FL_GRAY); + fl_rectf(x(),y(),w()+1,h()+1); + + fl_color(FL_BLACK); + fl_rect(x(),y(),w()+1,h()+1); + + fl_color(FL_WHITE); + + int last_x=m_Origin_x, last_y=m_Origin_y, closest=INT_MAX, dist; + list::iterator ClosestHandle=m_HandleList.end(); + + // draw second markers + fl_color(150,150,150); + + for (int n=0; n<5; n++) + { + int p=(int)(m_Origin_x+(w()/m_Length*n)); + fl_line(p,y(),p,y()+h()); + } + + m_HandlePos.clear(); + + m_HandlePos.push_back(Vec2(m_Origin_x,m_Origin_y)); + if (m_Bezier) AddToSpline(Vec2(m_Origin_x,m_Origin_y)); + + for (unsigned int n=0; n::iterator i = m_HandleList.begin(); + i!=m_HandleList.end(); ++i) + { + dist=(*i)->x()-last_x; + if (dist>-5 && distx()+5,(*ClosestHandle)->y()+5); + + (*ClosestHandle)->SetIsCoincident(false); + + last_x=(*ClosestHandle)->x()+5; + last_y=(*ClosestHandle)->y()+5; + + m_HandlePos.push_back(Vec2((*ClosestHandle)->x()+5,(*ClosestHandle)->y()+5)); + + if (m_Bezier) + { + if (!(n%3)) (*ClosestHandle)->SetIsCoincident(true); + AddToSpline(Vec2((*ClosestHandle)->x()+5,(*ClosestHandle)->y()+5)); + } + } + } + + if (m_Bezier) + { + vector BezierLineList; + CalculateBezierSpline(&BezierLineList,10); + + vector::iterator bi=BezierLineList.begin(); + bi++; + fl_color(FL_BLUE); + for (;bi!=BezierLineList.end(); bi++) + { + fl_line((int)(bi-1)->x,(int)(bi-1)->y,(int)bi->x,(int)bi->y); + } + } + + fl_color(FL_BLACK); + fl_line(m_Origin_x,m_Origin_y,m_Origin_x,y()+10); + fl_line(m_Origin_x,m_Origin_y,x()+w()-10,m_Origin_y); + + Fl_Group::draw(); + fl_pop_clip(); +} + +void Fl_Envelope::Clear() +{ + for(list::iterator i = m_HandleList.begin(); + i!=m_HandleList.end(); ++i) + { + remove(*i); + } + + m_HandleList.clear(); +} + +vector Fl_Envelope::GetCVList() +{ + vector m_CV; + for(vector::iterator i = m_HandlePos.begin(); + i!=m_HandlePos.end(); ++i) + { + // convert to 0->1 + Vec2 vec((i->x-m_Origin_x)/(float)(w()-m_Origin_x), + (m_Origin_y-i->y)/(float)(m_Origin_y-y())); + + m_CV.push_back(vec); + } + + return m_CV; +} + +void Fl_Envelope::SetCVList(const vector &CV) +{ + Clear(); + + for(vector::const_iterator i = CV.begin(); + i!=CV.end(); ++i) + { + int minx=m_Origin_x, width=w()-m_Origin_x; + int miny=m_Origin_y, height=m_Origin_y-y(); + + // convert from 0->1 screen coords + Vec2 vec(minx+(i->x*width), + miny-(i->y*height)); + + Fl_Handle *nh = new Fl_Handle((int)vec.x,(int)vec.y,10,10,""); + add(nh); + m_HandleList.push_back(nh); + } + + redraw(); +} + +///////////////////////////////////////////////////////////////////////// + +ComplexEnvelopePluginGUI::ComplexEnvelopePluginGUI(int w, int h,ComplexEnvelopePlugin *o,const HostInfo *Info) : +SpiralPluginGUI(w,h,o) +{ + m_Plugin=o; + + m_Type = new Fl_Button(15,h-35,100,20,"Bezier Curve"); + m_Type->type(1); + m_Type->value(1); + m_Type->labelsize(10); + m_Type->callback((Fl_Callback*)cb_Type); + + m_Length = new Fl_Knob(w-60,h-55,40,40,"Length"); + m_Length->color(Info->GUI_COLOUR); + m_Length->labelsize(10); + m_Length->maximum(5); + m_Length->step(0.001); + m_Length->value(1); + m_Length->callback((Fl_Callback*)cb_Length); + + m_TLength = new Fl_Output(w-130,h-45,60,20,""); + m_TLength->value("1.0"); + + m_Envelope = new Fl_Envelope(5,20,w-10,h-75,""); + m_Envelope->callback((Fl_Callback*)cb_UpdateEnv); + + end(); +} + +void ComplexEnvelopePluginGUI::UpdateValues() +{ + +} + +inline void ComplexEnvelopePluginGUI::cb_UpdateEnv_i(Fl_Envelope *o, void* v) +{ + m_Plugin->CVListToEnvelope(o->GetCVList()); +} +void ComplexEnvelopePluginGUI::cb_UpdateEnv(Fl_Envelope* o, void* v) +{((ComplexEnvelopePluginGUI*)(o->parent()))->cb_UpdateEnv_i(o,v);} + +inline void ComplexEnvelopePluginGUI::cb_Type_i(Fl_Button *o, void *v) +{ + m_Envelope->SetBezier(o->value()); + m_Plugin->SetBezier(o->value()); + m_Envelope->redraw(); +} +void ComplexEnvelopePluginGUI::cb_Type(Fl_Button *o, void *v) +{((ComplexEnvelopePluginGUI*)(o->parent()))->cb_Type_i(o,v);} + +inline void ComplexEnvelopePluginGUI::cb_Length_i(Fl_Knob *o, void *v) +{ + m_Plugin->SetLength(o->value()); + m_Envelope->SetLength(o->value()); + static char text[16]; + sprintf(text,"%f",o->value()); + m_TLength->value(text); + m_Envelope->redraw(); +} +void ComplexEnvelopePluginGUI::cb_Length(Fl_Knob *o, void *v) +{((ComplexEnvelopePluginGUI*)(o->parent()))->cb_Length_i(o,v);} diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/ComplexEnvelopePlugin/ComplexEnvelopePluginGUI.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/ComplexEnvelopePlugin/ComplexEnvelopePluginGUI.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/ComplexEnvelopePlugin/ComplexEnvelopePluginGUI.h 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/ComplexEnvelopePlugin/ComplexEnvelopePluginGUI.h 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,109 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ComplexEnvelopePlugin.h" +#include "../SpiralPluginGUI.h" +#include "../Widgets/Fl_Knob.H" +#include "Bezier.h" + +#ifndef EnvelopeGUI +#define EnvelopeGUI + +class Fl_Envelope : public Fl_Group +{ +public: + Fl_Envelope(int x,int y, int w, int h, char *Name); + ~Fl_Envelope(); + + virtual int handle(int event); + virtual void draw(); + void Clear(); + void SetBezier(bool s) { m_Bezier=s; } + void SetLength(float s) { m_Length=s; } + vector GetCVList(); + void SetCVList(const vector &CV); + +private: + + class Fl_Handle : public Fl_Widget + { + public: + Fl_Handle(int x,int y, int w, int h, char *Name); + ~Fl_Handle(); + virtual int handle(int event); + virtual void draw(); + bool Deleted() { return m_DelMe; } + void DelMe() { m_DelMe=true; } + void SetIsCoincident(bool s) { m_Coincident=s; } + bool Changed() { bool t=m_Changed; m_Changed=false; return t; } + + private: + bool m_DelMe; + bool m_Changed; + bool m_Coincident; + }; + + float m_Length; + float m_Time; + bool m_Bezier; + + list m_HandleList; + vector m_HandlePos; + int m_Origin_x; + int m_Origin_y; +}; + + +class ComplexEnvelopePluginGUI : public SpiralPluginGUI +{ +public: + ComplexEnvelopePluginGUI(int w, int h, ComplexEnvelopePlugin *o,const HostInfo *Info); + + virtual void UpdateValues(); + virtual SpiralPlugin* GetPlugin() { return m_Plugin; } + + void SetCVList(const vector &CV) { m_Envelope->SetCVList(CV); } + + ComplexEnvelopePlugin *m_Plugin; +private: + + Fl_Envelope *m_Envelope; + Fl_Button *m_Type; + Fl_Knob *m_Length; + Fl_Output *m_TLength; + + //// Callbacks //// + + inline void cb_Type_i(Fl_Button *o, void *v); + static void cb_Type(Fl_Button *o, void *v); + inline void cb_Length_i(Fl_Knob *o, void *v); + static void cb_Length(Fl_Knob *o, void *v); + inline void cb_UpdateEnv_i(Fl_Envelope *o, void*v); + static void cb_UpdateEnv(Fl_Envelope* o, void* v); +}; + +#endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/ComplexEnvelopePlugin/ComplexEnvelopePlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/ComplexEnvelopePlugin/ComplexEnvelopePlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/ComplexEnvelopePlugin/ComplexEnvelopePlugin.h 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/ComplexEnvelopePlugin/ComplexEnvelopePlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,63 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../SpiralPlugin.h" +#include "Bezier.h" +#include + +#ifndef ComplexEnvelopePLUGIN +#define ComplexEnvelopePLUGIN + +static const int NUM_CHANNELS = 4; + +class ComplexEnvelopePlugin : public SpiralPlugin +{ +public: + ComplexEnvelopePlugin(); + virtual ~ComplexEnvelopePlugin(); + + virtual PluginInfo &Initialise(const HostInfo *Host); + virtual SpiralGUIType *CreateGUI(); + virtual void Execute(); + virtual void StreamOut(ostream &s); + virtual void StreamIn(istream &s); + + // has to be defined in the plugin + virtual void UpdateGUI() { Fl::check(); } + void CVListToEnvelope(const vector &Lines); + + void SetLength(float s) { m_SampleTime=s; } + void SetBezier(bool s) { m_Bezier=s; } + +private: + + float m_Triggered; // should scale envelope + int m_Position; + bool m_Bezier; + Sample m_EnvSample; + float m_SampleTime; + + vector m_CVVec; + + friend istream &operator>>(istream &s, ComplexEnvelopePlugin &o); + friend ostream &operator<<(ostream &s, ComplexEnvelopePlugin &o); +}; +istream &operator>>(istream &s, ComplexEnvelopePlugin &o); +ostream &operator<<(ostream &s, ComplexEnvelopePlugin &o); + +#endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/ComplexEnvelopePlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/ComplexEnvelopePlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/ComplexEnvelopePlugin/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/ComplexEnvelopePlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,160 @@ +############################################################################# +# Makefile for building ComplexEnvelopePlugin.so +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ @FLTK_CFLAGS@ +CXXFLAGS= @CXXFLAGS@ @FLTK_CXXFLAGS@ +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = @FLTK_LIBS@ +MOC = moc +UIC = + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = ComplexEnvelopePlugin.h \ + ComplexEnvelopePluginGUI.h \ + ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../../ChannelHandler.h \ + ../../Sample.h \ + Bezier.h \ + ../Widgets/Fl_Knob.H \ + ../../../GUI/Widgets/SpiralGUI.H +SOURCES = ComplexEnvelopePlugin.C \ + ComplexEnvelopePluginGUI.C \ + ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../../ChannelHandler.C \ + ../../Sample.C \ + Bezier.C \ + ../Widgets/Fl_Knob.cxx \ + ../../../GUI/Widgets/SpiralGUI.C +OBJECTS = ComplexEnvelopePlugin.o \ + ComplexEnvelopePluginGUI.o \ + ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../../ChannelHandler.o \ + ../../Sample.o \ + Bezier.o \ + ../Widgets/Fl_Knob.o \ + ../../../GUI/Widgets/SpiralGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = ComplexEnvelopePlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../ChannelHandler.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../SpiralPlugin.h \ + ../../ChannelHandler.h \ + ../../../GUI/Widgets/SpiralGUI.H + +../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_Knob.H + +../../../GUI/Widgets/SpiralGUI.o: ../../../GUI/Widgets/SpiralGUI.C \ + ../../../GUI/Widgets/SpiralGUI.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h + +Bezier.o: Bezier.C \ + Bezier.h \ + +ComplexEnvelopePlugin.o: ComplexEnvelopePlugin.C \ + ComplexEnvelopePlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ComplexEnvelopePluginGUI.h \ + ../SpiralPluginGUI.h \ + ../../../GUI/Widgets/SpiralGUI.H \ + Bezier.h \ + SpiralIcon.xpm + +ComplexEnvelopePluginGUI.o: ComplexEnvelopePluginGUI.C \ + ComplexEnvelopePluginGUI.h \ + ComplexEnvelopePlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../SpiralPluginGUI.h \ + Bezier.h \ + ../../../GUI/Widgets/SpiralGUI.H + +../../ChannelHandler.o: ../../ChannelHandler.C \ + ../../ChannelHandler.h diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/ComplexEnvelopePlugin/SpiralIcon.xpm spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/ComplexEnvelopePlugin/SpiralIcon.xpm --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/ComplexEnvelopePlugin/SpiralIcon.xpm 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/ComplexEnvelopePlugin/SpiralIcon.xpm 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,327 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"36 36 288 2", +" c None", +". c #8B889B", +"+ c #9C99AA", +"@ c #ADAAB9", +"# c #837F94", +"$ c #7D7990", +"% c #9995A7", +"& c #67627C", +"* c #CDCBD4", +"= c #FCFCFC", +"- c #D1D0D8", +"; c #FFFFFF", +"> c #F1F1F3", +", c #848095", +"' c #2A2248", +") c #CFCED6", +"! c #68637D", +"~ c #ABA8B6", +"{ c #D5D3DB", +"] c #9490A2", +"^ c #C4C4C4", +"/ c #1D1C1D", +"( c #313134", +"_ c #EEEFEE", +": c #FBFBFB", +"< c #EFEFEF", +"[ c #7B768D", +"} c #464060", +"| c #DEDEE1", +"1 c #CBCACC", +"2 c #EEEEF1", +"3 c #79758C", +"4 c #FBFBFC", +"5 c #A2A2A2", +"6 c #000000", +"7 c #F5F6F5", +"8 c #747474", +"9 c #2A2A2B", +"0 c #403958", +"a c #7D788F", +"b c #C0BEC8", +"c c #BCBAC6", +"d c #BCBAC5", +"e c #625C79", +"f c #2B2932", +"g c #191919", +"h c #CCCCCC", +"i c #807B91", +"j c #3B3556", +"k c #F2F2F4", +"l c #929292", +"m c #0E0E0E", +"n c #BFBFBF", +"o c #111111", +"p c #100E15", +"q c #868689", +"r c #FEFDFE", +"s c #D9D7DE", +"t c #9C98AA", +"u c #FDFCFD", +"v c #DDDDDD", +"w c #575755", +"x c #5E5E5E", +"y c #C4C2CD", +"z c #423C5C", +"A c #F0F0F2", +"B c #939393", +"C c #555555", +"D c #4A4A4A", +"E c #010101", +"F c #282828", +"G c #C2C2C2", +"H c #DBDAE0", +"I c #615C78", +"J c #F6F6F7", +"K c #DADADA", +"L c #545454", +"M c #0F0F0F", +"N c #B8B8B8", +"O c #48445C", +"P c #2B2B2C", +"Q c #181900", +"R c #D3D3D3", +"S c #C1BEC9", +"T c #474060", +"U c #31294D", +"V c #716C85", +"W c #65607A", +"X c #625D78", +"Y c #D5D4DB", +"Z c #F7F7F7", +"` c #8B8B8B", +" . c #161616", +".. c #0C0C0C", +"+. c #161800", +"@. c #1A1B00", +"#. c #060600", +"$. c #191A00", +"%. c #393643", +"&. c #47415F", +"*. c #9692A4", +"=. c #D9D8DE", +"-. c #F7F7F8", +";. c #918DA0", +">. c #B8B5C1", +",. c #D1D1D1", +"'. c #212121", +"). c #2D2F00", +"!. c #111200", +"~. c #0F0F00", +"{. c #090A00", +"]. c #040400", +"^. c #727175", +"/. c #FEFEFF", +"(. c #9D99AA", +"_. c #DBD9E0", +":. c #E9E9E9", +"<. c #CBCBCB", +"[. c #E0E0E0", +"}. c #6C6C6C", +"|. c #050500", +"1. c #515151", +"2. c #A6A6A7", +"3. c #827E93", +"4. c #615C77", +"5. c #EAEAED", +"6. c #DFDFE1", +"7. c #FEF100", +"8. c #010100", +"9. c #1E1D24", +"0. c #9894A7", +"a. c #B1AEBB", +"b. c #69686F", +"c. c #000001", +"d. c #615C76", +"e. c #5F5A75", +"f. c #413E4D", +"g. c #020203", +"h. c #1A1A1C", +"i. c #C3C1CB", +"j. c #9D9D9D", +"k. c #202020", +"l. c #383838", +"m. c #4C4C4C", +"n. c #2C2E00", +"o. c #111112", +"p. c #C9C7D0", +"q. c #F1F1F1", +"r. c #F8F8F8", +"s. c #232323", +"t. c #050600", +"u. c #050408", +"v. c #AEACB9", +"w. c #FEFEFE", +"x. c #1D1D1D", +"y. c #292B00", +"z. c #B7B5C1", +"A. c #9390A2", +"B. c #BBBBBB", +"C. c #414141", +"D. c #030303", +"E. c #28272A", +"F. c #F4F4F6", +"G. c #605B76", +"H. c #736E86", +"I. c #D8D8D8", +"J. c #727272", +"K. c #101010", +"L. c #020200", +"M. c #1E2000", +"N. c #848486", +"O. c #CCCBD3", +"P. c #747087", +"Q. c #6D6881", +"R. c #1C1C1C", +"S. c #242424", +"T. c #0A0A00", +"U. c #656566", +"V. c #F6F6F6", +"W. c #E8E6EA", +"X. c #706B84", +"Y. c #E3E1E6", +"Z. c #474746", +"`. c #151515", +" + c #C8C8C8", +".+ c #AEAEAE", +"++ c #080808", +"@+ c #373639", +"#+ c #FDFCFE", +"$+ c #ABA8B7", +"%+ c #F1F0F3", +"&+ c #6D6980", +"*+ c #0A090E", +"=+ c #95929E", +"-+ c #0A0810", +";+ c #0D0D0D", +">+ c #050505", +",+ c #5B5A5C", +"'+ c #F7F6F7", +")+ c #F4F3F5", +"!+ c #908C9F", +"~+ c #C8C6D0", +"{+ c #837E96", +"]+ c #86868A", +"^+ c #070608", +"/+ c #ECEBEE", +"(+ c #5B5571", +"_+ c #646078", +":+ c #AFAFB0", +"<+ c #454545", +"[+ c #363636", +"}+ c #7A7A7A", +"|+ c #C8C8C9", +"1+ c #212025", +"2+ c #060607", +"3+ c #969699", +"4+ c #FAFAFA", +"5+ c #F8F8F9", +"6+ c #A29EAF", +"7+ c #F7F6F8", +"8+ c #F0F0F1", +"9+ c #B8B7B9", +"0+ c #E4E4E4", +"a+ c #FDFDFD", +"b+ c #A5A2B2", +"c+ c #3B3456", +"d+ c #A8A5B4", +"e+ c #525252", +"f+ c #848387", +"g+ c #CDCDCD", +"h+ c #8D899C", +"i+ c #494262", +"j+ c #68627C", +"k+ c #40395A", +"l+ c #ECECEC", +"m+ c #020202", +"n+ c #B4B5B5", +"o+ c #0B0B0B", +"p+ c #313232", +"q+ c #E3E3E3", +"r+ c #B1AEBC", +"s+ c #BDBBC6", +"t+ c #3C3556", +"u+ c #898599", +"v+ c #EDEDED", +"w+ c #39393A", +"x+ c #040404", +"y+ c #333333", +"z+ c #F5F5F5", +"A+ c #2B2B2B", +"B+ c #2D2A3D", +"C+ c #B6B4C1", +"D+ c #F5F5F6", +"E+ c #605A76", +"F+ c #DAD8DF", +"G+ c #F5F4F6", +"H+ c #615B76", +"I+ c #524D6A", +"J+ c #E4E3E8", +"K+ c #D5D5D5", +"L+ c #1B1B1B", +"M+ c #303030", +"N+ c #AAABAB", +"O+ c #585464", +"P+ c #B0AEBB", +"Q+ c #A29FAF", +"R+ c #E9E8E9", +"S+ c #787779", +"T+ c #0F0E15", +"U+ c #2D2D2E", +"V+ c #595959", +"W+ c #FAFAFB", +"X+ c #807B92", +"Y+ c #B0ADBB", +"Z+ c #E8E7EB", +"`+ c #3A3258", +" @ c #E6E5EA", +".@ c #DFDEE3", +"+@ c #443E5E", +"@@ c #BAB8C4", +"#@ c #C1BFCA", +"$@ c #E0E0E5", +"%@ c #D0CED6", +"&@ c #362F52", +"*@ c #CECCD5", +"=@ c #413A5B", +"-@ c #6A657F", +";@ c #9793A6", +" ", +" ", +" ", +" . + @ # $ % ", +" & * = * - ; > , ' ; ; ; ) ! ", +" ~ ; ; { ] ; ^ / ( _ ; : < [ ", +" } | 1 2 3 4 5 6 6 7 : 8 9 0 a b ", +" c : d e f g h i j k l 6 m ; n o 6 p q r s ", +" t u ; v w 6 6 x y z A B 6 C ; D E 6 F G ; H ", +" I J ; ; K L 6 6 M N O P E 6 6 6 Q Q M R S T U V W ", +" X Y ; ; ; ; Z ` .6 ..6 6 6 6 6 +.@.#.$.%.&.*.=.-.;. ", +" >.; ; ; ; ; ; = ,.'.).!.6 ~.{.6 ].6 6 6 E ^./.; ; (. ", +" _.; ; :.R h <.[.}.6 |.6 6 6 6 6 6 6 6 6 6 E 1.2.4 3. ", +" 4.5.; 6...6 6 6 6 6 6 6 6 6 7.7.8.6 6 6 6 6 6 6 9.0. ", +" V @ a.b.c.6 6 6 6 6 6 6 6 7.7.7.6 6 6 6 6 6 6 6 ", +" d.e.f.6 g.6 6 6 6 6 6 7.7.7.7.7.6 6 6 |.6 6 6 h. ", +" i.; ; j.k.k.l.m.k.6 7.7.7.7.7.7.7.6 6 6 n.7.6 6 o. ", +" p.; ; q.r.; ; ; s.6 7.7.7.7.7.7.7.7.6 6 7.7.t.6 u. ", +" v.; ; ; ; w.; ; x.6 7.7.7.7.7.7.7.7.7.7.7.7.y.6 6 z., ", +" A.; ; w.; : B.C.D.Q 7.7.7.7.7.7.7.7.7.7.7.7.6 6 E.w.F.G. ", +" H.; ; ; I.J.K.6 6 6 6 6 6 6 6 6 6 L.6 M.6 6 6 6 N.; ; O.P. ", +" Q.J ; : R.6 6 6 6 S...6 6 6 6 6 6 T.6 6 8.6 6 6 U.V.; ; W.X. ", +" Y.; ; Z.6 E 6 `. +.+++6 6 6 6 6 6 6 6 8.6 6 6 6 @+#+; ; > X. ", +" $+; %+&+*+6 6 .+w.; =+-+6 6 6 6 6 6 6 6 ;+>+6 6 6 ,+'+; ; )+!+ ", +" X.~+! {+]+^+x ; ; /+(+_+:+l <+6 6 6 [+}+|+1+6 6 6 2+3+4+; ; 5+@ ", +" 6+7+8+9+0+a+; b+c+d+; V.<+6 6 E e+; ; f+6 6 E 6 o g+; ; = h+ ", +" i+> ; ; ; ; ; ; j+k+; ; l+l.6 6 m+D ; ; n+o+6 6 6 p+q+; ; r+ ", +" > ; ; ; ; s+t+u+; ; v+w+6 6 x+y+; ; z+A+6 6 B+C+; D+3 ", +" E+F+= ; G+H+I+J+; ; K+L+6 6 m+M+; ; ; N+e+O+ ", +" P+4 Q+ X ; ; ; R+S+M+T+U+V+; ; ; w.W+X+ ", +" Y+; ; ; ; ; Z+`+ @; ; ; ; = .@+@ ", +" @@#@$@4 ; ; %@&@*@; ; ; s u+T ", +" =@ -@;@u+ ", +" ", +" ", +" "}; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/ControllerPlugin/ControllerPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/ControllerPlugin/ControllerPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/ControllerPlugin/ControllerPluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/ControllerPlugin/ControllerPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -17,9 +17,9 @@ */ #include -#include #include "ControllerPluginGUI.h" #include +#include using namespace std; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/ControllerPlugin/ControllerPlugin.pro spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/ControllerPlugin/ControllerPlugin.pro --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/ControllerPlugin/ControllerPlugin.pro 2002-07-28 23:18:16.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/ControllerPlugin/ControllerPlugin.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -HEADERS = ../SpiralPlugin.h \ - ../SpiralPluginGUI.h \ - ../Widgets/Fl_Knob.H \ - ../Widgets/Fl_DragBar.H \ - ../../Sample.h \ - ControllerPlugin.h \ - ControllerPluginGUI.h - -SOURCES = ../SpiralPlugin.C \ - ../SpiralPluginGUI.C \ - ../Widgets/Fl_Knob.cxx \ - ../Widgets/Fl_DragBar.cxx \ - ../../Sample.C \ - ControllerPlugin.C \ - ControllerPluginGUI.C - -TARGET = ControllerPlugin.so diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/ControllerPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/ControllerPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/ControllerPlugin/Makefile.in 2004-01-17 10:32:42.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/ControllerPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -15,9 +15,6 @@ MOC = moc UIC = -TAR = tar -cf -GZIP = gzip -9f - INSTALL = @INSTALL@ ###### Autoconf variables @@ -96,13 +93,6 @@ moc: $(SRCMOC) -tmake: - tmake ControllerPlugin.pro - -dist: - $(TAR) ControllerPlugin.tar ControllerPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) ControllerPlugin.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/CounterPlugin/CounterPlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/CounterPlugin/CounterPlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/CounterPlugin/CounterPlugin.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/CounterPlugin/CounterPlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -80,6 +80,15 @@ this,m_AudioCH,m_HostInfo); } +void CounterPlugin::Reset() +{ + ResetPorts(); + m_Current = 0; + m_Triggered = false; + m_CurrentLevel = 1.0f; +} + + void CounterPlugin::Execute() { bool Triggered; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/CounterPlugin/CounterPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/CounterPlugin/CounterPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/CounterPlugin/CounterPluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/CounterPlugin/CounterPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -18,8 +18,8 @@ #include "CounterPluginGUI.h" #include +#include #include -#include using namespace std; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/CounterPlugin/CounterPlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/CounterPlugin/CounterPlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/CounterPlugin/CounterPlugin.h 2003-08-08 17:55:50.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/CounterPlugin/CounterPlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -31,6 +31,8 @@ virtual PluginInfo& Initialise(const HostInfo *Host); virtual SpiralGUIType* CreateGUI(); virtual void Execute(); + virtual void Reset(); + virtual void ExecuteCommands(); virtual void StreamOut(std::ostream &s); virtual void StreamIn(std::istream &s); diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/CounterPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/CounterPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/CounterPlugin/Makefile.in 2004-01-17 10:32:42.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/CounterPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -13,10 +13,7 @@ LFLAGS = LIBS = @FLTK_LIBS@ MOC = moc -UIC = - -TAR = tar -cf -GZIP = gzip -9f +UIC = INSTALL = @INSTALL@ diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/DelayPlugin/DelayPlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/DelayPlugin/DelayPlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/DelayPlugin/DelayPlugin.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/DelayPlugin/DelayPlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -85,6 +85,15 @@ this,m_AudioCH,m_HostInfo); } +void DelayPlugin::Reset() +{ + ResetPorts(); + m_Buffer.Clear(); + m_Buffer.Allocate((int)(m_HostInfo->SAMPLERATE*MAX_DELAY)); + m_ReadHeadPos = 0; + m_WriteHeadPos = 0; +} + void DelayPlugin::Execute () { int Delay; float max_pos = MAX_DELAY * m_HostInfo->SAMPLERATE; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/DelayPlugin/DelayPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/DelayPlugin/DelayPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/DelayPlugin/DelayPluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/DelayPlugin/DelayPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -18,6 +18,7 @@ #include "DelayPluginGUI.h" #include +#include using namespace std; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/DelayPlugin/DelayPlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/DelayPlugin/DelayPlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/DelayPlugin/DelayPlugin.h 2003-08-08 17:04:47.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/DelayPlugin/DelayPlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -31,6 +31,7 @@ virtual PluginInfo &Initialise(const HostInfo *Host); virtual SpiralGUIType *CreateGUI(); virtual void Execute(); + virtual void Reset(); virtual void StreamOut(std::ostream &s); virtual void StreamIn(std::istream &s); diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/DelayPlugin/DelayPlugin.pro spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/DelayPlugin/DelayPlugin.pro --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/DelayPlugin/DelayPlugin.pro 2002-07-28 23:18:16.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/DelayPlugin/DelayPlugin.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -HEADERS = ../SpiralPlugin.h \ - ../SpiralPluginGUI.h \ - ../Widgets/Fl_Knob.H \ - ../Widgets/Fl_DragBar.H \ - ../../Sample.h \ - DelayPlugin.h \ - DelayPluginGUI.h - -SOURCES = ../SpiralPlugin.C \ - ../SpiralPluginGUI.C \ - ../Widgets/Fl_Knob.cxx \ - ../Widgets/Fl_DragBar.cxx \ - ../../Sample.C \ - DelayPlugin.C \ - DelayPluginGUI.C - -TARGET = DelayPlugin.so diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/DelayPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/DelayPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/DelayPlugin/Makefile.in 2004-01-17 10:32:42.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/DelayPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -13,10 +13,7 @@ LFLAGS = LIBS = @FLTK_LIBS@ MOC = moc -UIC = - -TAR = tar -cf -GZIP = gzip -9f +UIC = INSTALL = @INSTALL@ @@ -99,13 +96,6 @@ moc: $(SRCMOC) -tmake: - tmake DelayPlugin.pro - -dist: - $(TAR) DelayPlugin.tar DelayPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) DelayPlugin.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/DiskWriterPlugin/DiskWriterPlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/DiskWriterPlugin/DiskWriterPlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/DiskWriterPlugin/DiskWriterPlugin.C 2004-02-07 15:18:57.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/DiskWriterPlugin/DiskWriterPlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -28,7 +28,7 @@ //#include #include "DiskWriterPlugin.h" #include "DiskWriterPluginGUI.h" -#include +#include #include "SpiralIcon.xpm" using namespace std; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/DiskWriterPlugin/DiskWriterPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/DiskWriterPlugin/DiskWriterPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/DiskWriterPlugin/DiskWriterPluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/DiskWriterPlugin/DiskWriterPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -18,7 +18,7 @@ #include "DiskWriterPluginGUI.h" #include -#include +#include using namespace std; @@ -132,9 +132,9 @@ m_32bits->value(0); m_24bits->value(0); m_16bits->value(1); - } + } } - + m_Stereo->value(Plugin->GetStereo()); redraw(); @@ -143,13 +143,28 @@ //// Callbacks //// inline void DiskWriterPluginGUI::cb_Open_i(Fl_Button* o) -{ +{ if (o->value()) { char *fn=fl_file_chooser("Pick a Wav file to save to", "*.wav", NULL); - char t[256]; - sprintf(t,"%s",fn); - + + // On Mon, 2004-05-17 at 20:53, Bernd Breitenbach wrote: + // When you click the open button and click cancel right afterwards it crashes. + // Attached you find a patch for it. + // I would call it a work around not a solution, because you can't have filenames that exceeds + // 256 chars. + // A real solution requires a more flexible implementation of ChannelHandler::RegisterData + + // On Mon, 17 May 2004 13:59:23 Dave Griffiths wrote: + // That's a difficult one. We can't use new/malloc as it's for use on the realtime thread + // (although in practice, ssm breaks this rule quite a lot :/ ) + // A solution would be to use a custom allocator, with constant timing + // - or a ringbuffer mechanism I think... + + char t[256]; + strcpy (t, fn); + //sprintf(t,"%s",fn); + if (fn && fn!="") { m_GUICH->SetData("Filename",(void*)t); @@ -168,34 +183,34 @@ } inline void DiskWriterPluginGUI::cb_Record_i(Fl_Button* o) -{ - if (o->value()) +{ + if (o->value()) { m_GUICH->SetCommand(DiskWriterPlugin::RECORD); - } - else + } + else { m_GUICH->SetCommand(DiskWriterPlugin::STOP); - } + } } inline void DiskWriterPluginGUI::cb_16bits_i(Fl_Button* o) -{ +{ m_GUICH->Set("BitsPerSample",16); } inline void DiskWriterPluginGUI::cb_24bits_i(Fl_Button* o) -{ +{ m_GUICH->Set("BitsPerSample",24); } inline void DiskWriterPluginGUI::cb_32bits_i(Fl_Button* o) -{ +{ m_GUICH->Set("BitsPerSample",32); } inline void DiskWriterPluginGUI::cb_Stereo_i(Fl_Button* o) -{ +{ m_GUICH->Set("Stereo",o->value()); } diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/DiskWriterPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/DiskWriterPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/DiskWriterPlugin/Makefile.in 2004-01-17 10:32:42.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/DiskWriterPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -10,13 +10,10 @@ CXXFLAGS= @CXXFLAGS@ @FLTK_CXXFLAGS@ INCPATH = -I/usr/X11R6/include LINK = g++ -shared -LFLAGS = +LFLAGS = LIBS = @FLTK_LIBS@ @SFLIBS@ MOC = moc -UIC = - -TAR = tar -cf -GZIP = gzip -9f +UIC = INSTALL = @INSTALL@ @@ -105,13 +102,6 @@ moc: $(SRCMOC) -tmake: - tmake DiskWriterPlugin.pro - -dist: - $(TAR) DiskWriterPlugin.tar DiskWriterPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) DiskWriterPlugin.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/DistributorPlugin/DistributorPlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/DistributorPlugin/DistributorPlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/DistributorPlugin/DistributorPlugin.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/DistributorPlugin/DistributorPlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -14,7 +14,12 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ +*/ + +#include +#include +#include + #include "DistributorPlugin.h" #include "DistributorPluginGUI.h" #include @@ -44,58 +49,186 @@ /////////////////////////////////////////////////////// -DistributorPlugin::DistributorPlugin() : +DistributorPlugin::DistributorPlugin(): m_Triggered (false), m_ChannelSelect (0), m_TrigDelay (0) { + m_PluginInfo.Name = "Distributor"; - m_PluginInfo.Width = 220; - m_PluginInfo.Height = 250; - m_PluginInfo.NumInputs = 2; - m_PluginInfo.NumOutputs = 8; + m_PluginInfo.Width=80; + m_PluginInfo.Height=40; + + m_Version = 2; + m_GUIArgs.ChannelCount = 2; + CreatePorts (); + + m_AudioCH->Register("ChannelCount", &m_GUIArgs.ChannelCount); +} + +DistributorPlugin::~DistributorPlugin() +{ +} + +void DistributorPlugin::CreatePorts (int n, bool AddPorts) +{ + int c; + char t[256]; + + m_PluginInfo.NumInputs = 3; m_PluginInfo.PortTips.push_back ("Stream"); m_PluginInfo.PortTips.push_back ("Switcher"); - m_PluginInfo.PortTips.push_back ("Stream 1"); - m_PluginInfo.PortTips.push_back ("Switcher 1"); - m_PluginInfo.PortTips.push_back ("Stream 2"); - m_PluginInfo.PortTips.push_back ("Switcher 2"); - m_PluginInfo.PortTips.push_back ("Stream 3"); - m_PluginInfo.PortTips.push_back ("Switcher 3"); - m_PluginInfo.PortTips.push_back ("Stream 4"); - m_PluginInfo.PortTips.push_back ("Switcher 4"); + m_PluginInfo.PortTips.push_back ("Reset CV"); + + m_PluginInfo.NumOutputs = n*2; + for (c=1; c<=n; c++) { + sprintf (t, "Stream %d", c); + m_PluginInfo.PortTips.push_back (t); + + sprintf (t, "Switcher %d", c); + m_PluginInfo.PortTips.push_back (t); + } + + if (AddPorts) { + for (int c=0; cBUFSIZE; n++) { - float InpStream = InputExists (Stream) ? GetInput (Stream, n) : 0.0; - float InpSwitch = InputExists (Switch) ? GetInput (Switch, n) : 0.0; - if (InpSwitch <= 0.0) m_Triggered = false; - if (! m_Triggered && (InpSwitch > 0.0)) { - m_Triggered = true; - SetOutput (m_ChannelSelect+Switch, n, 0); - m_ChannelSelect = m_ChannelSelect + 2; - if (m_ChannelSelect > 6) m_ChannelSelect = 0; - m_TrigDelay = 0; - } - SetOutput (m_ChannelSelect+Stream, n, InpStream); - if (m_TrigDelay < 10) { - m_TrigDelay++; - SetOutput (m_ChannelSelect+Switch, n, InpSwitch); - } - else SetOutput (m_ChannelSelect+Switch, n, 0); - } + const int Stream = 0; + const int Switch = 1; + const int Reset = 2; + + for (int n=0; nBUFSIZE; n++) { + float InpStream = InputExists (Stream) ? GetInput (Stream, n) : 0.0; + float InpSwitch = InputExists (Switch) ? GetInput (Switch, n) : 0.0; + float InpReset = InputExists (Reset) ? GetInput (Reset, n) : 0; + + if (InpReset) + { + m_Triggered = false; + m_ChannelSelect = false; + m_TrigDelay = 0; + } + + if (InpSwitch <= 0.0) + m_Triggered = false; + + + if (! m_Triggered && (InpSwitch > 0.0)) + { + m_Triggered = true; + SetOutput (m_ChannelSelect+Switch, n, 0); + m_ChannelSelect = m_ChannelSelect + 2; + if (m_ChannelSelect >= (GetChannelCount()*2)) + m_ChannelSelect = 0; + + m_TrigDelay = 0; + } + + SetOutput (m_ChannelSelect+Stream, n, InpStream); + + if (m_TrigDelay < 10) + { + m_TrigDelay++; + SetOutput (m_ChannelSelect+Switch, n, InpSwitch); + } + else + { + SetOutput (m_ChannelSelect+Switch, n, 0); + } + } +} + +void DistributorPlugin::ExecuteCommands () +{ + if (m_AudioCH->IsCommandWaiting ()) + { + switch (m_AudioCH->GetCommand()) { + case SETCHANNELCOUNT : + { + SetChannelCount(GetChannelCount()); + } + break; + } + } +} + +void DistributorPlugin::StreamOut (ostream &s) +{ + s << m_Version << " " << GetChannelCount() << " "; +} + +void DistributorPlugin::StreamIn (istream &s) +{ + char Test; + int Version, Channels; + + s.seekg (2, ios::cur );//skip to next line + Test = s.peek();//peek first char + s.seekg (-2, ios::cur );//jump back to prior line + + if ( (Test >= '0') && (Test <= '9') ) + { + s >> Version; + } + else + { + //No Version, so use Version 1 + Version = 1; + } + + switch (Version) + { + case 2: + { + s >> Channels; + SetChannelCount (Channels); + } + break; + + case 1: + { + //use original fixed defaults + SetChannelCount (4); + } + break; + } } diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/DistributorPlugin/DistributorPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/DistributorPlugin/DistributorPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/DistributorPlugin/DistributorPluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/DistributorPlugin/DistributorPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -18,6 +18,7 @@ #include "DistributorPluginGUI.h" #include +#include using namespace std; @@ -26,13 +27,48 @@ DistributorPluginGUI::DistributorPluginGUI(int w, int h,DistributorPlugin *o,ChannelHandler *ch,const HostInfo *Info) : SpiralPluginGUI(w,h,o,ch) { + m_Chans = new Fl_Counter (15, 20, 50, 15, "Channels"); + m_Chans->labelsize (8); + m_Chans->textsize (8); + m_Chans->type (FL_SIMPLE_COUNTER); + m_Chans->box (FL_PLASTIC_UP_BOX); + m_Chans->color (Info->GUI_COLOUR); + m_Chans->selection_color (Info->GUI_COLOUR); + m_Chans->step (1); + m_Chans->value (2); + m_Chans->callback ((Fl_Callback*) cb_Chans, this); + add (m_Chans); + end(); } +void DistributorPluginGUI::Update() +{ +} void DistributorPluginGUI::UpdateValues(SpiralPlugin *o) { + DistributorPlugin* Plugin = (DistributorPlugin*)o; + m_Chans->value (Plugin->GetChannelCount()); } +inline void DistributorPluginGUI::cb_Chans_i (Fl_Counter* o) +{ + if (o->value() < 2) + { + o->value(2); + } + else { + m_GUICH->Set ("ChannelCount", int (o->value ())); + m_GUICH->SetCommand (DistributorPlugin::SETCHANNELCOUNT); + m_GUICH->Wait (); + Resize (w(), h()); + } +} +const string DistributorPluginGUI::GetHelpText(const string &loc) +{ + return string("") + + "The Distributor plugin is for polyphony. NEED MORE INFO HERE.\n"; +} diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/DistributorPlugin/DistributorPluginGUI.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/DistributorPlugin/DistributorPluginGUI.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/DistributorPlugin/DistributorPluginGUI.h 2003-06-21 09:03:09.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/DistributorPlugin/DistributorPluginGUI.h 2012-05-31 04:13:57.000000000 +0000 @@ -17,6 +17,7 @@ */ #include +#include #include "DistributorPlugin.h" #include "../SpiralPluginGUI.h" @@ -27,11 +28,18 @@ { public: DistributorPluginGUI(int w, int h, DistributorPlugin *o,ChannelHandler *ch,const HostInfo *Info); + virtual void UpdateValues(SpiralPlugin *o); + virtual void Update (); + +protected: + const std::string GetHelpText(const std::string &loc); private: + Fl_Counter *m_Chans; - //// Callbacks //// + inline void cb_Chans_i (Fl_Counter* o); + static void cb_Chans(Fl_Counter* o, DistributorPluginGUI* v) {v->cb_Chans_i(o);} }; #endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/DistributorPlugin/DistributorPlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/DistributorPlugin/DistributorPlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/DistributorPlugin/DistributorPlugin.h 2003-11-22 20:40:14.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/DistributorPlugin/DistributorPlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -23,17 +23,36 @@ #include class DistributorPlugin : public SpiralPlugin { - public: - DistributorPlugin(); - virtual ~DistributorPlugin(); - virtual PluginInfo& Initialise (const HostInfo *Host); - virtual SpiralGUIType* CreateGUI(); - virtual void Execute(); - virtual void StreamOut (std::ostream &s) { } - virtual void StreamIn (std::istream &s) { } - private: - bool m_Triggered; - int m_ChannelSelect, m_TrigDelay; +public: + DistributorPlugin(); + virtual ~DistributorPlugin(); + + virtual PluginInfo& Initialise(const HostInfo *Host); + virtual SpiralGUIType* CreateGUI (); + + virtual void Execute(); + virtual void Reset(); + virtual void ExecuteCommands(); + + virtual void StreamOut(std::ostream &s); + virtual void StreamIn(std::istream &s); + + int GetChannelCount (void) { return m_GUIArgs.ChannelCount; } + void SetChannelCount (int count); + + enum GUICommands { NONE, SETCHANNELCOUNT }; + struct GUIArgs { + int ChannelCount; + }; +private: + GUIArgs m_GUIArgs; + + int m_Version; + + bool m_Triggered; + int m_ChannelSelect, m_TrigDelay; + + void CreatePorts (int n = 2, bool AddPorts = false); }; #endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/DistributorPlugin/DistributorPlugin.pro spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/DistributorPlugin/DistributorPlugin.pro --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/DistributorPlugin/DistributorPlugin.pro 2002-07-28 23:18:18.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/DistributorPlugin/DistributorPlugin.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -HEADERS = ../SpiralPlugin.h \ - ../SpiralPluginGUI.h \ - ../Widgets/Fl_Knob.H \ - ../Widgets/Fl_DragBar.H \ - ../../Sample.h \ - DistributorPlugin.h \ - DistributorPluginGUI.h - -SOURCES = ../SpiralPlugin.C \ - ../SpiralPluginGUI.C \ - ../Widgets/Fl_Knob.cxx \ - ../Widgets/Fl_DragBar.cxx \ - ../../Sample.C \ - DistributorPlugin.C \ - DistributorPluginGUI.C - -TARGET = DistributorPlugin.so - diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/DistributorPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/DistributorPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/DistributorPlugin/Makefile.in 2004-01-17 10:32:42.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/DistributorPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -13,10 +13,7 @@ LFLAGS = LIBS = @FLTK_LIBS@ MOC = moc -UIC = - -TAR = tar -cf -GZIP = gzip -9f +UIC = INSTALL = @INSTALL@ @@ -96,13 +93,6 @@ moc: $(SRCMOC) -tmake: - tmake DistributorPlugin.pro - -dist: - $(TAR) DistributorPlugin.tar DistributorPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) DistributorPlugin.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/EchoPlugin/EchoPlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/EchoPlugin/EchoPlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/EchoPlugin/EchoPlugin.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/EchoPlugin/EchoPlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -89,6 +89,20 @@ return new EchoPluginGUI (m_PluginInfo.Width, m_PluginInfo.Height, this, m_AudioCH, m_HostInfo); } +void EchoPlugin::Reset() +{ + ResetPorts(); + m_Buffer[0].Clear(); + m_Buffer[0].Allocate ((int)(m_HostInfo->SAMPLERATE * MAX_DELAY)); + + m_Buffer[1].Clear(); + m_Buffer[1].Allocate ((int)(m_HostInfo->SAMPLERATE * MAX_DELAY)); + + m_HeadPos = 0; + m_Buf0 = 0; + m_Buf1 = 1; +} + void EchoPlugin::Execute() { float Delay; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/EchoPlugin/EchoPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/EchoPlugin/EchoPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/EchoPlugin/EchoPluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/EchoPlugin/EchoPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -18,6 +18,7 @@ #include "EchoPluginGUI.h" #include +#include using namespace std; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/EchoPlugin/EchoPlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/EchoPlugin/EchoPlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/EchoPlugin/EchoPlugin.h 2003-08-08 17:04:47.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/EchoPlugin/EchoPlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -30,6 +30,8 @@ virtual PluginInfo &Initialise (const HostInfo *Host); virtual SpiralGUIType *CreateGUI(); virtual void Execute(); + virtual void Reset(); + virtual void StreamOut (std::ostream &s); virtual void StreamIn (std::istream &s); float GetDelay() { return m_Delay; } diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/EchoPlugin/EchoPlugin.pro spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/EchoPlugin/EchoPlugin.pro --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/EchoPlugin/EchoPlugin.pro 2002-07-28 23:18:16.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/EchoPlugin/EchoPlugin.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -HEADERS = ../SpiralPlugin.h \ - ../SpiralPluginGUI.h \ - ../Widgets/Fl_Knob.H \ - ../Widgets/Fl_DragBar.H \ - ../../Sample.h \ - EchoPlugin.h \ - EchoPluginGUI.h - -SOURCES = ../SpiralPlugin.C \ - ../SpiralPluginGUI.C \ - ../Widgets/Fl_Knob.cxx \ - ../Widgets/Fl_DragBar.cxx \ - ../../Sample.C \ - EchoPlugin.C \ - EchoPluginGUI.C - -TARGET = EchoPlugin.so diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/EchoPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/EchoPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/EchoPlugin/Makefile.in 2004-01-17 10:32:42.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/EchoPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -13,10 +13,7 @@ LFLAGS = LIBS = @FLTK_LIBS@ MOC = moc -UIC = - -TAR = tar -cf -GZIP = gzip -9f +UIC = INSTALL = @INSTALL@ @@ -102,13 +99,6 @@ moc: $(SRCMOC) -tmake: - tmake EchoPlugin.pro - -dist: - $(TAR) EchoPlugin.tar EchoPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) EchoPlugin.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/Edit.sh spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/Edit.sh --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/Edit.sh 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/Edit.sh 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,10 @@ +#! /bin/sh + +for file in `cat PluginList.txt` +do +echo $file +cd $file/ +chmod +w $file.C +python ../sr.py $file.C ../sr.csv +cd .. +done diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/EnvelopePlugin/EnvelopePlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/EnvelopePlugin/EnvelopePlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/EnvelopePlugin/EnvelopePlugin.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/EnvelopePlugin/EnvelopePlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -22,6 +22,10 @@ using namespace std; +// a bit of a crap filter to smooth clicks +static float SMOOTH = 0.99; +static float ONEMINUS_SMOOTH = 1-SMOOTH; + extern "C" { SpiralPlugin* SpiralPlugin_CreateInstance() { @@ -54,7 +58,8 @@ m_Sustain(1.0f), m_Release(1.0f), m_Volume(0.5f), -m_TrigThresh(0.01) +m_TrigThresh(0.01), +m_Current(0) { m_PluginInfo.Name="Envelope"; m_PluginInfo.Width=142; @@ -85,6 +90,14 @@ return Info; } +void EnvelopePlugin::Reset() +{ + ResetPorts(); + m_SampleTime=1.0/(float)(m_HostInfo->SAMPLERATE); + m_Trigger = false; + m_t = -1.0f; +} + SpiralGUIType *EnvelopePlugin::CreateGUI() { return new EnvelopePluginGUI(m_PluginInfo.Width, @@ -97,14 +110,6 @@ float temp=0; bool Freeze=false; - // Early out? - /*if (m_t<0 && (!m_Input[0] || m_Input[0]->IsEmpty())) - { - m_Output[0]->Zero(); - m_Output[1]->Zero(); - return; - }*/ - for (int n=0; nBUFSIZE; n++) { // Check the trigger CV values @@ -163,22 +168,33 @@ temp*=m_Volume; + if (!feq(temp,m_Current,0.01)) + { + // only filter if necc + temp=(temp*ONEMINUS_SMOOTH+m_Current*SMOOTH); + } + SetOutput(0,n,temp); SetOutput(1,n,GetInput(1,n)*temp); + m_Current=temp; if (!Freeze) m_t+=m_SampleTime; } else { - SetOutput(0,n,0); - SetOutput(1,n,0); + if (!feq(temp,m_Current,0.01)) + { + temp=m_Current*SMOOTH; + } + + SetOutput(0,n,temp); + SetOutput(1,n,GetInput(1,n)*temp); + m_Current=temp; // if we've run off the end if (m_t>m_Attack+m_Decay+m_Release) { m_t=-1; - //m_Output[0]->Zero(); - //m_Output[1]->Zero(); return; } diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/EnvelopePlugin/EnvelopePluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/EnvelopePlugin/EnvelopePluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/EnvelopePlugin/EnvelopePluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/EnvelopePlugin/EnvelopePluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -18,6 +18,7 @@ #include "EnvelopePluginGUI.h" #include +#include using namespace std; @@ -44,7 +45,7 @@ m_Thresh->box (FL_PLASTIC_DOWN_BOX); m_Thresh->labelsize (10); m_Thresh->maximum (1.0); - m_Thresh->step (0.01); + m_Thresh->step (0.0001); m_Thresh->value (0.99f); m_Thresh->callback ((Fl_Callback*)cb_Thresh); m_CtlGroup->add (m_Thresh); @@ -56,7 +57,7 @@ m_Attack->box (FL_PLASTIC_DOWN_BOX); m_Attack->labelsize (10); m_Attack->maximum (TIMED_SLIDER_MAX); - m_Attack->step (0.01); + m_Attack->step (0.0001); m_Attack->value (3.0f); m_Attack->callback ((Fl_Callback*)cb_Attack); m_CtlGroup->add (m_Attack); @@ -68,7 +69,7 @@ m_Decay->box (FL_PLASTIC_DOWN_BOX); m_Decay->labelsize (10); m_Decay->maximum (TIMED_SLIDER_MAX); - m_Decay->step (0.01); + m_Decay->step (0.0001); m_Decay->value (2.29); m_Decay->callback ((Fl_Callback*)cb_Decay); m_CtlGroup->add (m_Decay); @@ -80,7 +81,7 @@ m_Sustain->box (FL_PLASTIC_DOWN_BOX); m_Sustain->labelsize (10); m_Sustain->maximum (1); - m_Sustain->step (0.01); + m_Sustain->step (0.0001); m_Sustain->value (0.0); m_Sustain->callback ((Fl_Callback*)cb_Sustain); m_CtlGroup->add (m_Sustain); @@ -92,7 +93,7 @@ m_Release->box (FL_PLASTIC_DOWN_BOX); m_Release->labelsize (10); m_Release->maximum (TIMED_SLIDER_MAX); - m_Release->step (0.01); + m_Release->step (0.0001); m_Release->value (2.0); m_Release->callback ((Fl_Callback*)cb_Release); m_CtlGroup->add (m_Release); @@ -104,7 +105,7 @@ m_Volume->box (FL_PLASTIC_DOWN_BOX); m_Volume->labelsize (10); m_Volume->maximum (1); - m_Volume->step (0.01); + m_Volume->step (0.0001); m_Volume->value (0.5f); m_Volume->callback ((Fl_Callback*)cb_Volume); m_CtlGroup->add (m_Volume); @@ -134,7 +135,7 @@ m_NumAttack->labelsize (8); m_NumAttack->maximum (TIMED_SLIDER_MAX * TIMED_SLIDER_MAX); m_NumAttack->minimum (0); - m_NumAttack->step (0.1); + m_NumAttack->step (0.001); m_NumAttack->value (0); m_NumAttack->callback ((Fl_Callback*)cb_NumAttack); m_NumGroup->add (m_NumAttack); @@ -147,7 +148,7 @@ m_NumDecay->labelsize (8); m_NumDecay->maximum (TIMED_SLIDER_MAX * TIMED_SLIDER_MAX); m_NumDecay->minimum (0); - m_NumDecay->step (0.1); + m_NumDecay->step (0.001); m_NumDecay->value (0.5); m_NumDecay->callback ((Fl_Callback*)cb_NumDecay); m_NumGroup->add (m_NumDecay); @@ -173,7 +174,7 @@ m_NumRelease->labelsize (8); m_NumRelease->maximum (TIMED_SLIDER_MAX * TIMED_SLIDER_MAX); m_NumRelease->minimum (0); - m_NumRelease->step (0.1); + m_NumRelease->step (0.001); m_NumRelease->value (1.0); m_NumRelease->callback ((Fl_Callback*)cb_NumRelease); m_NumGroup->add (m_NumRelease); diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/EnvelopePlugin/EnvelopePlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/EnvelopePlugin/EnvelopePlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/EnvelopePlugin/EnvelopePlugin.h 2003-08-08 17:04:48.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/EnvelopePlugin/EnvelopePlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -33,6 +33,8 @@ virtual PluginInfo &Initialise(const HostInfo *Host); virtual SpiralGUIType *CreateGUI(); virtual void Execute(); + virtual void Reset(); + virtual void StreamOut(std::ostream &s); virtual void StreamIn(std::istream &s); @@ -57,6 +59,8 @@ float m_TrigThresh; float m_SampleTime; + float m_Current; + friend std::istream &operator>>(std::istream &s, EnvelopePlugin &o); friend std::ostream &operator<<(std::ostream &s, EnvelopePlugin &o); }; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/EnvelopePlugin/EnvelopePlugin.pro spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/EnvelopePlugin/EnvelopePlugin.pro --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/EnvelopePlugin/EnvelopePlugin.pro 2002-07-28 23:18:15.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/EnvelopePlugin/EnvelopePlugin.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -HEADERS = ../SpiralPlugin.h \ - ../SpiralPluginGUI.h \ - ../Widgets/Fl_Knob.H \ - ../Widgets/Fl_DragBar.H \ - ../../Sample.h \ - EnvelopePlugin.h \ - EnvelopePluginGUI.h - -SOURCES = ../SpiralPlugin.C \ - ../SpiralPluginGUI.C \ - ../Widgets/Fl_Knob.cxx \ - ../Widgets/Fl_DragBar.cxx \ - ../../Sample.C \ - EnvelopePlugin.C \ - EnvelopePluginGUI.C - -TARGET = EnvelopePlugin.so diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/EnvelopePlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/EnvelopePlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/EnvelopePlugin/Makefile.in 2004-01-17 10:32:42.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/EnvelopePlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -13,10 +13,7 @@ LFLAGS = LIBS = @FLTK_LIBS@ MOC = moc -UIC = - -TAR = tar -cf -GZIP = gzip -9f +UIC = INSTALL = @INSTALL@ @@ -99,13 +96,6 @@ moc: $(SRCMOC) -tmake: - tmake EnvelopePlugin.pro - -dist: - $(TAR) EnvelopePlugin.tar EnvelopePlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) EnvelopePlugin.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/EnvFollowerPlugin/EnvFollowerPlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/EnvFollowerPlugin/EnvFollowerPlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/EnvFollowerPlugin/EnvFollowerPlugin.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/EnvFollowerPlugin/EnvFollowerPlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -79,6 +79,12 @@ this,m_AudioCH,m_HostInfo); } +void EnvFollowerPlugin::Reset() +{ + ResetPorts(); + m_Value = 0; +} + void EnvFollowerPlugin::Execute() { float Value; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/EnvFollowerPlugin/EnvFollowerPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/EnvFollowerPlugin/EnvFollowerPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/EnvFollowerPlugin/EnvFollowerPluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/EnvFollowerPlugin/EnvFollowerPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -18,6 +18,7 @@ #include "EnvFollowerPluginGUI.h" #include +#include using namespace std; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/EnvFollowerPlugin/EnvFollowerPlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/EnvFollowerPlugin/EnvFollowerPlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/EnvFollowerPlugin/EnvFollowerPlugin.h 2003-08-08 17:04:48.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/EnvFollowerPlugin/EnvFollowerPlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -31,6 +31,8 @@ virtual PluginInfo& Initialise(const HostInfo *Host); virtual SpiralGUIType* CreateGUI(); virtual void Execute(); + virtual void Reset(); + virtual void StreamOut(std::ostream &s); virtual void StreamIn(std::istream &s); diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/EnvFollowerPlugin/EnvFollowerPlugin.pro spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/EnvFollowerPlugin/EnvFollowerPlugin.pro --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/EnvFollowerPlugin/EnvFollowerPlugin.pro 2002-07-28 23:18:16.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/EnvFollowerPlugin/EnvFollowerPlugin.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -HEADERS = ../SpiralPlugin.h \ - ../SpiralPluginGUI.h \ - ../Widgets/Fl_Knob.H \ - ../Widgets/Fl_DragBar.H \ - ../../Sample.h \ - EnvFollowerPlugin.h \ - EnvFollowerPluginGUI.h - -SOURCES = ../SpiralPlugin.C \ - ../SpiralPluginGUI.C \ - ../Widgets/Fl_Knob.cxx \ - ../Widgets/Fl_DragBar.cxx \ - ../../Sample.C \ - EnvFollowerPlugin.C \ - EnvFollowerPluginGUI.C - -TARGET = EnvFollowerPlugin.so diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/EnvFollowerPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/EnvFollowerPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/EnvFollowerPlugin/Makefile.in 2004-01-17 10:32:42.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/EnvFollowerPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -13,10 +13,7 @@ LFLAGS = LIBS = @FLTK_LIBS@ MOC = moc -UIC = - -TAR = tar -cf -GZIP = gzip -9f +UIC = INSTALL = @INSTALL@ @@ -99,13 +96,6 @@ moc: $(SRCMOC) -tmake: - tmake EnvFollowerPlugin.pro - -dist: - $(TAR) EnvFollowerPlugin.tar EnvFollowerPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) EnvFollowerPlugin.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/FilterPlugin/FilterPlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/FilterPlugin/FilterPlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/FilterPlugin/FilterPlugin.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/FilterPlugin/FilterPlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -110,61 +110,81 @@ this,m_AudioCH,m_HostInfo); } +void FilterPlugin::Reset() +{ + ResetPorts(); + + fs=m_HostInfo->SAMPLERATE; + SetupCoeffs(); +} + void FilterPlugin::Execute() { float Cutoff; - float Resonance; + float Resonance; + float out, in; - if (fc<0) return; + if (fc<0) return; - for (int n=0; nBUFSIZE; n++) + for (int n=0; nBUFSIZE; n++) { - coef = iir.coef + 1; /* Skip k, or gain */ - k=0.25; + + //reset memory if disconnected, and skip out (prevents CPU spike) + if (! InputExists(0)) + { + out = 0; + } + else + { + in = GetInput(0,n); + + // work around denormal calculation CPU spikes where in --> 0 + if ((in >= 0) && (in < 0.000000001)) + in += 0.000000001; + else + if ((in <= 0) && (in > -0.000000001)) + in -= 0.000000001; + + coef = iir.coef + 1; /* Skip k, or gain */ + k=0.25; - Cutoff = fc + (GetInput(1,n) * 1000); - Resonance = Q + GetInput(2,n); + Cutoff = fc + (GetInput(1,n) * 1000); + Resonance = Q + GetInput(2,n); - Cutoff/=2; + Cutoff/=2; - if (Resonance>MAX_RES) Resonance=MAX_RES; - if (Cutoff>MAX_CUTOFF) Cutoff=MAX_CUTOFF; - if (ResonanceMAX_RES) Resonance=MAX_RES; + if (Cutoff>MAX_CUTOFF) Cutoff=MAX_CUTOFF; + if (ResonanceSet(n,0); - //} - } - + out = iir_filter(in/0.5f,&iir); + } + + SetOutput(0,n,out); + } } void FilterPlugin::StreamOut(ostream &s) @@ -182,16 +202,16 @@ void FilterPlugin::SetupCoeffs() { ProtoCoef[0].a0 = 1.0; - ProtoCoef[0].a1 = 0; - ProtoCoef[0].a2 = 0; - ProtoCoef[0].b0 = 1.0; - ProtoCoef[0].b1 = 0.765367; - ProtoCoef[0].b2 = 1.0; - - ProtoCoef[1].a0 = 1.0; - ProtoCoef[1].a1 = 0; - ProtoCoef[1].a2 = 0; - ProtoCoef[1].b0 = 1.0; - ProtoCoef[1].b1 = 1.847759; - ProtoCoef[1].b2 = 1.0; + ProtoCoef[0].a1 = 0; + ProtoCoef[0].a2 = 0; + ProtoCoef[0].b0 = 1.0; + ProtoCoef[0].b1 = 0.765367; + ProtoCoef[0].b2 = 1.0; + + ProtoCoef[1].a0 = 1.0; + ProtoCoef[1].a1 = 0; + ProtoCoef[1].a2 = 0; + ProtoCoef[1].b0 = 1.0; + ProtoCoef[1].b1 = 1.847759; + ProtoCoef[1].b2 = 1.0; } diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/FilterPlugin/FilterPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/FilterPlugin/FilterPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/FilterPlugin/FilterPluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/FilterPlugin/FilterPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -18,6 +18,7 @@ #include "FilterPluginGUI.h" #include +#include using namespace std; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/FilterPlugin/FilterPlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/FilterPlugin/FilterPlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/FilterPlugin/FilterPlugin.h 2003-08-08 17:04:48.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/FilterPlugin/FilterPlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -37,7 +37,7 @@ virtual void StreamOut(std::ostream &s); virtual void StreamIn(std::istream &s); - void Reset(); + virtual void Reset(); void SetupCoeffs(); double GetCutoff() {return fc;} diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/FilterPlugin/FilterPlugin.pro spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/FilterPlugin/FilterPlugin.pro --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/FilterPlugin/FilterPlugin.pro 2002-07-28 23:18:15.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/FilterPlugin/FilterPlugin.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -HEADERS = ../SpiralPlugin.h \ - ../SpiralPluginGUI.h \ - ../Widgets/Fl_Knob.H \ - ../Widgets/Fl_DragBar.H \ - ../../Sample.h \ - iir_filter.h \ - FilterPlugin.h \ - FilterPluginGUI.h - -SOURCES = ../SpiralPlugin.C \ - ../SpiralPluginGUI.C \ - ../Widgets/Fl_Knob.cxx \ - ../Widgets/Fl_DragBar.cxx \ - ../../Sample.C \ - iir_filter.C \ - FilterPlugin.C \ - FilterPluginGUI.C - -TARGET = FilterPlugin.so diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/FilterPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/FilterPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/FilterPlugin/Makefile.in 2004-01-17 10:32:42.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/FilterPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -13,10 +13,7 @@ LFLAGS = LIBS = @FLTK_LIBS@ MOC = moc -UIC = - -TAR = tar -cf -GZIP = gzip -9f +UIC = INSTALL = @INSTALL@ @@ -102,13 +99,6 @@ moc: $(SRCMOC) -tmake: - tmake FilterPlugin.pro - -dist: - $(TAR) FilterPlugin.tar FilterPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) FilterPlugin.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/FlipflopPlugin/FlipflopPlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/FlipflopPlugin/FlipflopPlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/FlipflopPlugin/FlipflopPlugin.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/FlipflopPlugin/FlipflopPlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -84,6 +84,15 @@ this,m_AudioCH,m_HostInfo); } +void FlipflopPlugin::Reset() +{ + ResetPorts(); + m_Current = 0; + m_Triggered = false; + m_CurrentLevel = 1.0f; + m_TriggerSamples = 0; +} + void FlipflopPlugin::Execute() { bool Triggered; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/FlipflopPlugin/FlipflopPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/FlipflopPlugin/FlipflopPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/FlipflopPlugin/FlipflopPluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/FlipflopPlugin/FlipflopPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -18,6 +18,7 @@ #include "FlipflopPluginGUI.h" #include +#include using namespace std; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/FlipflopPlugin/FlipflopPlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/FlipflopPlugin/FlipflopPlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/FlipflopPlugin/FlipflopPlugin.h 2003-08-08 17:04:48.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/FlipflopPlugin/FlipflopPlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -31,6 +31,7 @@ virtual PluginInfo& Initialise(const HostInfo *Host); virtual SpiralGUIType* CreateGUI(); virtual void Execute(); + virtual void Reset(); virtual void ExecuteCommands(); virtual void StreamOut(std::ostream &s); virtual void StreamIn(std::istream &s); diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/FlipflopPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/FlipflopPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/FlipflopPlugin/Makefile.in 2004-01-17 10:32:42.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/FlipflopPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -13,10 +13,7 @@ LFLAGS = LIBS = @FLTK_LIBS@ MOC = moc -UIC = - -TAR = tar -cf -GZIP = gzip -9f +UIC = INSTALL = @INSTALL@ diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/FormantFilterPlugin/FormantFilterPlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/FormantFilterPlugin/FormantFilterPlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/FormantFilterPlugin/FormantFilterPlugin.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/FormantFilterPlugin/FormantFilterPlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -82,13 +82,7 @@ FormantFilterPlugin::FormantFilterPlugin() : m_Vowel(0) { - for (int i = 0; i < 5; i++) - { - for (int j = 0; j < 10; j++) - { - memory[i][j] = 0; - } - } + Clear(); m_PluginInfo.Name="FormantFilter"; m_PluginInfo.Width=90; @@ -118,6 +112,13 @@ this,m_AudioCH,m_HostInfo); } +void FormantFilterPlugin::Reset() +{ + ResetPorts(); + Clear(); + +} + void FormantFilterPlugin::Execute() { float res,o[5],out=0, in=0; @@ -127,19 +128,20 @@ //reset memory if disconnected, and skip out (prevents CPU spike) if (! InputExists(0)) { - for (int i = 0; i < 5; i++) - { - for (int j = 0; j < 10; j++) - { - memory[i][j] = 0; - } - } + Clear(); out = 0; } else { in = GetInput(0,n); + // work around denormal calculation CPU spikes where in --> 0 + if ((in >= 0) && (in < 0.000000001)) + in += 0.000000001; + else + if ((in <= 0) && (in > -0.000000001)) + in -= 0.000000001; + for (int v=0; v<5; v++) { res= (float) (coeff[v][0]*(in*0.1f) + @@ -174,11 +176,30 @@ } // mix between vowel sounds - if (m_Vowel<1) out=Linear(0,1,m_Vowel,o[1],o[0]); - else if (m_Vowel>1 && m_Vowel<2) out=Linear(0,1,m_Vowel-1.0f,o[2],o[1]); - else if (m_Vowel>2 && m_Vowel<3) out=Linear(0,1,m_Vowel-2.0f,o[3],o[2]); - else if (m_Vowel>3 && m_Vowel<4) out=Linear(0,1,m_Vowel-3.0f,o[4],o[3]); - else if (m_Vowel==4) out=o[4]; + if (m_Vowel<1) + { + out=Linear(0,1,m_Vowel,o[1],o[0]); + } + else + if (m_Vowel>1 && m_Vowel<2) + { + out=Linear(0,1,m_Vowel-1.0f,o[2],o[1]); + } + else + if (m_Vowel>2 && m_Vowel<3) + { + out=Linear(0,1,m_Vowel-2.0f,o[3],o[2]); + } + else + if (m_Vowel>3 && m_Vowel<4) + { + out=Linear(0,1,m_Vowel-3.0f,o[4],o[3]); + } + else + if (m_Vowel==4) + { + out=o[4]; + } } SetOutput(0,n,out); } @@ -188,6 +209,18 @@ void FormantFilterPlugin::Randomise() { } + + +void FormantFilterPlugin::Clear() +{ + for (int i = 0; i < 5; i++) + { + for (int j = 0; j < 10; j++) + { + memory[i][j] = 0; + } + } +} void FormantFilterPlugin::StreamOut(ostream &s) { diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/FormantFilterPlugin/FormantFilterPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/FormantFilterPlugin/FormantFilterPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/FormantFilterPlugin/FormantFilterPluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/FormantFilterPlugin/FormantFilterPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -18,6 +18,7 @@ #include "FormantFilterPluginGUI.h" #include +#include using namespace std; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/FormantFilterPlugin/FormantFilterPlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/FormantFilterPlugin/FormantFilterPlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/FormantFilterPlugin/FormantFilterPlugin.h 2004-01-03 13:09:43.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/FormantFilterPlugin/FormantFilterPlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -31,6 +31,8 @@ virtual PluginInfo &Initialise(const HostInfo *Host); virtual SpiralGUIType *CreateGUI(); virtual void Execute(); + virtual void Reset(); + virtual void StreamOut(std::ostream &s); virtual void StreamIn(std::istream &s); diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/FormantFilterPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/FormantFilterPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/FormantFilterPlugin/Makefile.in 2004-01-17 10:32:42.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/FormantFilterPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -13,10 +13,7 @@ LFLAGS = LIBS = @FLTK_LIBS@ MOC = moc -UIC = - -TAR = tar -cf -GZIP = gzip -9f +UIC = INSTALL = @INSTALL@ @@ -99,13 +96,6 @@ moc: $(SRCMOC) -tmake: - tmake FormantFilterPlugin.pro - -dist: - $(TAR) FormantFilterPlugin.tar FormantFilterPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) FormantFilterPlugin.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/GUI/WaveChooser.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/GUI/WaveChooser.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/GUI/WaveChooser.C 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/GUI/WaveChooser.C 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,98 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include "WaveChooser.h" +#include +#include +#include "../../../config.h" + +using namespace std; + +#ifdef USE_LIBSNDFILE +#include +#endif + +// As this stands, we get one load dialog per plugin, +// I'd rather have just ONE dialog for all plugins + +// large chunks of this are based on fl_file_chooser() from the FLTK source code + +// strlcpy() and strlcat() are some really useful BSD string functions +// that work the way strncpy() and strncat() *should* have worked. + +size_t our_strlcpy (char *dst, const char *src, size_t size) { + size_t srclen; + size--; + srclen = strlen (src); + if (srclen > size) srclen = size; + memcpy (dst, src, srclen); + dst[srclen] = '\0'; + return (srclen); +} + +static Fl_File_Chooser *fc = (Fl_File_Chooser *)0; + +static void (*current_callback)(const char*) = 0; + +static void callback(Fl_File_Chooser *, void*) { + if (current_callback && fc->value()) (*current_callback)(fc->value()); +} + +static char retname[1024]; + +char *WaveFileName (void) { + string AvailFmt; + #ifdef USE_LIBSNDFILE + string FmtName; + SF_FORMAT_INFO info; + int major_count, m, p; + sf_command (NULL, SFC_GET_FORMAT_MAJOR_COUNT, &major_count, sizeof (int)); + for (m = 0 ; m < major_count ; m++) { + info.format = m; + sf_command (NULL, SFC_GET_FORMAT_MAJOR, &info, sizeof (info)); + FmtName = info.name; + while ((p=FmtName.find ('(')) >= 0 ) FmtName.replace (p, 1, "["); + while ((p=FmtName.find (')')) >= 0 ) FmtName.replace (p, 1, "]"); + if (!AvailFmt.empty()) AvailFmt += '\t'; + AvailFmt += (string)FmtName + (string)" (*." + (string)info.extension + ')'; + } + #else + AvailFmt = "{*.wav,*.WAV}"; + #endif + char *fname; + char *title = "Load a wave"; + if (!fc) { + fname = "."; + // as ever, I'm a bit worried that this is never deallocated + fc = new Fl_File_Chooser (fname, AvailFmt.c_str(), Fl_File_Chooser::CREATE, title); + fc->callback (callback, 0); + } else { + // strip away the old filename, but keep the directory + our_strlcpy (retname, fc->value(), sizeof(retname)); + char *p = strrchr(retname, '/'); + if (p) { + if (p == retname) retname[1] = '\0'; + else *p = '\0'; + } + fc->directory (retname); + } + fc->show(); + while (fc->shown()) Fl::wait(); + if (fc->value()) return (char *)fc->value(); + else return 0; +} diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/GUI/WaveChooser.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/GUI/WaveChooser.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/GUI/WaveChooser.h 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/GUI/WaveChooser.h 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,24 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef WaveChooser +#define WaveChooser + +char *WaveFileName (void); + +#endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/JackPlugin/JackPlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/JackPlugin/JackPlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/JackPlugin/JackPlugin.C 2004-02-08 23:45:33.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/JackPlugin/JackPlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -28,7 +28,7 @@ int JackClient::JackProcessInstanceID = -1; int JackPlugin::JackInstanceCount = 0; - +const HostInfo *host = NULL; ///////////////////////////////////////////////////////////////////////////////////////////// inline void JackClient::JackProcess_i(jack_nframes_t nframes) { @@ -39,7 +39,10 @@ if (jack_port_connected(m_InputPortMap[n]->Port)) { sample_t *in = (sample_t *) jack_port_get_buffer(m_InputPortMap[n]->Port, nframes); - memcpy (m_InputPortMap[n]->Buf, in, sizeof (sample_t) * GetBufferSize()); + + assert( m_InputPortMap[n]->Buf ); + + memcpy( m_InputPortMap[n]->Buf, in, sizeof (sample_t) * GetBufferSize()); } } @@ -47,15 +50,18 @@ { if (jack_port_connected(m_OutputPortMap[n]->Port)) { - if (m_OutputPortMap[n]->Buf) + if ((m_OutputPortMap[n]->Buf) && (!host->PAUSED)) { sample_t *out = (sample_t *) jack_port_get_buffer(m_OutputPortMap[n]->Port, nframes); + + assert( m_OutputPortMap[n]->Buf ); + memcpy (out, m_OutputPortMap[n]->Buf, sizeof (sample_t) * GetBufferSize()); } else // no output availible, clear { sample_t *out = (sample_t *) jack_port_get_buffer(m_OutputPortMap[n]->Port, nframes); - memset (out, 0, sizeof (sample_t) * GetBufferSize()); + memset(out, 0, sizeof (sample_t) * GetBufferSize()); } } } @@ -103,6 +109,8 @@ m_JackInputCount = 4; m_JackOutputCount = 4; m_Client=NULL; + m_JackSampleRate = -1; + m_JackBufferSize = -1; } ///////////////////////////////////////////////////////////////////////////////////////////// @@ -191,6 +199,9 @@ return false; } + m_JackSampleRate = jack_get_sample_rate(m_Client); + m_JackBufferSize = jack_get_buffer_size(m_Client); + jack_set_process_callback(m_Client, JackProcess, this); jack_set_sample_rate_callback (m_Client, SampleRateChange, this); jack_on_shutdown (m_Client, JackShutdown, this); @@ -204,6 +215,8 @@ for (int n=0; nDetach(); - delete m_JackClient; - m_JackClient=NULL; - return true; -} - PluginInfo &JackPlugin::Initialise(const HostInfo *Host) { PluginInfo& Info= SpiralPlugin::Initialise(Host); - host=Host; - - m_JackClient->SetCallback(cb_Update,m_Parent); + host = Host; + + m_JackClient->SetCallback(cb_Update,m_Parent); + return Info; } @@ -490,47 +492,6 @@ this,m_AudioCH,m_HostInfo); } -void JackPlugin::SetNumberPorts (int nInputs, int nOutputs) { - UpdatePluginInfoWithHost(); - RemoveAllInputs (); - RemoveAllOutputs (); - m_PluginInfo.NumInputs = 0; - m_PluginInfo.NumOutputs = 0; - m_PluginInfo.PortTips.clear (); - CreatePorts (nInputs, nOutputs, true); - UpdatePluginInfoWithHost (); -} - -void JackPlugin::CreatePorts (int nInputs, int nOutputs, bool AddPorts) { - m_PluginInfo.PortTips.clear(); - - m_PluginInfo.NumInputs = nInputs; - m_JackClient->SetJackInputCount(nInputs); - - for (int n=0; nSetJackOutputCount(nOutputs); - - for (int n=0; nIsCommandWaiting(); - int command = (commandwaiting)?(int)m_AudioCH->GetCommand():0; - - if (commandwaiting) + if (m_AudioCH->IsCommandWaiting()) { - switch (command) { + switch (m_AudioCH->GetCommand()) { case SET_PORT_COUNT : SetNumberPorts (m_GUIArgs.NumInputs, m_GUIArgs.NumOutputs); - } - } - + break; - // we want to process this whether we are connected to stuff or not - JackClient* pJack=m_JackClient; - - // connect the buffers up if we are plugged into something - for (int n=0; nGetJackOutputCount(); n++) - { - if (InputExists(n)) - { - pJack->SetOutputBuf(n,(float*)GetInput(n)->GetBuffer()); - } - else - { - pJack->SetOutputBuf(n,NULL); - } - } - - for (int n=0; nGetJackInputCount(); n++) - { - if (OutputExists(n)) - { - pJack->SetInputBuf(n,(float*)GetOutputBuf(n)->GetBuffer()); - } - else - { - pJack->SetInputBuf(n,NULL); - } - } - - if (commandwaiting) - { - switch (command) - { case UPDATE_NAMES : { int c=0; @@ -626,12 +550,125 @@ } break; + default : break; } } m_Connected=m_JackClient->IsAttached(); } +bool JackPlugin::Kill() +{ + m_IsDead=true; + + UpdatePluginInfoWithHost(); + RemoveAllInputs (); + RemoveAllOutputs (); + UpdatePluginInfoWithHost(); + + if (m_JackClient) + { + m_JackClient->Detach(); + delete m_JackClient; + m_JackClient=NULL; + } + + return true; +} + +void JackPlugin::Reset() +{ + // connect the buffers up if we are plugged into something + for (int n=0; nGetJackOutputCount(); n++) + { + m_JackClient->SetOutputBuf(n,NULL); + } + + for (int n=0; nGetJackInputCount(); n++) + { + m_JackClient->SetInputBuf(n,NULL); + } + + ResetPorts(); +} + +void JackPlugin::ProcessAudio() +{ + if (m_IsDead) return; + + // Make sure all plugins match Jack's SampleRate and Buffersize + if ((m_JackClient->JackSampleRate() != -1) && (m_JackClient->JackBufferSize() != -1)) + { + ChangeBufferAndSampleRate(m_JackClient->JackBufferSize(), m_JackClient->JackSampleRate(), m_Parent); + } + + // connect the buffers up if we are plugged into something + for (int n=0; nGetJackOutputCount(); n++) + { + if (InputExists(n) && !m_HostInfo->PAUSED) + { + m_JackClient->SetOutputBuf(n,(float*)GetInput(n)->GetBuffer()); + } + else + { + m_JackClient->SetOutputBuf(n,NULL); + } + } + + for (int n=0; nGetJackInputCount(); n++) + { + if (OutputExists(n) && !m_HostInfo->PAUSED) + { + m_JackClient->SetInputBuf(n,(float*)GetOutputBuf(n)->GetBuffer()); + } + else + { + m_JackClient->SetInputBuf(n,NULL); + } + } +} + +void JackPlugin::SetNumberPorts (int nInputs, int nOutputs) { + UpdatePluginInfoWithHost(); + RemoveAllInputs (); + RemoveAllOutputs (); + m_PluginInfo.NumInputs = 0; + m_PluginInfo.NumOutputs = 0; + m_PluginInfo.PortTips.clear (); + CreatePorts (nInputs, nOutputs, true); + UpdatePluginInfoWithHost (); +} + +void JackPlugin::CreatePorts (int nInputs, int nOutputs, bool AddPorts) { + m_PluginInfo.PortTips.clear(); + + m_PluginInfo.NumInputs = nInputs; + m_JackClient->SetJackInputCount(nInputs); + + for (int n=0; nSetJackOutputCount(nOutputs); + + for (int n=0; n -#include +#include #include #include @@ -89,16 +89,16 @@ m_Remove->box (FL_PLASTIC_UP_BOX); m_Remove->color (m_GUIColour); m_Remove->type(0); - m_Remove->labelsize(2); + m_Remove->labelsize (10); m_Remove->selection_color (m_GUIColour); m_Remove->callback((Fl_Callback*)cb_Remove, this); add(m_Remove); - + m_Add = new Fl_Button(30,15,25,25,"+"); m_Add->box (FL_PLASTIC_UP_BOX); m_Add->color (m_GUIColour); m_Add->type(0); - m_Add->labelsize(2); + m_Add->labelsize (10); m_Add->selection_color (m_GUIColour); m_Add->callback((Fl_Callback*)cb_Add, this); add(m_Add); diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/JackPlugin/JackPlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/JackPlugin/JackPlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/JackPlugin/JackPlugin.h 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/JackPlugin/JackPlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -66,6 +66,8 @@ void SetJackInputCount(int JackInputCount) { m_JackInputCount=JackInputCount; } int GetJackOutputCount() { return m_JackOutputCount; } void SetJackOutputCount(int JackOutputCount) { m_JackOutputCount=JackOutputCount; } + long int JackSampleRate() { return m_JackSampleRate; } + long int JackBufferSize() { return m_JackBufferSize; } class JackPort { @@ -107,6 +109,9 @@ int m_JackOutputCount; int m_JackInstanceID; + long int m_JackSampleRate; + long int m_JackBufferSize; + static int JackProcessInstanceID; void(*RunCallback)(void*, bool m); @@ -115,7 +120,7 @@ /////////////////////////////////////////////////// -class JackPlugin : public SpiralPlugin +class JackPlugin : public AudioDriver { public: JackPlugin(); @@ -124,16 +129,21 @@ virtual PluginInfo& Initialise(const HostInfo *Host); virtual SpiralGUIType* CreateGUI(); - virtual void Execute(); - virtual void ExecuteCommands(); + /* General Plugin Function */ + virtual void Execute(); + virtual void ExecuteCommands(); + + virtual bool Kill(); + virtual void Reset(); + + /* Audio Driver Specific Functions */ + virtual bool IsAudioDriver() { return true; } + virtual AudioProcessType ProcessType() { return AudioDriver::ALWAYS; } + virtual void ProcessAudio(); - virtual bool Kill(); - - virtual void StreamOut(std::ostream &s); - virtual void StreamIn(std::istream &s); - + /* Jack Plugin Specific Functions */ JackClient *GetJackClient() { return m_JackClient; } - + void SetNumberPorts (int nInputs, int nOutputs); enum GUICommands{NONE,UPDATE_NAMES,SET_PORT_COUNT,CHECK_PORT_CHANGES}; @@ -145,10 +155,12 @@ }; void Attach() { m_JackClient->Attach(); } - void Detach() { m_JackClient->Detach(); } -private: - const HostInfo* host; + void Detach() { m_JackClient->Detach(); } + /* Jack Plugin Streaming - soon to be obsolete and for backward compatibility only*/ + virtual void StreamOut(std::ostream &s); + virtual void StreamIn(std::istream &s); +private: GUIArgs m_GUIArgs; int m_Version; @@ -169,7 +181,7 @@ bool m_Connected; JackClient *m_JackClient; int m_JackInstanceID; - + //clunky work-around for unique ID static int JackInstanceCount; }; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/JackPlugin/JackPlugin.pro spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/JackPlugin/JackPlugin.pro --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/JackPlugin/JackPlugin.pro 2003-12-12 03:16:15.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/JackPlugin/JackPlugin.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -HEADERS = ../SpiralPlugin.h \ - ../SpiralPluginGUI.h \ - ../Widgets/Fl_Knob.H \ - ../Widgets/Fl_DragBar.H \ - ../Widgets/Fl_LED_Button.H \ - ../../Sample.h \ - JackPlugin.h \ - JackPluginGUI.h - -SOURCES = ../SpiralPlugin.C \ - ../SpiralPluginGUI.C \ - ../Widgets/Fl_Knob.cxx \ - ../Widgets/Fl_DragBar.cxx \ - ../Widgets/Fl_LED_Button.cxx \ - ../../Sample.C \ - JackPlugin.C \ - JackPluginGUI.C - -TARGET = JackPlugin.so diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/JackPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/JackPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/JackPlugin/Makefile.in 2004-01-17 10:32:42.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/JackPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -13,10 +13,7 @@ LFLAGS = LIBS = @FLTK_LIBS@ -lrt -ljack -lpthread MOC = moc -UIC = - -TAR = tar -cf -GZIP = gzip -9f +UIC = INSTALL = @INSTALL@ @@ -104,13 +101,6 @@ moc: $(SRCMOC) -tmake: - tmake JackPlugin.pro - -dist: - $(TAR) JackPlugin.tar JackPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) JackPlugin.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/JoystickPlugin/JoystickPlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/JoystickPlugin/JoystickPlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/JoystickPlugin/JoystickPlugin.C 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/JoystickPlugin/JoystickPlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,228 @@ +/* JoystickPlugin + * Copyleft (C) 2002 William Bland + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include + +#include "JoystickPlugin.h" +#include "JoystickPluginGUI.h" +#include +#include "SpiralIcon.xpm" + +using namespace std; + +LowLevelJoystick* LowLevelJoystick::m_Singleton = NULL; +int JoystickPlugin::m_RefCount=0; +int JoystickPlugin::m_NoExecuted=0; + +extern "C" { +SpiralPlugin* SpiralPlugin_CreateInstance() +{ + return new JoystickPlugin; +} + +char** SpiralPlugin_GetIcon() +{ + return SpiralIcon_xpm; +} + +int SpiralPlugin_GetID() +{ + return 0x0070; +} + +string SpiralPlugin_GetGroupName() +{ + return "SpiralSound"; +} +} + +/////////////////////////////////////////////////////// + +JoystickPlugin::JoystickPlugin() +{ + m_RefCount++; + + m_PluginInfo.Name = "Joystick"; + m_PluginInfo.Width = 150; + m_PluginInfo.Height = 60; + m_PluginInfo.NumInputs = 0; + m_PluginInfo.NumOutputs = JP_NUMBER_OF_AXES + JP_NUMBER_OF_BUTTONS; + m_PluginInfo.PortTips.push_back("X-axis CV Out"); + m_PluginInfo.PortTips.push_back("Y-axis CV Out"); + m_PluginInfo.PortTips.push_back("Z-axis CV Out"); + m_PluginInfo.PortTips.push_back("Button 1 trigger Out"); + m_PluginInfo.PortTips.push_back("Button 2 trigger Out"); + m_PluginInfo.PortTips.push_back("Button 3 trigger Out"); + + for( int i=0; iGetJoystickAxis( i ); + LowLevelJoystick::Get()->m_invert_axis[i] = 0; + } +} + +JoystickPlugin::~JoystickPlugin() +{ + m_RefCount--; + if (m_RefCount==0) + { + LowLevelJoystick::PackUpAndGoHome(); + } +} + +PluginInfo &JoystickPlugin::Initialise(const HostInfo *Host) +{ + PluginInfo& Info= SpiralPlugin::Initialise(Host); + return Info; +} + +SpiralGUIType *JoystickPlugin::CreateGUI() +{ + m_GUI = new JoystickPluginGUI(m_PluginInfo.Width, + m_PluginInfo.Height, + this,m_HostInfo); + m_GUI->hide(); + return m_GUI; +} + + +void JoystickPlugin::Execute() +{ + // Only Read() once per set of plugins + m_NoExecuted++; + if (m_NoExecuted==m_RefCount) + { + LowLevelJoystick::Get()->Read(); + m_NoExecuted=0; + } + + float stepsize[JP_NUMBER_OF_AXES]; + float newvalue[JP_NUMBER_OF_AXES]; + + for( int i=0; iGetJoystickAxis( i ); + stepsize[i] = (newvalue[i] - m_last_axis[i]) / m_HostInfo->BUFSIZE; + } + + for( int n=0; nBUFSIZE; n++ ) + { + for( int i=0; iGetJoystickButton( i ) ); + } + + for( int i=0; iredraw(); +} + +////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////// + +LowLevelJoystick::LowLevelJoystick() : + m_InputOk(true) +{ + OpenRead(); +} + +////////////////////////////////////////////////////////////////////// + +LowLevelJoystick::~LowLevelJoystick() +{ + Close(); +} + +////////////////////////////////////////////////////////////////////// + +void LowLevelJoystick::Read() +{ + struct js_event js; + if (m_InputOk) + { + int ret = read( m_Joyfd, &js, sizeof(struct js_event) ); + if (ret == sizeof(struct js_event)) + { + switch ((js.type&3)) + { + case JS_EVENT_BUTTON: + m_button[js.number] = (float)js.value; + break; + case JS_EVENT_AXIS: + m_axis[js.number] = ((float)js.value) / 32767; + break; + } + } + } +} + +////////////////////////////////////////////////////////////////////// + +float LowLevelJoystick::GetJoystickAxis( int i ) +{ + if( m_invert_axis[i] ) + return( -m_axis[i] ); + else + return( m_axis[i] ); +} + +////////////////////////////////////////////////////////////////////// + +float LowLevelJoystick::GetJoystickButton( int i ) +{ + return( m_button[i] ); +} + +////////////////////////////////////////////////////////////////////// + +void LowLevelJoystick::Close() +{ + cerr<<"Closing joystick"< + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "JoystickPluginGUI.h" +#include + +using namespace std; + +JoystickPluginGUI::JoystickPluginGUI(int w, int h,JoystickPlugin *o,const HostInfo *Info) : + SpiralPluginGUI(w,h,o) +{ + m_Plugin=o; + + Invertx = new Fl_Button(0, 20, 50, 20, "Invert x"); + Invertx->type(1); + Invertx->down_box(FL_DOWN_BOX); + Invertx->labelsize(10); + Invertx->callback((Fl_Callback*)cb_Invertx); + + Inverty = new Fl_Button(50, 20, 50, 20, "Invert y"); + Inverty->type(1); + Inverty->down_box(FL_DOWN_BOX); + Inverty->labelsize(10); + Inverty->callback((Fl_Callback*)cb_Inverty); + + Invertz = new Fl_Button(100, 20, 50, 20, "Invert z"); + Invertz->type(1); + Invertz->down_box(FL_DOWN_BOX); + Invertz->labelsize(10); + Invertz->callback((Fl_Callback*)cb_Invertz); + + valuex = new Fl_Box( 0, 40, 50, 20 ); + valuey = new Fl_Box( 50, 40, 50, 20 ); + valuez = new Fl_Box( 100, 40, 50, 20 ); + + end(); +} + +char xbuffer[20]; +char ybuffer[20]; +char zbuffer[20]; + +void JoystickPluginGUI::UpdateValues() +{ + snprintf( xbuffer, 20, "%.3f", LowLevelJoystick::Get()->GetJoystickAxis( 0 ) ); + valuex->label( xbuffer ); + snprintf( ybuffer, 20, "%.3f", LowLevelJoystick::Get()->GetJoystickAxis( 1 ) ); + valuey->label( ybuffer ); + snprintf( zbuffer, 20, "%.3f", LowLevelJoystick::Get()->GetJoystickAxis( 2 ) ); + valuez->label( zbuffer ); + Fl::check(); +} + +void JoystickPluginGUI::draw() +{ + SpiralGUIType::draw(); + UpdateValues(); +} + +inline void JoystickPluginGUI::cb_Invert_ix(Fl_Button* o, void* v) +{ LowLevelJoystick::Get()->m_invert_axis[0] = o->value(); } +void JoystickPluginGUI::cb_Invertx(Fl_Button* o, void* v) +{ ((JoystickPluginGUI*)(o->parent()))->cb_Invert_ix(o,v); } + +inline void JoystickPluginGUI::cb_Invert_iy(Fl_Button* o, void* v) +{ LowLevelJoystick::Get()->m_invert_axis[1] = o->value(); } +void JoystickPluginGUI::cb_Inverty(Fl_Button* o, void* v) +{ ((JoystickPluginGUI*)(o->parent()))->cb_Invert_iy(o,v); } + +inline void JoystickPluginGUI::cb_Invert_iz(Fl_Button* o, void* v) +{ LowLevelJoystick::Get()->m_invert_axis[2] = o->value(); } +void JoystickPluginGUI::cb_Invertz(Fl_Button* o, void* v) +{ ((JoystickPluginGUI*)(o->parent()))->cb_Invert_iz(o,v); } diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/JoystickPlugin/JoystickPluginGUI.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/JoystickPlugin/JoystickPluginGUI.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/JoystickPlugin/JoystickPluginGUI.h 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/JoystickPlugin/JoystickPluginGUI.h 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,59 @@ +/* JoystickPlugin + * Copyleft (C) 2002 William Bland + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include "../Widgets/Fl_Knob.H" +#include "JoystickPlugin.h" +#include "../SpiralPluginGUI.h" +#include + +#ifndef JOY_GUI_H +#define JOY_GUI_H + +class JoystickPluginGUI : public SpiralPluginGUI +{ +public: + JoystickPluginGUI(int w, int h, JoystickPlugin *o,const HostInfo *Info); + + virtual void draw(); + virtual void UpdateValues(); + virtual SpiralPlugin* GetPlugin() { return m_Plugin; } + + JoystickPlugin *m_Plugin; + +private: + Fl_Button *Invertx; + Fl_Button *Inverty; + Fl_Button *Invertz; + Fl_Box *valuex; + Fl_Box *valuey; + Fl_Box *valuez; + + //// Callbacks //// + inline void cb_Invert_ix(Fl_Button* o, void* v); + static void cb_Invertx(Fl_Button* o, void* v); + inline void cb_Invert_iy(Fl_Button* o, void* v); + static void cb_Inverty(Fl_Button* o, void* v); + inline void cb_Invert_iz(Fl_Button* o, void* v); + static void cb_Invertz(Fl_Button* o, void* v); +}; + +#endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/JoystickPlugin/JoystickPlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/JoystickPlugin/JoystickPlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/JoystickPlugin/JoystickPlugin.h 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/JoystickPlugin/JoystickPlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,77 @@ +/* JoystickPlugin + * Copyleft (C) 2002 William Bland + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../SpiralPlugin.h" +#include +#include + +#ifndef JoystickPLUGIN +#define JoystickPLUGIN + +#define JP_NUMBER_OF_AXES 3 +#define JP_NUMBER_OF_BUTTONS 3 + +class LowLevelJoystick +{ +public: + static LowLevelJoystick *Get() { if(!m_Singleton) m_Singleton=new LowLevelJoystick; return m_Singleton; } + static void PackUpAndGoHome() { if(m_Singleton) { delete m_Singleton; m_Singleton=NULL; } } + ~LowLevelJoystick(); + + void Read(); + void OpenRead(); + void Close(); + float GetJoystickAxis( int ); + float GetJoystickButton( int ); + + bool m_invert_axis[JP_NUMBER_OF_AXES]; + +private: + static LowLevelJoystick* m_Singleton; + + LowLevelJoystick(); + float m_button[JP_NUMBER_OF_BUTTONS]; + float m_axis[JP_NUMBER_OF_AXES]; + + int m_Joyfd; + bool m_InputOk; +}; + + +class JoystickPlugin : public SpiralPlugin +{ +public: + JoystickPlugin(); + virtual ~JoystickPlugin(); + + virtual PluginInfo& Initialise(const HostInfo *Host); + virtual SpiralGUIType* CreateGUI(); + virtual void Execute(); + virtual void StreamOut(std::ostream &s) {} + virtual void StreamIn(std::istream &s) {} + + // has to be defined in the plugin + virtual void UpdateGUI() { Fl::check(); } + +private: + static int m_RefCount; + static int m_NoExecuted; + float m_last_axis[JP_NUMBER_OF_AXES]; +}; + +#endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/JoystickPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/JoystickPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/JoystickPlugin/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/JoystickPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,151 @@ +############################################################################# +# Makefile for building JoystickPlugin.so +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ @FLTK_CFLAGS@ +CXXFLAGS= @CXXFLAGS@ @FLTK_CXXFLAGS@ +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = @FLTK_LIBS@ +MOC = moc +UIC = + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = JoystickPlugin.h \ + JoystickPluginGUI.h \ + ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../../ChannelHandler.h \ + ../../Sample.h \ + ../Widgets/Fl_Knob.H \ + ../../../GUI/Widgets/SpiralGUI.H +SOURCES = JoystickPlugin.C \ + JoystickPluginGUI.C \ + ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../../ChannelHandler.C \ + ../../Sample.C \ + ../Widgets/Fl_Knob.cxx \ + ../../../GUI/Widgets/SpiralGUI.C +OBJECTS = JoystickPlugin.o \ + JoystickPluginGUI.o \ + ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../../ChannelHandler.o \ + ../../Sample.o \ + ../Widgets/Fl_Knob.o \ + ../../../GUI/Widgets/SpiralGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = JoystickPlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../ChannelHandler.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../SpiralPlugin.h \ + ../../ChannelHandler.h \ + ../../../GUI/Widgets/SpiralGUI.H + +../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_Knob.H + +../../../GUI/Widgets/SpiralGUI.o: ../../../GUI/Widgets/SpiralGUI.C \ + ../../../GUI/Widgets/SpiralGUI.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h + +JoystickPlugin.o: JoystickPlugin.C \ + JoystickPlugin.h \ + JoystickPluginGUI.h \ + ../SpiralPluginGUI.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + SpiralIcon.xpm + +JoystickPluginGUI.o: JoystickPluginGUI.C \ + JoystickPluginGUI.h \ + JoystickPlugin.h \ + ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../../../GUI/Widgets/SpiralGUI.H + +../../ChannelHandler.o: ../../ChannelHandler.C \ + ../../ChannelHandler.h diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/JoystickPlugin/SpiralIcon.xpm spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/JoystickPlugin/SpiralIcon.xpm --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/JoystickPlugin/SpiralIcon.xpm 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/JoystickPlugin/SpiralIcon.xpm 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,313 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"36 36 274 2", +" c None", +". c #8B889B", +"+ c #9C99AA", +"@ c #ADAAB9", +"# c #837F94", +"$ c #7D7990", +"% c #9995A7", +"& c #67627C", +"* c #CDCBD4", +"= c #FCFCFC", +"- c #D1D0D8", +"; c #FFFFFF", +"> c #F1F1F3", +", c #848095", +"' c #2A2248", +") c #CFCED6", +"! c #68637D", +"~ c #ABA8B6", +"{ c #D5D3DB", +"] c #9490A2", +"^ c #C4C4C4", +"/ c #1D1C1D", +"( c #313134", +"_ c #EEEFEE", +": c #FBFBFB", +"< c #EFEFEF", +"[ c #7B768D", +"} c #464060", +"| c #DEDEE1", +"1 c #CBCACC", +"2 c #EEEEF1", +"3 c #79758C", +"4 c #FBFBFC", +"5 c #A2A2A2", +"6 c #000000", +"7 c #F5F6F5", +"8 c #747474", +"9 c #2A2A2B", +"0 c #403958", +"a c #7D788F", +"b c #C0BEC8", +"c c #BCBAC6", +"d c #BCBAC5", +"e c #625C79", +"f c #2B2932", +"g c #191919", +"h c #CCCCCC", +"i c #807B91", +"j c #3B3556", +"k c #F2F2F4", +"l c #929292", +"m c #0E0E0E", +"n c #BFBFBF", +"o c #111111", +"p c #100E15", +"q c #868689", +"r c #FEFDFE", +"s c #D9D7DE", +"t c #9C98AA", +"u c #FDFCFD", +"v c #DDDDDD", +"w c #575755", +"x c #5E5E5E", +"y c #C4C2CD", +"z c #423C5C", +"A c #F0F0F2", +"B c #939393", +"C c #555555", +"D c #4A4A4A", +"E c #010101", +"F c #282828", +"G c #C2C2C2", +"H c #DBDAE0", +"I c #615C78", +"J c #F6F6F7", +"K c #DADADA", +"L c #545454", +"M c #0F0F0F", +"N c #B8B8B8", +"O c #48445C", +"P c #2B2B2C", +"Q c #181900", +"R c #D3D3D3", +"S c #C1BEC9", +"T c #474060", +"U c #31294D", +"V c #716C85", +"W c #65607A", +"X c #625D78", +"Y c #D5D4DB", +"Z c #F7F7F7", +"` c #8B8B8B", +" . c #161616", +".. c #0C0C0C", +"+. c #5B5571", +"@. c #393643", +"#. c #47415F", +"$. c #9692A4", +"%. c #D9D8DE", +"&. c #F7F7F8", +"*. c #918DA0", +"=. c #B8B5C1", +"-. c #D1D1D1", +";. c #252525", +">. c #5C5C00", +",. c #727175", +"'. c #FEFEFF", +"). c #9D99AA", +"!. c #DBD9E0", +"~. c #E9E9E9", +"{. c #CBCBCB", +"]. c #E0E0E0", +"^. c #6C6C6C", +"/. c #FFFF00", +"(. c #515151", +"_. c #A6A6A7", +":. c #827E93", +"<. c #615C77", +"[. c #EAEAED", +"}. c #DFDFE1", +"|. c #1E1D24", +"1. c #9894A7", +"2. c #B1AEBB", +"3. c #69686F", +"4. c #000001", +"5. c #0A0A00", +"6. c #615C76", +"7. c #5F5A75", +"8. c #413E4D", +"9. c #020203", +"0. c #1A1A1C", +"a. c #C3C1CB", +"b. c #9D9D9D", +"c. c #202020", +"d. c #383838", +"e. c #4C4C4C", +"f. c #111112", +"g. c #C9C7D0", +"h. c #F1F1F1", +"i. c #F8F8F8", +"j. c #232323", +"k. c #010100", +"l. c #050408", +"m. c #AEACB9", +"n. c #FEFEFE", +"o. c #1D1D1D", +"p. c #020200", +"q. c #B7B5C1", +"r. c #9390A2", +"s. c #BBBBBB", +"t. c #414141", +"u. c #030303", +"v. c #28272A", +"w. c #F4F4F6", +"x. c #605B76", +"y. c #736E86", +"z. c #D8D8D8", +"A. c #727272", +"B. c #101010", +"C. c #848486", +"D. c #CCCBD3", +"E. c #747087", +"F. c #6D6881", +"G. c #1C1C1C", +"H. c #242424", +"I. c #656566", +"J. c #F6F6F6", +"K. c #E8E6EA", +"L. c #706B84", +"M. c #E3E1E6", +"N. c #474746", +"O. c #151515", +"P. c #C8C8C8", +"Q. c #AEAEAE", +"R. c #080808", +"S. c #373639", +"T. c #FDFCFE", +"U. c #ABA8B7", +"V. c #F1F0F3", +"W. c #6D6980", +"X. c #0A090E", +"Y. c #95929E", +"Z. c #0A0810", +"`. c #050505", +" + c #5B5A5C", +".+ c #F7F6F7", +"++ c #F4F3F5", +"@+ c #908C9F", +"#+ c #C8C6D0", +"$+ c #837E96", +"%+ c #86868A", +"&+ c #070608", +"*+ c #ECEBEE", +"=+ c #646078", +"-+ c #AFAFB0", +";+ c #454545", +">+ c #333408", +",+ c #7A7A7A", +"'+ c #C8C8C9", +")+ c #212025", +"!+ c #060607", +"~+ c #969699", +"{+ c #FAFAFA", +"]+ c #F8F8F9", +"^+ c #A29EAF", +"/+ c #F7F6F8", +"(+ c #F0F0F1", +"_+ c #B8B7B9", +":+ c #E4E4E4", +"<+ c #FDFDFD", +"[+ c #A5A2B2", +"}+ c #3B3456", +"|+ c #A8A5B4", +"1+ c #525252", +"2+ c #848387", +"3+ c #CDCDCD", +"4+ c #8D899C", +"5+ c #494262", +"6+ c #68627C", +"7+ c #40395A", +"8+ c #ECECEC", +"9+ c #020202", +"0+ c #B4B5B5", +"a+ c #0B0B0B", +"b+ c #313232", +"c+ c #E3E3E3", +"d+ c #B1AEBC", +"e+ c #BDBBC6", +"f+ c #3C3556", +"g+ c #898599", +"h+ c #EDEDED", +"i+ c #39393A", +"j+ c #040404", +"k+ c #333333", +"l+ c #F5F5F5", +"m+ c #2B2B2B", +"n+ c #2D2A3D", +"o+ c #B6B4C1", +"p+ c #F5F5F6", +"q+ c #605A76", +"r+ c #DAD8DF", +"s+ c #F5F4F6", +"t+ c #615B76", +"u+ c #524D6A", +"v+ c #E4E3E8", +"w+ c #D5D5D5", +"x+ c #1B1B1B", +"y+ c #303030", +"z+ c #AAABAB", +"A+ c #585464", +"B+ c #B0AEBB", +"C+ c #A29FAF", +"D+ c #E9E8E9", +"E+ c #787779", +"F+ c #0F0E15", +"G+ c #2D2D2E", +"H+ c #595959", +"I+ c #FAFAFB", +"J+ c #807B92", +"K+ c #B0ADBB", +"L+ c #E8E7EB", +"M+ c #3A3258", +"N+ c #E6E5EA", +"O+ c #DFDEE3", +"P+ c #443E5E", +"Q+ c #BAB8C4", +"R+ c #C1BFCA", +"S+ c #E0E0E5", +"T+ c #D0CED6", +"U+ c #362F52", +"V+ c #CECCD5", +"W+ c #413A5B", +"X+ c #6A657F", +"Y+ c #9793A6", +" ", +" ", +" ", +" . + @ # $ % ", +" & * = * - ; > , ' ; ; ; ) ! ", +" ~ ; ; { ] ; ^ / ( _ ; : < [ ", +" } | 1 2 3 4 5 6 6 7 : 8 9 0 a b ", +" c : d e f g h i j k l 6 m ; n o 6 p q r s ", +" t u ; v w 6 6 x y z A B 6 C ; D E 6 F G ; H ", +" I J ; ; K L 6 6 M N O P E 6 6 6 Q Q M R S T U V W ", +" X Y ; ; ; ; Z ` .6 ..6 6 6 6 6 6 6 6 +.@.#.$.%.&.*. ", +" =.; ; ; ; ; ; = -.;.6 6 6 >.>.>.6 6 6 6 E ,.'.; ; ). ", +" !.; ; ~.R h {.].^.6 6 6 >./././.6 6 6 6 6 E (._.4 :. ", +" <.[.; }...6 6 6 6 6 6 6 6 /./././.>.6 6 6 6 6 6 |.1. ", +" V @ 2.3.4.6 6 6 6 6 5.6 6 >././././.6 6 6 6 6 6 ", +" 6.7.8.6 9.6 6 6 6 6 6 6 6 6 /././.6 6 6 6 6 6 0. ", +" a.; ; b.c.c.d.e.c.6 6 6 6 6 6 >././.6 6 6 6 6 6 f. ", +" g.; ; h.i.; ; ; j.6 k.6 6 6 6 /././.6 6 6 6 6 6 l. ", +" m.; ; ; ; n.; ; o.6 p.6 6 6 6 >././.6 6 6 6 6 6 6 q., ", +" r.; ; n.; : s.t.u.6 6 6 6 6 6 /././.6 6 6 6 6 6 v.n.w.x. ", +" y.; ; ; z.A.B.6 6 6 6 6 6 6 >.>././.>.6 6 6 6 6 C.; ; D.E. ", +" F.J ; : G.6 6 6 6 H...6 >./././././././.>.6 6 6 I.J.; ; K.L. ", +" M.; ; N.6 E 6 O.P.Q.R./././././././././.6 6 6 6 S.T.; ; > L. ", +" U.; V.W.X.6 6 Q.n.; Y.Z.6 6 6 6 6 6 6 +.m `.6 6 6 +.+; ; ++@+ ", +" L.#+! $+%+&+x ; ; *++.=+-+l ;+6 6 6 >+,+'+)+6 6 6 !+~+{+; ; ]+@ ", +" ^+/+(+_+:+<+; [+}+|+; J.;+6 6 E 1+; ; 2+6 6 E 6 o 3+; ; = 4+ ", +" 5+> ; ; ; ; ; ; 6+7+; ; 8+d.6 6 9+D ; ; 0+a+6 6 6 b+c+; ; d+ ", +" > ; ; ; ; e+f+g+; ; h+i+6 6 j+k+; ; l+m+6 6 n+o+; p+3 ", +" q+r+= ; s+t+u+v+; ; w+x+6 6 9+y+; ; ; z+1+A+ ", +" B+4 C+ X ; ; ; D+E+y+F+G+H+; ; ; n.I+J+ ", +" K+; ; ; ; ; L+M+N+; ; ; ; = O+P+ ", +" Q+R+S+4 ; ; T+U+V+; ; ; s g+T ", +" W+ X+Y+g+ ", +" ", +" ", +" "}; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/KeyboardPlugin/KeyboardPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/KeyboardPlugin/KeyboardPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/KeyboardPlugin/KeyboardPluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/KeyboardPlugin/KeyboardPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -18,7 +18,7 @@ #include "KeyboardPluginGUI.h" #include -#include +#include #include #include #include diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/KeyboardPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/KeyboardPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/KeyboardPlugin/Makefile.in 2004-01-17 10:32:42.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/KeyboardPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -15,9 +15,6 @@ MOC = moc UIC = -TAR = tar -cf -GZIP = gzip -9f - INSTALL = @INSTALL@ ###### Autoconf variables @@ -96,13 +93,6 @@ moc: $(SRCMOC) -tmake: - tmake KeyboardPlugin.pro - -dist: - $(TAR) KeyboardPlugin.tar KeyboardPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) KeyboardPlugin.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/LADSPAPlugin/LADSPAInfo.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/LADSPAPlugin/LADSPAInfo.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/LADSPAPlugin/LADSPAInfo.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/LADSPAPlugin/LADSPAInfo.C 2012-05-31 04:13:57.000000000 +0000 @@ -28,7 +28,7 @@ #include #include #include - +#include #include #include #include @@ -325,11 +325,11 @@ string name; // Escape '/' and '|' characters - basic_string ::size_type x = g->find_first_of("/|"); + unsigned int x = g->find_first_of("/|"); if (x == string::npos) { name = *g; } else { - basic_string ::size_type last_x = 0; + unsigned int last_x = 0; while (x < string::npos) { name += g->substr(last_x, x - last_x) + '\\' + (*g)[x]; last_x = x + 1; @@ -359,11 +359,11 @@ string name; // Escape '/' and '|' characters - basic_string ::size_type x = pi->Name.find_first_of("/|"); + unsigned int x = pi->Name.find_first_of("/|"); if (x == string::npos) { name = pi->Name; } else { - basic_string ::size_type last_x = 0; + unsigned int last_x = 0; while (x < string::npos) { name += pi->Name.substr(last_x, x - last_x) + '\\' + pi->Name[x]; last_x = x + 1; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/LADSPAPlugin/LADSPAPlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/LADSPAPlugin/LADSPAPlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/LADSPAPlugin/LADSPAPlugin.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/LADSPAPlugin/LADSPAPlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -58,12 +58,6 @@ } /////////////////////////////////////////////////////// - -#ifdef USE_POSIX_SHM -const char * const LADSPAPlugin::m_SHMPath = "/SSM-LADSPAPlugin-"; -const char * const LADSPAPlugin::m_SHMPathRC = "-RefCount"; -const char * const LADSPAPlugin::m_SHMPathDB = "-Database"; -#endif LADSPAPlugin::LADSPAPlugin() { @@ -74,6 +68,7 @@ } m_PlugDesc = NULL; + m_SSMPluginReset = false; ClearPlugin(); @@ -156,6 +151,15 @@ this, m_AudioCH, m_HostInfo, m_LADSPAInfo->GetMenuList()); } +void LADSPAPlugin::Reset() +{ + ResetPorts(); + + m_SSMPluginReset = true; + UpdatePlugin(m_UniqueID); + m_SSMPluginReset = false; +} + void LADSPAPlugin::Execute() { if (m_PlugDesc) @@ -863,6 +867,7 @@ } // Oops. Clean up. + m_SSMPluginReset = false; ClearPlugin(); cerr << "Error loading LADSPA Plugin.\n"; @@ -886,13 +891,14 @@ } // Find number of input and output ports - for (unsigned long i = 0; i < m_PlugDesc->PortCount; i++) { - if (LADSPA_IS_PORT_INPUT(m_PlugDesc->PortDescriptors[i])) { - m_PluginInfo.NumInputs++; - } else if (LADSPA_IS_PORT_OUTPUT(m_PlugDesc->PortDescriptors[i])) { - m_PluginInfo.NumOutputs++; + if (! m_SSMPluginReset) + for (unsigned long i = 0; i < m_PlugDesc->PortCount; i++) { + if (LADSPA_IS_PORT_INPUT(m_PlugDesc->PortDescriptors[i])) { + m_PluginInfo.NumInputs++; + } else if (LADSPA_IS_PORT_OUTPUT(m_PlugDesc->PortDescriptors[i])) { + m_PluginInfo.NumOutputs++; + } } - } ///////////////////////////////// // LADSPA Buffers @@ -905,7 +911,7 @@ LADSPA_Data *NewPort = new LADSPA_Data[m_HostInfo->BUFSIZE]; m_LADSPABufVec.push_back(NewPort); m_PlugDesc->connect_port(m_PlugInstHandle, n, m_LADSPABufVec[c]); - m_PortID.push_back(n); + m_PortID.push_back(n); c++; } } @@ -930,53 +936,59 @@ // SSM Buffers // Allocate the i/o buffers required - for (int n=0; nPortCount; i++) - { - if (LADSPA_IS_PORT_INPUT(m_PlugDesc->PortDescriptors[i])) - { - desc = string(m_PlugDesc->PortNames[i]) + - (LADSPA_IS_PORT_CONTROL(m_PlugDesc->PortDescriptors[i]) ? " (CV)" : " (AU)"); - m_PluginInfo.PortTips.push_back(desc.c_str()); - - c++; - } - } - - for (unsigned int i = 0; i < m_PlugDesc->PortCount; i++) + if (! m_SSMPluginReset) { - if (LADSPA_IS_PORT_OUTPUT(m_PlugDesc->PortDescriptors[i])) { - - desc = string(m_PlugDesc->PortNames[i]) + - (LADSPA_IS_PORT_CONTROL(m_PlugDesc->PortDescriptors[i]) ? " (CV)" : " (AU)"); - - m_PluginInfo.PortTips.push_back(desc.c_str()); + string desc; + c=0; + + for (unsigned int i = 0; i < m_PlugDesc->PortCount; i++) + { + if (LADSPA_IS_PORT_INPUT(m_PlugDesc->PortDescriptors[i])) + { + desc = string(m_PlugDesc->PortNames[i]) + + (LADSPA_IS_PORT_CONTROL(m_PlugDesc->PortDescriptors[i]) ? " (CV)" : " (AU)"); + m_PluginInfo.PortTips.push_back(desc.c_str()); + + c++; + } } - } - UpdatePluginInfoWithHost(); + for (unsigned int i = 0; i < m_PlugDesc->PortCount; i++) + { + if (LADSPA_IS_PORT_OUTPUT(m_PlugDesc->PortDescriptors[i])) { + + desc = string(m_PlugDesc->PortNames[i]) + + (LADSPA_IS_PORT_CONTROL(m_PlugDesc->PortDescriptors[i]) ? " (CV)" : " (AU)"); + + m_PluginInfo.PortTips.push_back(desc.c_str()); + } + } + UpdatePluginInfoWithHost(); + + m_UniqueID = m_PlugDesc->UniqueID; - m_UniqueID = m_PlugDesc->UniqueID; - m_InputPortCount = m_PluginInfo.NumInputs; + m_InputPortCount = m_PluginInfo.NumInputs; - int lbl_length; + int lbl_length; - lbl_length = strlen(m_PlugDesc->Name); - lbl_length = lbl_length > 255 ? 255 : lbl_length; - strncpy(m_Name, m_PlugDesc->Name, lbl_length); - m_Name[lbl_length] = '\0'; + lbl_length = strlen(m_PlugDesc->Name); + lbl_length = lbl_length > 255 ? 255 : lbl_length; + strncpy(m_Name, m_PlugDesc->Name, lbl_length); + m_Name[lbl_length] = '\0'; - lbl_length = strlen(m_PlugDesc->Maker); - lbl_length = lbl_length > 255 ? 255 : lbl_length; - strncpy(m_Maker, m_PlugDesc->Maker, lbl_length); - m_Maker[lbl_length] = '\0'; + lbl_length = strlen(m_PlugDesc->Maker); + lbl_length = lbl_length > 255 ? 255 : lbl_length; + strncpy(m_Maker, m_PlugDesc->Maker, lbl_length); + m_Maker[lbl_length] = '\0'; + } return true; } @@ -994,14 +1006,17 @@ m_LADSPAInfo->DiscardDescriptorByID(m_UniqueID); } - m_Page = 1; - m_UpdateInputs = true; - m_UniqueID = 0; - m_InputPortCount = 0; - m_UnconnectedInputs = 0; - strncpy(m_Name, "None\0", 5); - strncpy(m_Maker, "None\0", 5); - + if (! m_SSMPluginReset) + { + m_Page = 1; + m_UpdateInputs = true; + m_UniqueID = 0; + m_InputPortCount = 0; + m_UnconnectedInputs = 0; + strncpy(m_Name, "None\0", 5); + strncpy(m_Maker, "None\0", 5); + } + for(vector::iterator i=m_LADSPABufVec.begin(); i!=m_LADSPABufVec.end(); i++) { @@ -1009,18 +1024,25 @@ } m_LADSPABufVec.clear(); - RemoveAllInputs(); - RemoveAllOutputs(); - - m_PluginInfo.NumInputs = 0; - m_PluginInfo.NumOutputs = 0; - m_PluginInfo.PortTips.clear(); + if (! m_SSMPluginReset) + { + RemoveAllInputs(); + RemoveAllOutputs(); + m_PluginInfo.NumInputs = 0; + m_PluginInfo.NumOutputs = 0; + m_PluginInfo.PortTips.clear(); + } + m_PortID.clear(); m_InputPortMin.clear(); m_InputPortMax.clear(); m_InputPortClamp.clear(); - m_InputPortDefault.clear(); + + if (! m_SSMPluginReset) + { + m_InputPortDefault.clear(); + } } void LADSPAPlugin::ResetPortSettings(void) @@ -1131,7 +1153,11 @@ m_InputPortMin.push_back(Min); m_InputPortMax.push_back(Max); m_InputPortClamp.push_back(true); - m_InputPortDefault.push_back(Default); + + if (! m_SSMPluginReset) + { + m_InputPortDefault.push_back(Default); + } } } diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/LADSPAPlugin/LADSPAPlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/LADSPAPlugin/LADSPAPlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/LADSPAPlugin/LADSPAPlugin.h 2004-02-10 19:28:41.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/LADSPAPlugin/LADSPAPlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -52,6 +52,7 @@ virtual PluginInfo &Initialise(const HostInfo *Host); virtual SpiralGUIType *CreateGUI(); virtual void Execute(); + virtual void Reset(); virtual void ExecuteCommands(); virtual void StreamOut(std::ostream &s); virtual void StreamIn(std::istream &s); @@ -100,10 +101,12 @@ void ResetPortSettings(void); void SetGUIExports(void); + bool m_SSMPluginReset; + const LADSPA_Descriptor *m_PlugDesc; std::vector m_LADSPABufVec; LADSPA_Handle m_PlugInstHandle; - + std::vector m_PortID; std::vector m_InputPortMin; std::vector m_InputPortMax; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/LADSPAPlugin/LADSPAPlugin.pro spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/LADSPAPlugin/LADSPAPlugin.pro --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/LADSPAPlugin/LADSPAPlugin.pro 2002-11-11 18:08:45.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/LADSPAPlugin/LADSPAPlugin.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -HEADERS = ../SpiralPlugin.h \ - ../SpiralPluginGUI.h \ - ../Widgets/Fl_Knob.H \ - ../Widgets/Fl_DragBar.H \ - ../../Sample.h \ - LADSPAPlugin.h \ - LADSPAPluginGUI.h - -SOURCES = ../SpiralPlugin.C \ - ../SpiralPluginGUI.C \ - ../Widgets/Fl_Knob.cxx \ - ../Widgets/Fl_DragBar.cxx \ - ../../Sample.C \ - LADSPAPlugin.C \ - LADSPAPluginGUI.C - -TARGET = LADSPAPlugin.so diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/LADSPAPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/LADSPAPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/LADSPAPlugin/Makefile.in 2004-02-10 19:28:41.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/LADSPAPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -13,10 +13,7 @@ LFLAGS = LIBS = @FLTK_LIBS@ @LRDFLIBS@ MOC = moc -UIC = - -TAR = tar -cf -GZIP = gzip -9f +UIC = INSTALL = @INSTALL@ @@ -105,15 +102,6 @@ moc: $(SRCMOC) -tmake: Makefile - -Makefile: LADSPAPlugin.pro - tmake LADSPAPlugin.pro -o Makefile - -dist: - $(TAR) LADSPAPlugin.tar LADSPAPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) LADSPAPlugin.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/LFOPlugin/LFOPlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/LFOPlugin/LFOPlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/LFOPlugin/LFOPlugin.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/LFOPlugin/LFOPlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -102,6 +102,16 @@ return pos; } +void LFOPlugin::Reset() +{ + ResetPorts(); + for (int n=0; nBUFSIZE; n++) { @@ -119,20 +129,12 @@ } void LFOPlugin::StreamOut(ostream &s) { - s << m_Version << " " << *this; + s << m_Version << " " << (int)m_Type << " " << m_Freq << " "; } void LFOPlugin::StreamIn(istream &s) { int version; - s >> version >> *this; + s >> version; + s >> (int&)m_Type >> m_Freq; } -istream &operator>> (istream &s, LFOPlugin &o) { - s >> (int&)o.m_Type >> o.m_Freq; - return s; -} - -ostream &operator<< (ostream &s, LFOPlugin &o) { - s << (int)o.m_Type << " " << o.m_Freq << " "; - return s; -} diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/LFOPlugin/LFOPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/LFOPlugin/LFOPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/LFOPlugin/LFOPluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/LFOPlugin/LFOPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -18,6 +18,7 @@ #include "LFOPluginGUI.h" #include +#include #include "../GUI/WS_Sine.h" #include "../GUI/WS_Tri.h" #include "../GUI/WS_Square.h" diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/LFOPlugin/LFOPlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/LFOPlugin/LFOPlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/LFOPlugin/LFOPlugin.h 2003-08-08 17:55:50.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/LFOPlugin/LFOPlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -32,6 +32,8 @@ virtual PluginInfo &Initialise (const HostInfo *Host); virtual SpiralGUIType* CreateGUI(); virtual void Execute(); + virtual void Reset(); + virtual void StreamOut (std::ostream &s); virtual void StreamIn (std::istream &s); //typedef char Type; @@ -50,11 +52,6 @@ float m_Freq; Sample m_Table[NUM_TABLES]; int m_TableLength; - friend std::istream &operator>> (std::istream &s, LFOPlugin &o); - friend std::ostream &operator<< (std::ostream &s, LFOPlugin &o); }; -std::istream &operator>> (std::istream &s, LFOPlugin &o); -std::ostream &operator<< (std::ostream &s, LFOPlugin &o); - #endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/LFOPlugin/LFOPlugin.pro spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/LFOPlugin/LFOPlugin.pro --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/LFOPlugin/LFOPlugin.pro 2002-07-28 23:18:18.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/LFOPlugin/LFOPlugin.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -HEADERS = ../SpiralPlugin.h \ - ../SpiralPluginGUI.h \ - ../Widgets/Fl_Knob.H \ - ../Widgets/Fl_DragBar.H \ - ../../Sample.h \ - LFOPlugin.h \ - LFOPluginGUI.h - -SOURCES = ../SpiralPlugin.C \ - ../SpiralPluginGUI.C \ - ../Widgets/Fl_Knob.cxx \ - ../Widgets/Fl_DragBar.cxx \ - ../../Sample.C \ - LFOPlugin.C \ - LFOPluginGUI.C - -TARGET = LFOPlugin.so diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/LFOPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/LFOPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/LFOPlugin/Makefile.in 2004-01-17 10:32:42.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/LFOPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -15,9 +15,6 @@ MOC = moc UIC = -TAR = tar -cf -GZIP = gzip -9f - INSTALL = @INSTALL@ ###### Autoconf variables @@ -106,13 +103,6 @@ moc: $(SRCMOC) -tmake: - tmake LFOPlugin.pro - -dist: - $(TAR) LFOPlugin.tar LFOPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) LFOPlugin.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/LogicPlugin/LogicPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/LogicPlugin/LogicPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/LogicPlugin/LogicPluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/LogicPlugin/LogicPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -18,6 +18,7 @@ #include "LogicPluginGUI.h" #include +#include #include using namespace std; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/LogicPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/LogicPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/LogicPlugin/Makefile.in 2004-01-17 10:32:42.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/LogicPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -15,9 +15,6 @@ MOC = moc UIC = -TAR = tar -cf -GZIP = gzip -9f - INSTALL = @INSTALL@ ###### Autoconf variables diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MasherPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MasherPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MasherPlugin/Makefile.in 2004-01-17 10:32:42.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MasherPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -13,10 +13,7 @@ LFLAGS = LIBS = @FLTK_LIBS@ MOC = moc -UIC = - -TAR = tar -cf -GZIP = gzip -9f +UIC = INSTALL = @INSTALL@ @@ -99,13 +96,6 @@ moc: $(SRCMOC) -tmake: - tmake MasherPlugin.pro - -dist: - $(TAR) MasherPlugin.tar MasherPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) MasherPlugin.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MasherPlugin/MasherPlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MasherPlugin/MasherPlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MasherPlugin/MasherPlugin.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MasherPlugin/MasherPlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -15,7 +15,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include #include #include "MasherPlugin.h" #include "MasherPluginGUI.h" @@ -107,6 +106,14 @@ } } +void MasherPlugin::Reset() +{ + ResetPorts(); + m_ReadGrain = 0; + m_WriteGrain = 0; +} + + void MasherPlugin::Execute() { GetOutputBuf(0)->Zero(); diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MasherPlugin/MasherPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MasherPlugin/MasherPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MasherPlugin/MasherPluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MasherPlugin/MasherPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -18,6 +18,7 @@ #include "MasherPluginGUI.h" #include +#include using namespace std; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MasherPlugin/MasherPlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MasherPlugin/MasherPlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MasherPlugin/MasherPlugin.h 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MasherPlugin/MasherPlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -33,6 +33,7 @@ virtual PluginInfo &Initialise(const HostInfo *Host); virtual SpiralGUIType *CreateGUI(); virtual void Execute(); + virtual void Reset(); virtual void StreamOut(std::ostream &s); virtual void StreamIn(std::istream &s); diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MatrixPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MatrixPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MatrixPlugin/Makefile.in 2004-01-17 10:32:42.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MatrixPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -13,10 +13,7 @@ LFLAGS = LIBS = @FLTK_LIBS@ MOC = moc -UIC = - -TAR = tar -cf -GZIP = gzip -9f +UIC = INSTALL = @INSTALL@ @@ -102,13 +99,6 @@ moc: $(SRCMOC) -tmake: - tmake MatrixPlugin.pro - -dist: - $(TAR) MatrixPlugin.tar MatrixPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) MatrixPlugin.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MatrixPlugin/MatrixPlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MatrixPlugin/MatrixPlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MatrixPlugin/MatrixPlugin.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MatrixPlugin/MatrixPlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -154,6 +154,25 @@ this,m_AudioCH,m_HostInfo); } +void MatrixPlugin::Reset() +{ + ResetPorts(); + m_Current = GetPatSeq(0); + m_GUICurrent = 0; + m_Time = 0.0f; + m_Step = 0; + m_TickTime = 1.0f/(float)m_HostInfo->SAMPLERATE; + m_StepTime = 1.0f; + m_CurPatSeq = 0; + m_CurrentNoteCV = 0; + m_CurrentTriggerCV = 0; + m_Triggered = false; + m_ClockHigh = false; + m_CopyPattern = 0; + m_PatAdvance = false; + m_PatReset = false; +} + void MatrixPlugin::Execute() { for (int n=0; nBUFSIZE; n++) diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MatrixPlugin/MatrixPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MatrixPlugin/MatrixPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MatrixPlugin/MatrixPluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MatrixPlugin/MatrixPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -18,7 +18,8 @@ #include "MatrixPluginGUI.h" #include -//#include +#include +//#include using namespace std; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MatrixPlugin/MatrixPlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MatrixPlugin/MatrixPlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MatrixPlugin/MatrixPlugin.h 2003-08-08 17:04:48.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MatrixPlugin/MatrixPlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -45,6 +45,7 @@ virtual PluginInfo &Initialise(const HostInfo *Host); virtual SpiralGUIType *CreateGUI(); virtual void Execute(); + virtual void Reset(); virtual void ExecuteCommands(); virtual void StreamOut(std::ostream &s); virtual void StreamIn(std::istream &s); diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MatrixPlugin/MatrixPlugin.pro spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MatrixPlugin/MatrixPlugin.pro --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MatrixPlugin/MatrixPlugin.pro 2002-07-28 23:18:14.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MatrixPlugin/MatrixPlugin.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -HEADERS = ../SpiralPlugin.h \ - ../SpiralPluginGUI.h \ - ../Widgets/Fl_Knob.H \ - ../Widgets/Fl_DragBar.H \ - ../Widgets/Fl_LED_Button.H \ - ../../Sample.h \ - MatrixPlugin.h \ - MatrixPluginGUI.h - -SOURCES = ../SpiralPlugin.C \ - ../SpiralPluginGUI.C \ - ../Widgets/Fl_Knob.cxx \ - ../Widgets/Fl_DragBar.cxx \ - ../Widgets/Fl_LED_Button.cxx \ - ../../Sample.C \ - MatrixPlugin.C \ - MatrixPluginGUI.C - -TARGET = MatrixPlugin.so diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MeterPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MeterPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MeterPlugin/Makefile.in 2004-01-17 10:32:42.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MeterPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -15,9 +15,6 @@ MOC = moc UIC = -TAR = tar -cf -GZIP = gzip -9f - INSTALL = @INSTALL@ ###### Autoconf variables @@ -102,13 +99,6 @@ moc: $(SRCMOC) -tmake: - tmake MeterPlugin.pro - -dist: - $(TAR) MeterPlugin.tar MeterPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) MeterPlugin.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MeterPlugin/MeterPlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MeterPlugin/MeterPlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MeterPlugin/MeterPlugin.C 2004-02-14 08:42:36.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MeterPlugin/MeterPlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -30,12 +30,13 @@ int SpiralPlugin_GetID() { return 123; } -string SpiralPlugin_GetGroupName() { return "Control"; } +string SpiralPlugin_GetGroupName() { return "InputOutput"; } } MeterPlugin::MeterPlugin(): m_Data (NULL), +m_DataSize (0), m_DataReady (false), m_VUMode (true) { @@ -47,6 +48,9 @@ m_PluginInfo.PortTips.push_back ("Input"); m_PluginInfo.PortTips.push_back ("Output"); m_AudioCH->Register ("DataReady", &m_DataReady, ChannelHandler::OUTPUT); + m_AudioCH->Register ("DataSizeChanged", &m_DataSizeChanged, ChannelHandler::OUTPUT); + m_AudioCH->Register ("DataSize", &m_DataSize, ChannelHandler::OUTPUT); + m_Version = 1; } @@ -56,8 +60,9 @@ PluginInfo &MeterPlugin::Initialise (const HostInfo *Host) { PluginInfo& Info = SpiralPlugin::Initialise (Host); - m_Data = new float[Host->BUFSIZE]; - m_AudioCH->RegisterData ("AudioData", ChannelHandler::OUTPUT, m_Data, Host->BUFSIZE * sizeof (float)); + m_DataSize = Host->BUFSIZE; + m_Data = new float[m_DataSize]; + m_AudioCH->RegisterData ("AudioData", ChannelHandler::OUTPUT, m_Data, m_DataSize * sizeof (float)); return Info; } @@ -65,19 +70,36 @@ return new MeterPluginGUI (m_PluginInfo.Width, m_PluginInfo.Height, this, m_AudioCH, m_HostInfo); } +void MeterPlugin::Reset() +{ + ResetPorts(); + m_DataReady = false; + delete m_Data; + m_DataSize = m_HostInfo->BUFSIZE; + m_Data = new float[m_DataSize]; + m_DataSizeChanged = true; +} + void MeterPlugin::Execute() { // Just copy the data through. m_DataReady = InputExists (0); if (GetOutputBuf (0)) GetOutputBuf (0)->Zero(); if (m_DataReady) { GetOutputBuf (0)->Mix (*GetInput(0), 0); - memcpy (m_Data, GetInput (0)->GetBuffer (), m_HostInfo->BUFSIZE * sizeof (float)); + memcpy (m_Data, GetInput (0)->GetBuffer (), m_DataSize * sizeof (float)); } } void MeterPlugin::ExecuteCommands () { if (m_AudioCH->IsCommandWaiting ()) { switch (m_AudioCH->GetCommand()) { + case UPDATEDATASIZE : + { + m_AudioCH->ReplaceData("AudioData", m_Data, m_DataSize*sizeof(float)); + m_DataSizeChanged = false; + } + break; + case (SETVU) : m_VUMode = true; break; case (SETMM) : m_VUMode = false; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MeterPlugin/MeterPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MeterPlugin/MeterPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MeterPlugin/MeterPluginGUI.C 2004-02-14 08:42:36.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MeterPlugin/MeterPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -94,6 +94,16 @@ SpiralGUIType::draw (); if (! m_Bypass) { float datum = 0.0; + if (m_GUICH->GetBool ("DataSizeChanged")) + { + m_GUICH->SetCommand (MeterPlugin::UPDATEDATASIZE); + m_GUICH->Wait(); + + m_BufSize = m_GUICH->GetInt("DataSize"); + delete[] m_Data; + m_Data = new float[m_BufSize]; + } + if (m_GUICH->GetBool ("DataReady")) m_GUICH->GetData ("AudioData", m_Data); else memset (m_Data, 0, m_BufSize * sizeof (float)); // The min and max values are based on the whole buffer @@ -108,7 +118,7 @@ Meter->value (datum); Meter->redraw(); // Yeuck - have I REALLY used stdio for that - this is supposed to be C++ - //snprintf (label_buf, 64, "%1.5f", *m_Data); + snprintf (label_buf, 64, "%1.5f", datum); char* c = label_buf; for (int display=0; display<8; display++) { Digits[display] -> dp (off); diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MeterPlugin/MeterPlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MeterPlugin/MeterPlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MeterPlugin/MeterPlugin.h 2004-02-14 08:42:36.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MeterPlugin/MeterPlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -28,15 +28,17 @@ virtual PluginInfo& Initialise (const HostInfo *Host); virtual SpiralGUIType* CreateGUI(); virtual void Execute(); + virtual void Reset(); virtual void ExecuteCommands(); virtual void StreamOut (std::ostream &s); virtual void StreamIn (std::istream &s); int GetVUMode (void) { return m_VUMode; } - enum GUICommands {NONE, SETVU, SETMM}; + enum GUICommands {NONE, SETVU, SETMM, UPDATEDATASIZE}; private: float *m_Data; + int m_DataSize; // m_VUMode isn't USED for anything, it's here so we can save/load it - bool m_DataReady, m_VUMode; + bool m_DataReady, m_VUMode, m_DataSizeChanged; }; #endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MidiPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MidiPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MidiPlugin/Makefile.in 2004-01-17 10:32:43.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MidiPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -15,9 +15,6 @@ MOC = moc UIC = -TAR = tar -cf -GZIP = gzip -9f - INSTALL = @INSTALL@ ###### Autoconf variables @@ -102,13 +99,6 @@ moc: $(SRCMOC) -tmake: - tmake MidiPlugin.pro - -dist: - $(TAR) MidiPlugin.tar MidiPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) MidiPlugin.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MidiPlugin/MidiPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MidiPlugin/MidiPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MidiPlugin/MidiPluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MidiPlugin/MidiPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -18,7 +18,7 @@ #include "MidiPluginGUI.h" #include -#include +#include #include #include diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MidiPlugin/MidiPlugin.pro spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MidiPlugin/MidiPlugin.pro --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MidiPlugin/MidiPlugin.pro 2002-07-28 23:18:15.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MidiPlugin/MidiPlugin.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -HEADERS = ../SpiralPlugin.h \ - ../SpiralPluginGUI.h \ - ../Widgets/Fl_Knob.H \ - ../Widgets/Fl_DragBar.H \ - ../../Sample.h \ - ../../Midi.h \ - MidiPlugin.h \ - MidiPluginGUI.h - -SOURCES = ../SpiralPlugin.C \ - ../SpiralPluginGUI.C \ - ../Widgets/Fl_Knob.cxx \ - ../Widgets/Fl_DragBar.cxx \ - ../../Sample.C \ - ../../Midi.C \ - MidiPlugin.C \ - MidiPluginGUI.C - -TARGET = MidiPlugin.so diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MixerPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MixerPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MixerPlugin/Makefile.in 2004-01-17 10:32:43.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MixerPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -15,9 +15,6 @@ MOC = moc UIC = -TAR = tar -cf -GZIP = gzip -9f - INSTALL = @INSTALL@ ###### Autoconf variables @@ -99,13 +96,6 @@ moc: $(SRCMOC) -tmake: - tmake MixerPlugin.pro - -dist: - $(TAR) MixerPlugin.tar MixerPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) MixerPlugin.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MixerPlugin/MixerPlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MixerPlugin/MixerPlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MixerPlugin/MixerPlugin.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MixerPlugin/MixerPlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -25,45 +25,46 @@ using namespace std; extern "C" { - - SpiralPlugin* SpiralPlugin_CreateInstance() { - return new MixerPlugin; - } - - char** SpiralPlugin_GetIcon() { - return SpiralIcon_xpm; - } - - int SpiralPlugin_GetID() { - return 0x0007; - } - - string SpiralPlugin_GetGroupName() { - return "Amps/Mixers"; - } - + SpiralPlugin* SpiralPlugin_CreateInstance() { return new MixerPlugin; } + char** SpiralPlugin_GetIcon() { return SpiralIcon_xpm; } + int SpiralPlugin_GetID() { return 0x0007; } + string SpiralPlugin_GetGroupName() { return "Amps/Mixers"; } } /////////////////////////////////////////////////////// MixerPlugin::MixerPlugin() : -m_NumChannels(0) +m_NumChannels(4) { + int c; m_Version = 2; m_PluginInfo.Name = "Mixer"; m_PluginInfo.Width = 80; - m_PluginInfo.Height = 140; + m_PluginInfo.Height = 150; + for (c=0; cRegister ("Value", &m_GUIArgs.Value); m_AudioCH->Register ("Num", &m_GUIArgs.Num); m_AudioCH->Register ("Peak", &m_GUIArgs.Peak, ChannelHandler::OUTPUT); + m_AudioCH->RegisterData ("inPeak", ChannelHandler::OUTPUT, m_GUIArgs.inPeak, MAX_CHANNELS * sizeof (bool)); } MixerPlugin::~MixerPlugin() { } +void MixerPlugin::AddInputTip (int Channel) { + char t[256]; + sprintf (t, "Input %d", Channel); + m_PluginInfo.PortTips.push_back (t); +} + PluginInfo &MixerPlugin::Initialise (const HostInfo *Host) { return SpiralPlugin::Initialise (Host); } @@ -75,9 +76,12 @@ void MixerPlugin::Execute () { // Mix the inputs for (int n=0; nBUFSIZE; n++) { - float out = 0.0; - for (int c=0; c 1.0); + out += in; + } SetOutput (0, n, out); m_GUIArgs.Peak = (out > 1.0); } @@ -86,48 +90,56 @@ void MixerPlugin::ExecuteCommands() { if (m_AudioCH->IsCommandWaiting()) { switch (m_AudioCH->GetCommand()) { - case SETCH: + case SETMIX: m_ChannelVal[m_GUIArgs.Num] = m_GUIArgs.Value; break; - case SETNUM: - SetChannels (m_GUIArgs.Num); + case ADDCHAN: + AddChannel (); + break; + case REMOVECHAN: + RemoveChannel (); break; } } } -void MixerPlugin::SetChannels (int n) { - // once to clear the connections with the current info - // do we need this???? - UpdatePluginInfoWithHost(); - // Things can get a bit confused deleting and adding inputs so we just chuck away all the ports... - RemoveAllInputs (); - RemoveAllOutputs (); - m_PluginInfo.NumInputs = 0; - m_PluginInfo.NumOutputs = 0; +void MixerPlugin::SetChannels (int num) { + // This is only used on loading, so we don't care that it clears all the inputs first + UpdatePluginInfoWithHost(); // once to clear the connections with the current info + RemoveAllInputs(); m_PluginInfo.PortTips.clear (); - // ... and then create some new ones - CreatePorts (n, true); - // do the actual update - UpdatePluginInfoWithHost (); + m_PluginInfo.NumInputs = num; + m_NumChannels = num; + for (int c=1; c<=m_NumChannels; c++) { + AddInput (); + AddInputTip (c); + } + m_PluginInfo.PortTips.push_back ("Output"); + UpdatePluginInfoWithHost (); // do the actual update } -void MixerPlugin::CreatePorts (int n, bool AddPorts) { - // default values n = 4 AddPorts = false - int c; - m_PluginInfo.NumInputs = n; - m_NumChannels = n; - char t[256]; - for (c=1; c<=n; c++) { - sprintf (t, "Input %d", c); - m_PluginInfo.PortTips.push_back (t); - } - m_PluginInfo.NumOutputs = 1; +void MixerPlugin::AddChannel (void) { + UpdatePluginInfoWithHost(); // once to clear the connections with the current info + m_PluginInfo.NumInputs++; + m_NumChannels++; + AddInput (); + vector::iterator i = m_PluginInfo.PortTips.end(); + m_PluginInfo.PortTips.erase (--i); + AddInputTip (m_NumChannels); m_PluginInfo.PortTips.push_back ("Output"); - if (AddPorts) { - for (c=0; c::iterator i = m_PluginInfo.PortTips.end(); + m_PluginInfo.PortTips.erase (--i); + m_PluginInfo.PortTips.erase (--i); + m_PluginInfo.PortTips.push_back ("Output"); + RemoveInput(); + UpdatePluginInfoWithHost (); // do the actual update } void MixerPlugin::StreamOut (ostream &s) { @@ -140,7 +152,7 @@ int version, chans; s >> version; switch (version) { - case 1: SetChannels (4); + case 1: // needs default number of channels break; case 2: s >> chans; SetChannels (chans); diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MixerPlugin/MixerPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MixerPlugin/MixerPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MixerPlugin/MixerPluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MixerPlugin/MixerPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -18,24 +18,49 @@ #include "MixerPluginGUI.h" #include +#include using namespace std; +const float default_slider_value = 1.0f; + +//////////////////////////////////////////// + +MixerPluginGUI::ChanGUI::ChanGUI (int ChanNum, MixerPluginGUI *p, Fl_Color SelColour) { + m_SliderGroup = new Fl_Group (0, 0, 20, 108, ""); + m_SliderGroup->user_data ((void *)p); + + m_PeakInd = new Fl_LED_Button (0, -8, 20, 20, ""); + m_SliderGroup->add (m_PeakInd); + + m_Chan = new Fl_Slider (0, 8, 20, 100, ""); + m_Chan->type (FL_VERT_NICE_SLIDER); + m_Chan->box (FL_PLASTIC_DOWN_BOX); + m_Chan->selection_color (SelColour); + m_Chan->maximum (2); + m_Chan->step (0.01); + m_Chan->value (default_slider_value); + m_Chan->labelsize (10); + m_Chan->callback ((Fl_Callback*)MixerPluginGUI::cb_Chan, (void*)&Numbers[ChanNum]); + m_SliderGroup->add(m_Chan); +} + //////////////////////////////////////////// MixerPluginGUI::MixerPluginGUI (int w, int h, MixerPlugin *o, ChannelHandler *ch, const HostInfo *Info) : SpiralPluginGUI (w, h, o, ch) { m_GUIColour = (Fl_Color)Info->GUI_COLOUR; - for (int n=0; ntype (FL_HORIZONTAL); add (m_MainPack); // start with four... AddChan(); AddChan(); AddChan(); AddChan(); - m_Buttons = new Fl_Pack (0, 118, 62, 20); + m_Buttons = new Fl_Pack (0, 126, 62, 20); m_Buttons->type (FL_HORIZONTAL); add (m_Buttons); @@ -60,41 +85,30 @@ } void MixerPluginGUI::AddChan (bool SendData, bool ResizeIt) { - Fl_Slider *NewSlide = new Fl_Slider (0, 0, 20, 100, ""); - NewSlide->user_data ((void*)(this)); - NewSlide->type (FL_VERT_NICE_SLIDER); - NewSlide->selection_color (m_GUIColour); - NewSlide->box (FL_PLASTIC_DOWN_BOX); - NewSlide->labelsize (10); - NewSlide->maximum (2); - NewSlide->step (0.01); - NewSlide->value (1.0); - int num = (int)m_SlidVec.size(); - NewSlide->callback ((Fl_Callback*)cb_Chan, (void*)&Numbers[num]); - m_MainPack->add (NewSlide); - m_SlidVec.push_back (NewSlide); + int num = (int)m_GUIVec.size(); + ChanGUI *NewChan = new ChanGUI (num, this, m_GUIColour); + m_GUIVec.push_back (NewChan); + m_MainPack->add (NewChan->m_SliderGroup); if (SendData) { - m_GUICH->Set ("Num", ++num); - m_GUICH->SetCommand (MixerPlugin::SETNUM); + m_GUICH->SetCommand (MixerPlugin::ADDCHAN); m_GUICH->Wait (); - m_GUICH->Set ("Num", num); - m_GUICH->Set ("Value", (float)(2.0f - NewSlide->value ())); - m_GUICH->SetCommand(MixerPlugin::SETCH); + m_GUICH->Set ("Num", ++num); + m_GUICH->Set ("Value", (float)(2.0f - default_slider_value)); + m_GUICH->SetCommand(MixerPlugin::SETMIX); m_GUICH->Wait (); } if (ResizeIt && num > 3) Resize (w()+20, h()); } void MixerPluginGUI::DeleteChan (bool SendData) { - vector::iterator i = m_SlidVec.end (); + vector::iterator i = m_GUIVec.end(); i--; - m_MainPack->remove (*i); + m_MainPack->remove ((*i)->m_SliderGroup); delete *i; - m_SlidVec.erase (i); - int num = (int)m_SlidVec.size(); + m_GUIVec.erase (i); + int num = (int)m_GUIVec.size(); if (SendData) { - m_GUICH->Set ("Num", num); - m_GUICH->SetCommand (MixerPlugin::SETNUM); + m_GUICH->SetCommand (MixerPlugin::REMOVECHAN); m_GUICH->Wait (); } if (num > 2) Resize (w()-20, h()); @@ -103,20 +117,24 @@ void MixerPluginGUI::UpdateValues(SpiralPlugin *o) { MixerPlugin *Plugin = (MixerPlugin *)o; unsigned int chans = Plugin->GetChannels(); - while (chans < m_SlidVec.size()) DeleteChan (false); - while (chans > m_SlidVec.size()) AddChan (false, true); - for (unsigned int n=0; nvalue (2.0f - Plugin->GetChannel (n)); + while (chans < m_GUIVec.size()) DeleteChan (false); + while (chans > m_GUIVec.size()) AddChan (false, true); + for (unsigned int c=0; cm_Chan->value (2.0f - Plugin->GetChannel (c)); redraw(); } void MixerPluginGUI::Update () { if (m_GUICH->GetBool ("Peak")) m_PeakInd->value (true); + m_GUICH->GetData ("inPeak", m_inPeak); + for (unsigned int c=0; cm_PeakInd->value (true); + } } inline void MixerPluginGUI::cb_Add_i (Fl_Button* o, void* v) { m_PeakInd->value (false); - if ((int)m_SlidVec.size() < MAX_CHANNELS) AddChan (true, true); + if ((int)m_GUIVec.size() < MAX_CHANNELS) AddChan (true, true); } void MixerPluginGUI::cb_Add (Fl_Button* o, void* v) { @@ -125,7 +143,7 @@ inline void MixerPluginGUI::cb_Delete_i (Fl_Button* o, void* v) { m_PeakInd->value (false); - if (m_SlidVec.size() > 2) DeleteChan (); + if (m_GUIVec.size() > 2) DeleteChan (); } void MixerPluginGUI::cb_Delete (Fl_Button* o, void* v) { @@ -133,29 +151,26 @@ } inline void MixerPluginGUI::cb_Chan_i (Fl_Slider* o, void* v) { - // This line works fine - // cerr << *(int*)(v) << endl << (float)(2.0f-o->value()) << endl; - // The segfault comes when you do any of the following - don't know why + int num = (*(int*)(v)); m_PeakInd->value (false); - m_GUICH->Set("Num", (*(int*)(v))); + m_GUIVec[num]->m_PeakInd->value (false); + m_GUICH->Set("Num", num); m_GUICH->Set("Value", (float)(2.0f-o->value())); - m_GUICH->SetCommand (MixerPlugin::SETCH); + m_GUICH->SetCommand (MixerPlugin::SETMIX); } void MixerPluginGUI::cb_Chan(Fl_Slider* o, void* v) { - // If you use user_data() instead of parent()->parent() you get a segfault - don't know why - ((MixerPluginGUI*)(o->parent()->parent()))->cb_Chan_i (o, v); + ((MixerPluginGUI*)(o->parent()->user_data()))->cb_Chan_i (o, v); } -// you sometimes get a segfault on exit too - again - don't know why - const string MixerPluginGUI::GetHelpText (const string &loc){ return string("") + "A general purpose mixer.\n" + "Useful for mixing CV values as well as mono audio\n" + "signals.\n" - + "The LED indicates the the mixer output is at peak\n" - + "level, click on it, or change levels to reset it.\n" + + "The LEDs indicate the the mixer inputs or output is\n" + + "at peak level, click on them, or change appropriate\n" + + "levels to reset them.\n" + "Add up to 16 channels using the '+' button.\n" + "Use the '-' button to remove unwanted channels.\n"; } diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MixerPlugin/MixerPluginGUI.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MixerPlugin/MixerPluginGUI.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MixerPlugin/MixerPluginGUI.h 2003-08-08 17:55:50.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MixerPlugin/MixerPluginGUI.h 2012-05-31 04:13:57.000000000 +0000 @@ -28,7 +28,8 @@ static int Numbers[MAX_CHANNELS]; -class MixerPluginGUI : public SpiralPluginGUI { +class MixerPluginGUI : public SpiralPluginGUI +{ public: MixerPluginGUI (int w, int h, MixerPlugin *o, ChannelHandler *ch, const HostInfo *Info); virtual void UpdateValues(SpiralPlugin *o); @@ -36,9 +37,18 @@ protected: const std::string GetHelpText(const std::string &loc); private: + bool m_inPeak[MAX_CHANNELS]; + class ChanGUI { + public: + ChanGUI (int ChanNum, MixerPluginGUI *p, Fl_Color SelColour); + Fl_Group *m_SliderGroup; + Fl_Slider *m_Chan; + Fl_LED_Button *m_PeakInd; + }; + friend class ChanGUI; void AddChan (bool SendData = false, bool ResizeIt = false); void DeleteChan (bool SendData = true); - std::vector m_SlidVec; + std::vector m_GUIVec; Fl_Pack *m_MainPack, *m_Buttons; Fl_Button *m_Add, *m_Delete; Fl_LED_Button *m_PeakInd; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MixerPlugin/MixerPlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MixerPlugin/MixerPlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MixerPlugin/MixerPlugin.h 2003-08-08 17:55:50.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MixerPlugin/MixerPlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -35,19 +35,22 @@ virtual void StreamIn(std::istream &s); // has to be defined in the plugin virtual void UpdateGUI() { Fl::check(); } - enum GUICommands { NONE, SETCH, SETNUM }; + enum GUICommands { NONE, SETMIX, ADDCHAN, REMOVECHAN }; struct GUIArgs { int Num; float Value; + bool inPeak[MAX_CHANNELS]; bool Peak; }; float GetChannel (int n) { return m_ChannelVal[n]; } int GetChannels (void) { return m_NumChannels; } private: - void CreatePorts (int n = 4, bool AddPorts = false); + void AddChannel (void); + void RemoveChannel (void); + void AddInputTip (int Channel); GUIArgs m_GUIArgs; int m_NumChannels; - void SetChannels (int n); + void SetChannels (int num); float m_ChannelVal[MAX_CHANNELS]; }; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MixerPlugin/MixerPlugin.pro spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MixerPlugin/MixerPlugin.pro --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MixerPlugin/MixerPlugin.pro 2002-07-28 23:18:15.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MixerPlugin/MixerPlugin.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -HEADERS = ../SpiralPlugin.h \ - ../SpiralPluginGUI.h \ - ../Widgets/Fl_Knob.H \ - ../Widgets/Fl_DragBar.H \ - ../../Sample.h \ - MixerPlugin.h \ - MixerPluginGUI.h - -SOURCES = ../SpiralPlugin.C \ - ../SpiralPluginGUI.C \ - ../Widgets/Fl_Knob.cxx \ - ../Widgets/Fl_DragBar.cxx \ - ../../Sample.C \ - MixerPlugin.C \ - MixerPluginGUI.C - -TARGET = MixerPlugin.so diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MixSwitchPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MixSwitchPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MixSwitchPlugin/Makefile.in 2004-01-17 10:32:43.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MixSwitchPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -13,10 +13,7 @@ LFLAGS = LIBS = @FLTK_LIBS@ MOC = moc -UIC = - -TAR = tar -cf -GZIP = gzip -9f +UIC = INSTALL = @INSTALL@ @@ -99,13 +96,6 @@ moc: $(SRCMOC) -tmake: - tmake MixSwitchPlugin.pro - -dist: - $(TAR) MixSwitchPlugin.tar MixSwitchPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) MixSwitchPlugin.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MixSwitchPlugin/MixSwitchPlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MixSwitchPlugin/MixSwitchPlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MixSwitchPlugin/MixSwitchPlugin.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MixSwitchPlugin/MixSwitchPlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -77,7 +77,6 @@ } } } - void MixSwitchPlugin::CreatePorts (int n, bool AddPorts) { int c; m_PluginInfo.NumInputs = 2 + n; @@ -114,6 +113,19 @@ UpdatePluginInfoWithHost (); } + +void MixSwitchPlugin::Reset() +{ + ResetPorts(); + m_SwitchPos = 1; + m_Triggered = false; + + m_GUIArgs.Chans = 2; + m_GUIArgs.Switch = 1; + m_GUIArgs.Echo = 1; + m_GUIArgs.Auto = false; +} + void MixSwitchPlugin::Execute() { float f; int p; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MixSwitchPlugin/MixSwitchPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MixSwitchPlugin/MixSwitchPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MixSwitchPlugin/MixSwitchPluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MixSwitchPlugin/MixSwitchPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -18,6 +18,7 @@ #include "MixSwitchPluginGUI.h" #include +#include using namespace std; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MixSwitchPlugin/MixSwitchPlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MixSwitchPlugin/MixSwitchPlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MixSwitchPlugin/MixSwitchPlugin.h 2003-10-09 18:46:14.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MixSwitchPlugin/MixSwitchPlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -29,6 +29,7 @@ virtual PluginInfo& Initialise (const HostInfo *Host); virtual SpiralGUIType* CreateGUI (); virtual void Execute (); + virtual void Reset(); virtual void ExecuteCommands(); virtual void StreamOut (std::ostream &s); virtual void StreamIn (std::istream &s); diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MoogFilterPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MoogFilterPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MoogFilterPlugin/Makefile.in 2004-01-17 10:32:43.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MoogFilterPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -15,9 +15,6 @@ MOC = moc UIC = -TAR = tar -cf -GZIP = gzip -9f - INSTALL = @INSTALL@ ###### Autoconf variables @@ -99,13 +96,6 @@ moc: $(SRCMOC) -tmake: - tmake MoogFilterPlugin.pro - -dist: - $(TAR) MoogFilterPlugin.tar MoogFilterPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) MoogFilterPlugin.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MoogFilterPlugin/MoogFilterPlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MoogFilterPlugin/MoogFilterPlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MoogFilterPlugin/MoogFilterPlugin.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MoogFilterPlugin/MoogFilterPlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -101,6 +101,13 @@ this,m_AudioCH,m_HostInfo); } +void MoogFilterPlugin::Reset() +{ + ResetPorts(); + fs = m_HostInfo->SAMPLERATE; + Clear(); +} + void MoogFilterPlugin::Execute() { float in, Q; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MoogFilterPlugin/MoogFilterPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MoogFilterPlugin/MoogFilterPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MoogFilterPlugin/MoogFilterPluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MoogFilterPlugin/MoogFilterPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -18,6 +18,7 @@ #include "MoogFilterPluginGUI.h" #include +#include using namespace std; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MoogFilterPlugin/MoogFilterPlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MoogFilterPlugin/MoogFilterPlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MoogFilterPlugin/MoogFilterPlugin.h 2003-11-13 01:16:52.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MoogFilterPlugin/MoogFilterPlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -31,6 +31,8 @@ virtual PluginInfo &Initialise(const HostInfo *Host); virtual SpiralGUIType *CreateGUI(); virtual void Execute(); + virtual void Reset(); + virtual void StreamOut(std::ostream &s); virtual void StreamIn(std::istream &s); diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MoogFilterPlugin/MoogFilterPlugin.pro spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MoogFilterPlugin/MoogFilterPlugin.pro --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MoogFilterPlugin/MoogFilterPlugin.pro 2002-07-28 23:18:15.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MoogFilterPlugin/MoogFilterPlugin.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -HEADERS = ../SpiralPlugin.h \ - ../SpiralPluginGUI.h \ - ../Widgets/Fl_Knob.H \ - ../Widgets/Fl_DragBar.H \ - ../../Sample.h \ - MoogFilterPlugin.h \ - MoogFilterPluginGUI.h - -SOURCES = ../SpiralPlugin.C \ - ../SpiralPluginGUI.C \ - ../Widgets/Fl_Knob.cxx \ - ../Widgets/Fl_DragBar.cxx \ - ../../Sample.C \ - MoogFilterPlugin.C \ - MoogFilterPluginGUI.C - -TARGET = MoogFilterPlugin.so diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MousePlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MousePlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MousePlugin/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MousePlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,160 @@ +############################################################################# +# Makefile for building MousePlugin.so +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ @FLTK_CFLAGS@ +CXXFLAGS= @CXXFLAGS@ @FLTK_CXXFLAGS@ +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = @FLTK_LIBS@ +MOC = moc +UIC = + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = MousePlugin.h \ + MousePluginGUI.h \ + ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../../ChannelHandler.h \ + ../../Sample.h \ + scratch.h \ + ../Widgets/Fl_LED_Button.H \ + ../../../GUI/Widgets/SpiralGUI.H +SOURCES = MousePlugin.C \ + MousePluginGUI.C \ + ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../../ChannelHandler.C \ + ../../Sample.C \ + scratch.C \ + ../Widgets/Fl_LED_Button.cxx \ + ../../../GUI/Widgets/SpiralGUI.C +OBJECTS = MousePlugin.o \ + MousePluginGUI.o \ + ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../../ChannelHandler.o \ + ../../Sample.o \ + scratch.o \ + ../Widgets/Fl_LED_Button.o \ + ../../../GUI/Widgets/SpiralGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = MousePlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../ChannelHandler.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../SpiralPlugin.h \ + ../../ChannelHandler.h \ + ../../../GUI/Widgets/SpiralGUI.H + +../Widgets/Fl_LED_Button.o: ../Widgets/Fl_LED_Button.cxx \ + ../Widgets/Fl_LED_Button.H + +../../../GUI/Widgets/SpiralGUI.o: ../../../GUI/Widgets/SpiralGUI.C \ + ../../../GUI/Widgets/SpiralGUI.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h + +MousePlugin.o: MousePlugin.C \ + MousePlugin.h \ + MousePluginGUI.h \ + ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../../Sample.h \ + scratch.h \ + SpiralIcon.xpm + +MousePluginGUI.o: MousePluginGUI.C \ + MousePluginGUI.h \ + MousePlugin.h \ + ../SpiralPluginGUI.h \ + ../SpiralPlugin.h \ + ../Widgets/Fl_LED_Button.H \ + ../../../GUI/Widgets/SpiralGUI.H \ + ../../Sample.h \ + scratch.h + +../../ChannelHandler.o: ../../ChannelHandler.C \ + ../../ChannelHandler.h + +scratch.o: scratch.C \ + scratch.h + diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MousePlugin/MousePlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MousePlugin/MousePlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MousePlugin/MousePlugin.C 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MousePlugin/MousePlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,132 @@ +/* MousePlugin + * Copyleft (C) 2002 Dan Bethell + * Dave Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + + +#define SCRATCH_DEVICE "/dev/ttyS0" + +#include + +#include "MousePlugin.h" +#include "MousePluginGUI.h" +#include "SpiralIcon.xpm" + +extern "C" { + +SpiralPlugin* SpiralPlugin_CreateInstance() { return new MousePlugin; } + +char** SpiralPlugin_GetIcon() { return SpiralIcon_xpm; } + +int SpiralPlugin_GetID() { return 300; } + +// string SpiralPlugin_GetGroupName() { return "InputOutput"; } + +} + +/////////////////////////////////////////////////////// + +MousePluginSingleton* MousePluginSingleton::m_Singleton = NULL; + +int MousePlugin::m_RefCount=0; + +MousePluginSingleton::MousePluginSingleton() { + scr = new scratch(SCRATCH_DEVICE); // create scratch object +} + +MousePluginSingleton::~MousePluginSingleton() { + if (scr!=NULL) delete scr; +} + +/////////////////////////////////////////////////////// + +MousePlugin::MousePlugin(): +m_Port ('0'), +m_Data (0.0) +{ + m_RefCount++; + m_PluginInfo.Name = "Mouse"; + m_PluginInfo.Width = 100; + m_PluginInfo.Height = 140; + m_PluginInfo.NumInputs = 1; + m_PluginInfo.NumOutputs = 1; + m_PluginInfo.PortTips.push_back ("Trigger"); + m_PluginInfo.PortTips.push_back ("Output"); + m_AudioCH->Register ("Port", &m_Port); + m_Version = 2; +} + +MousePlugin::~MousePlugin() { + m_RefCount--; + if (m_RefCount==0) { + MousePluginSingleton::PackUpAndGoHome(); + } +} + +PluginInfo &MousePlugin::Initialise (const HostInfo *Host) { + PluginInfo& Info = SpiralPlugin::Initialise (Host); + m_AudioCH->Register ("Data", &m_Data, ChannelHandler::OUTPUT); + return Info; +} + +SpiralGUIType *MousePlugin::CreateGUI() { + return new MousePluginGUI (m_PluginInfo.Width, m_PluginInfo.Height, this, m_AudioCH, m_HostInfo); +} + +void MousePlugin::ExecuteCommands () { + if (m_AudioCH->IsCommandWaiting ()) { + switch (m_AudioCH->GetCommand()) { + case (SETPORT) : // do something + break; + } + } +} + +void MousePlugin::Execute() { + float trigger = 1.0; + if (GetOutputBuf(0)) { + if (InputExists(0)) { + trigger = GetInput(0,0); + } + char c = MousePluginSingleton::Get()->getScr()->getData(); + if (c!=0x0) { + float val; + int ch = (int)c; + val = (float)(ch / 127.00); + if (val>1) val=1; + if (val<-1) val=-1; + if (trigger>0) { + GetOutputBuf(0)->Set (val); + m_Data = val; + } else { + GetOutputBuf(0)->Set (m_Data); + } + } else { + GetOutputBuf(0)->Set (m_Data); + } + } +} + +void MousePlugin::StreamOut (ostream &s) { + s << m_Version << " " << m_Port; +} + +void MousePlugin::StreamIn (istream &s) { + int Version; + s >> Version; + if (Version > 1) s >> m_Port; +} diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MousePlugin/MousePluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MousePlugin/MousePluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MousePlugin/MousePluginGUI.C 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MousePlugin/MousePluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,97 @@ +/* MousePlugin + * Copyleft (C) 2002 Dan Bethell + * Dave Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "MousePluginGUI.h" +#include +#include + +ScratchWidget::ScratchWidget (int x, int y, int w, int h, const char *l) : +Fl_Widget (x, y, w, h, l), +m_Data (0.0) +{ +} + +void ScratchWidget::draw() { + fl_color (color ()); + fl_rectf (x(), y(), w(), h()); + fl_push_clip (x(), y(), w(), h()); + int val = (int)(((m_Data * -1) + 1) * (h() / 2.0)); + fl_color (selection_color ()); + fl_rectf (x(), y() + val, w(), h()); + fl_pop_clip(); +} + +//////////////////////////////////////////// + +MousePluginGUI::MousePluginGUI (int w, int h, MousePlugin *o, ChannelHandler *ch, const HostInfo *Info) : +SpiralPluginGUI (w, h, o, ch) +{ + m_Port0 = new Fl_LED_Button (0, 10, 23, 23); + m_Port0->type (FL_RADIO_BUTTON); + m_Port0->labelsize (10); + m_Port0->label ("ttyS0"); + m_Port0->set(); + m_Port0->callback ((Fl_Callback*)cb_Port0); + + m_Port1 = new Fl_LED_Button (50, 10, 23, 23); + m_Port1->type (FL_RADIO_BUTTON); + m_Port1->labelsize (10); + m_Port1->label ("ttyS1"); + m_Port1->callback ((Fl_Callback*)cb_Port1); + + m_Scope = new ScratchWidget (10, 32, 80, 100, "Scratch"); + m_Scope->color(Info->SCOPE_BG_COLOUR); + m_Scope->selection_color(Info->SCOPE_FG_COLOUR); + + end(); +} + +void MousePluginGUI::Update () { + m_Scope->m_Data = m_GUICH->GetFloat ("Data"); + m_Scope->redraw(); +} + +void MousePluginGUI::UpdateValues (SpiralPlugin* o) { + MousePlugin *Plugin = (MousePlugin*)o; + if (Plugin->GetPort() == '1') m_Port1->setonly(); +} + +inline void MousePluginGUI::cb_Port0_i (Fl_LED_Button* o, void* v) { + m_GUICH->Set("Port", '0'); + m_GUICH->SetCommand (MousePlugin::SETPORT); +} + +void MousePluginGUI::cb_Port0 (Fl_LED_Button* o, void* v) { + ((MousePluginGUI*)(o->parent ()))->cb_Port0_i (o, v); +} + +inline void MousePluginGUI::cb_Port1_i (Fl_LED_Button* o, void* v) { + m_GUICH->Set("Port", '1'); + m_GUICH->SetCommand (MousePlugin::SETPORT); +} + +void MousePluginGUI::cb_Port1 (Fl_LED_Button* o, void* v) { + ((MousePluginGUI*)(o->parent ()))->cb_Port1_i (o, v); +} + +const string MousePluginGUI::GetHelpText (const string &loc) { + return string("") + + "\n" + + "\n"; +} diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MousePlugin/MousePluginGUI.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MousePlugin/MousePluginGUI.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MousePlugin/MousePluginGUI.h 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MousePlugin/MousePluginGUI.h 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,51 @@ +/* MousePlugin + * Copyleft (C) 2002 Dan Bethell + * Dave Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef MouseGUI_H +#define MouseGUI_H + +#include +#include "MousePlugin.h" +#include "../SpiralPluginGUI.h" +#include "../Widgets/Fl_LED_Button.H" + +class ScratchWidget : public Fl_Widget { + public: + ScratchWidget (int x, int y, int w, int h, const char *l); + void draw(); + float m_Data; +}; + +class MousePluginGUI : public SpiralPluginGUI { + public: + MousePluginGUI (int w, int h, MousePlugin *o, ChannelHandler *ch, const HostInfo *Info); + virtual void UpdateValues (SpiralPlugin *o); + virtual void Update (); + protected: + const string GetHelpText (const string &loc); + private: + ScratchWidget *m_Scope; + Fl_LED_Button *m_Port0, *m_Port1; + inline void cb_Port0_i (Fl_LED_Button *o, void *v); + static void cb_Port0 (Fl_LED_Button *o, void *v); + inline void cb_Port1_i (Fl_LED_Button *o, void *v); + static void cb_Port1 (Fl_LED_Button *o, void *v); +}; + +#endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MousePlugin/MousePlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MousePlugin/MousePlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MousePlugin/MousePlugin.h 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MousePlugin/MousePlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,70 @@ +/* MousePlugin + * Copyleft (C) 2002 Dan Bethell + * Dave Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef MousePlugin_H +#define MousePlugin_H + +#include "../SpiralPlugin.h" +#include "scratch.h" + +class MousePluginSingleton { + public: + static MousePluginSingleton *Get() { + if (!m_Singleton) m_Singleton = new MousePluginSingleton; + return m_Singleton; + } + static void PackUpAndGoHome() { + if (m_Singleton) { + delete m_Singleton; + m_Singleton=NULL; + } + } + ~MousePluginSingleton(); + scratch *getScr() { return scr; } + private: + MousePluginSingleton(); + scratch *scr; + static MousePluginSingleton* m_Singleton; + int count; +}; + +class MousePlugin : public SpiralPlugin { + public: + MousePlugin(); + virtual ~MousePlugin(); + virtual PluginInfo& Initialise (const HostInfo *Host); + virtual SpiralGUIType* CreateGUI(); + char GetPort (void) { return m_Port; } + virtual void Execute(); + virtual void ExecuteCommands(); + virtual void StreamOut (ostream &s); + virtual void StreamIn (istream &s); + enum GUICommands {NONE, SETPORT}; + private: + static int m_RefCount; + char m_Port; + float m_Data; + friend istream &operator>> (istream &s, MousePlugin &o); + friend ostream &operator<< (ostream &s, MousePlugin &o); +}; + +istream &operator>> (istream &s, MousePlugin &o); +ostream &operator<< (ostream &s, MousePlugin &o); + +#endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MousePlugin/scratch.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MousePlugin/scratch.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MousePlugin/scratch.C 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MousePlugin/scratch.C 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,133 @@ +/* MousePlugin + * Copyleft (C) 2002 Dan Bethell + * Dave Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include "scratch.h" + +#define BAUDRATE B1200 +#define _POSIX_SOURCE 1 /* POSIX compliant source */ +#define FALSE 0 +#define TRUE 1 + +int c, res; +int count, total; +volatile int STOP=FALSE; +int fd; // the serial port device +struct termios oldtio,newtio; +unsigned char buf[3]; +char *MODEMDEVICE; + +scratch::scratch(char *dev) +{ + openSerialPort(dev); + pthread_mutex_init( &mutex, NULL); + pthread_create( &scratch_thread, NULL, (void *(*)(void *))listen, this); +} + +scratch::~scratch() +{ + closeSerialPort(); +} + +void scratch::setData(char c) +{ + pthread_mutex_lock( &mutex ); + data = c; + pthread_mutex_unlock( &mutex ); +} + +char scratch::getData() +{ + char result; + pthread_mutex_lock( &mutex ); + result = data; + pthread_mutex_unlock( &mutex ); + + return result; +} + +void scratch::stop() +{ + pthread_mutex_lock( &mutex ); + STOP=TRUE; + pthread_mutex_unlock( &mutex ); +} + +void openSerialPort(char *dev) +{ + char *MODEMDEVICE = dev; + + fd = open(MODEMDEVICE, O_RDWR | O_NOCTTY ); + if (fd <0) + { + perror(MODEMDEVICE); exit(-1); + } + + tcgetattr(fd,&oldtio); /* save current port settings */ + + bzero(&newtio, sizeof(newtio)); + newtio.c_cflag = BAUDRATE | CS7 | CLOCAL | CREAD; + newtio.c_iflag = IGNPAR; + newtio.c_oflag = 0; + + /* set input mode (non-canonical, no echo,...) */ + newtio.c_lflag = 0; + + newtio.c_cc[VTIME] = 0; /* inter-character timer unused */ + newtio.c_cc[VMIN] = 3; /* blocking read until 5 chars received */ + + tcflush(fd, TCIFLUSH); + tcsetattr(fd,TCSANOW,&newtio); +} + +void closeSerialPort() +{ + tcsetattr(fd,TCSANOW,&oldtio); // reset serial port settings + close(fd); // close pipe to serial port +} + +void listen(scratch *scr) +{ + while (STOP==FALSE) + { /* loop for input */ + res = read(fd,buf,3); /* returns after 3 chars have been input */ + if (buf[0]>>6&1) + { + char c; + + c = ((buf[0]&12)<<4)|(buf[2]&63); + if (c!=0x0) { + scr->setData(c); + // some random logging stuff + /* + total += (int)c; + count ++; + + if (count%20==0) { + FILE *ptr = fopen("/tmp/EYEMUSH.log", "a+"); + fprintf(ptr, "EYEMUSH LOG:\tScratch\n"); + fclose(ptr); + } + */ + } + } + else + { + read(fd,buf,1); + } + } +} diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MousePlugin/scratch.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MousePlugin/scratch.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MousePlugin/scratch.h 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MousePlugin/scratch.h 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,51 @@ +/* MousePlugin + * Copyleft (C) 2002 Dan Bethell + * Dave Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#ifndef SCRATCH_H +#define SCRATCH_H + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +class scratch { + public: + scratch (char *dev); + ~scratch(); + void setData(char c); + char getData(); + void stop(); + private: + pthread_t scratch_thread; + pthread_mutex_t mutex; + char data; +}; + +void openSerialPort (char *dev); +void closeSerialPort(); +void listen (scratch *scr); + +#endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MousePlugin/SpiralIcon.xpm spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MousePlugin/SpiralIcon.xpm --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/MousePlugin/SpiralIcon.xpm 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/MousePlugin/SpiralIcon.xpm 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,43 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"36 36 4 1", +" c None", +". c #000000", +"+ c #6E6E6E", +"@ c #FFFFFF", +" ", +" ", +" ", +" ............................. ", +" ............................. ", +" ............................. ", +" ...+++++++++++++++++++++++... ", +" ...+++++++++++++++++++++++... ", +" ...+++++++++++++++++++++++... ", +" ...+++++++++++++++++++++++... ", +" ...+++++++++++++++++++++++... ", +" ...++++++@@@@@@@@@@@@@@+++... ", +" ...++++++@@@@@@@++++++++++... ", +" ...++++++@@@@@@@++++++++++... ", +" ...++++++++@++++++++++++++... ", +" ...++...................++... ", +" ...+++++++++++++++++++++++... ", +" ...+++++++++++++++++++++++... ", +" ...+++++++++++++++++++++++... ", +" ...+++++++++++++++++++++++... ", +" ............................. ", +" ............................. ", +" ............................. ", +" ........ ", +" ........ ", +" ........ ", +" ........ ", +" ........ ", +" ............................. ", +" ............................. ", +" ............................. ", +" ............................. ", +" ............................. ", +" ............................. ", +" ", +" "}; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/NoisePlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/NoisePlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/NoisePlugin/Makefile.in 2004-01-17 10:32:43.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/NoisePlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -15,9 +15,6 @@ MOC = moc UIC = -TAR = tar -cf -GZIP = gzip -9f - INSTALL = @INSTALL@ ###### Autoconf variables @@ -99,13 +96,6 @@ moc: $(SRCMOC) -tmake: - tmake NoisePlugin.pro - -dist: - $(TAR) NoisePlugin.tar NoisePlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) NoisePlugin.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/NoisePlugin/NoisePlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/NoisePlugin/NoisePlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/NoisePlugin/NoisePlugin.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/NoisePlugin/NoisePlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -20,8 +20,7 @@ #include #include #include "SpiralIcon.xpm" - -#include +#include using namespace std; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/NoisePlugin/NoisePluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/NoisePlugin/NoisePluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/NoisePlugin/NoisePluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/NoisePlugin/NoisePluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -18,6 +18,7 @@ #include "NoisePluginGUI.h" #include +#include using namespace std; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/NoteSnapPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/NoteSnapPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/NoteSnapPlugin/Makefile.in 2004-01-17 10:32:43.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/NoteSnapPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -13,10 +13,7 @@ LFLAGS = LIBS = @FLTK_LIBS@ MOC = moc -UIC = - -TAR = tar -cf -GZIP = gzip -9f +UIC = INSTALL = @INSTALL@ @@ -96,15 +93,6 @@ moc: $(SRCMOC) -tmake: Makefile - -Makefile: NoteSnapPlugin.pro - tmake NoteSnapPlugin.pro -o Makefile - -dist: - $(TAR) NoteSnapPlugin.tar NoteSnapPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) NoteSnapPlugin.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/NoteSnapPlugin/NoteSnapPlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/NoteSnapPlugin/NoteSnapPlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/NoteSnapPlugin/NoteSnapPlugin.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/NoteSnapPlugin/NoteSnapPlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -83,6 +83,12 @@ this,m_AudioCH,m_HostInfo); } +void NoteSnapPlugin::Reset() +{ + ResetPorts(); + m_Out = 0; +} + void NoteSnapPlugin::Execute() { float Freq=0; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/NoteSnapPlugin/NoteSnapPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/NoteSnapPlugin/NoteSnapPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/NoteSnapPlugin/NoteSnapPluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/NoteSnapPlugin/NoteSnapPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -18,6 +18,7 @@ #include "NoteSnapPluginGUI.h" #include +#include using namespace std; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/NoteSnapPlugin/NoteSnapPlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/NoteSnapPlugin/NoteSnapPlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/NoteSnapPlugin/NoteSnapPlugin.h 2003-08-08 17:55:51.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/NoteSnapPlugin/NoteSnapPlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -31,6 +31,7 @@ virtual PluginInfo& Initialise(const HostInfo *Host); virtual SpiralGUIType* CreateGUI(); virtual void Execute(); + virtual void Reset(); virtual void ExecuteCommands(); virtual void StreamOut(std::ostream &s); virtual void StreamIn(std::istream &s); diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/NoteSnapPlugin/NoteSnapPlugin.pro spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/NoteSnapPlugin/NoteSnapPlugin.pro --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/NoteSnapPlugin/NoteSnapPlugin.pro 2002-07-28 23:18:17.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/NoteSnapPlugin/NoteSnapPlugin.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -HEADERS = ../SpiralPlugin.h \ - ../SpiralPluginGUI.h \ - ../Widgets/Fl_Knob.H \ - ../Widgets/Fl_DragBar.H \ - ../../Sample.h \ - NoteSnapPlugin.h \ - NoteSnapPluginGUI.h - -SOURCES = ../SpiralPlugin.C \ - ../SpiralPluginGUI.C \ - ../Widgets/Fl_Knob.cxx \ - ../Widgets/Fl_DragBar.cxx \ - ../../Sample.C \ - NoteSnapPlugin.C \ - NoteSnapPluginGUI.C - -TARGET = NoteSnapPlugin.so diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/OperatorPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/OperatorPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/OperatorPlugin/Makefile.in 2004-01-17 10:32:43.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/OperatorPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -13,10 +13,7 @@ LFLAGS = LIBS = @FLTK_LIBS@ MOC = moc -UIC = - -TAR = tar -cf -GZIP = gzip -9f +UIC = INSTALL = @INSTALL@ diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/OperatorPlugin/OperatorPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/OperatorPlugin/OperatorPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/OperatorPlugin/OperatorPluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/OperatorPlugin/OperatorPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -18,6 +18,7 @@ #include "OperatorPluginGUI.h" #include +#include //#include using namespace std; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/OscillatorPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/OscillatorPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/OscillatorPlugin/Makefile.in 2004-01-17 10:32:43.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/OscillatorPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -15,9 +15,6 @@ MOC = moc UIC = -TAR = tar -cf -GZIP = gzip -9f - INSTALL = @INSTALL@ ###### Autoconf variables @@ -105,13 +102,6 @@ moc: $(SRCMOC) -tmake: - tmake OscillatorPlugin.pro - -dist: - $(TAR) OscillatorPlugin.tar OscillatorPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) OscillatorPlugin.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/OscillatorPlugin/OscillatorPlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/OscillatorPlugin/OscillatorPlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/OscillatorPlugin/OscillatorPlugin.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/OscillatorPlugin/OscillatorPlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -18,9 +18,9 @@ #include "OscillatorPlugin.h" #include "OscillatorPluginGUI.h" #include -#include #include #include "SpiralIcon.xpm" +#include using namespace std; @@ -105,6 +105,15 @@ this,m_AudioCH,m_HostInfo); } +void OscillatorPlugin::Reset() +{ + ResetPorts(); + + m_CyclePos=0; + m_Note=0; + m_LastFreq=0; +} + void OscillatorPlugin::Execute() { short noisev=0; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/OscillatorPlugin/OscillatorPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/OscillatorPlugin/OscillatorPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/OscillatorPlugin/OscillatorPluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/OscillatorPlugin/OscillatorPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -18,6 +18,7 @@ #include "OscillatorPluginGUI.h" #include +#include #include "../GUI/WS_Square.h" #include "../GUI/WS_Noise.h" #include "../GUI/WS_Saw.h" diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/OscillatorPlugin/OscillatorPlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/OscillatorPlugin/OscillatorPlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/OscillatorPlugin/OscillatorPlugin.h 2003-08-08 17:55:51.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/OscillatorPlugin/OscillatorPlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -31,6 +31,8 @@ virtual PluginInfo &Initialise(const HostInfo *Host); virtual SpiralGUIType *CreateGUI(); virtual void Execute(); + virtual void Reset(); + virtual void StreamOut(std::ostream &s); virtual void StreamIn(std::istream &s); diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/OscillatorPlugin/OscillatorPlugin.pro spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/OscillatorPlugin/OscillatorPlugin.pro --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/OscillatorPlugin/OscillatorPlugin.pro 2002-07-28 23:18:15.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/OscillatorPlugin/OscillatorPlugin.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -HEADERS = ../SpiralPlugin.h \ - ../SpiralPluginGUI.h \ - ../Widgets/Fl_Knob.H \ - ../Widgets/Fl_DragBar.H \ - ../../Sample.h \ - OscillatorPlugin.h \ - OscillatorPluginGUI.h - -SOURCES = ../SpiralPlugin.C \ - ../SpiralPluginGUI.C \ - ../Widgets/Fl_Knob.cxx \ - ../Widgets/Fl_DragBar.cxx \ - ../../Sample.C \ - OscillatorPlugin.C \ - OscillatorPluginGUI.C - -TARGET = OscillatorPlugin.so diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/OutputPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/OutputPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/OutputPlugin/Makefile.in 2004-01-17 10:32:43.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/OutputPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -13,10 +13,7 @@ LFLAGS = LIBS = @FLTK_LIBS@ MOC = moc -UIC = - -TAR = tar -cf -GZIP = gzip -9f +UIC = INSTALL = @INSTALL@ @@ -102,13 +99,6 @@ moc: $(SRCMOC) -tmake: - tmake OutputPlugin.pro - -dist: - $(TAR) OutputPlugin.tar OutputPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) OutputPlugin.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/OutputPlugin/OutputPlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/OutputPlugin/OutputPlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/OutputPlugin/OutputPlugin.C 2004-02-08 18:36:17.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/OutputPlugin/OutputPlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -41,7 +41,7 @@ #include "OutputPlugin.h" #include "OutputPluginGUI.h" -#include +#include #include "SpiralIcon.xpm" using namespace std; @@ -53,7 +53,7 @@ static const int OUT_MAIN = 0; static const HostInfo* host; -OSSOutput* OSSOutput::m_Singleton = NULL; +OSSClient* OSSClient::m_Singleton = NULL; int OutputPlugin::m_RefCount=0; int OutputPlugin::m_NoExecuted=0; OutputPlugin::Mode OutputPlugin::m_Mode=NO_MODE; @@ -117,7 +117,7 @@ if (m_RefCount==0) { cb_Blocking(m_Parent,false); - OSSOutput::PackUpAndGoHome(); + OSSClient::PackUpAndGoHome(); m_Mode=NO_MODE; } } @@ -126,7 +126,7 @@ { PluginInfo& Info= SpiralPlugin::Initialise(Host); host=Host; - OSSOutput::Get()->AllocateBuffer(); + OSSClient::Get()->AllocateBuffer(); return Info; } @@ -140,12 +140,42 @@ bool OutputPlugin::Kill() { m_IsDead=true; - OSSOutput::Get()->Kill(); + OSSClient::Get()->Kill(); m_Mode=CLOSED; cb_Blocking(m_Parent,false); return true; } +void OutputPlugin::Reset() +{ + if (m_IsDead) return; + m_IsDead=true; + OSSClient::Get()->Kill(); + cb_Blocking(m_Parent,false); + ResetPorts(); + OSSClient::Get()->AllocateBuffer(); + + switch (m_Mode) + { + case INPUT : + OSSClient::Get()->OpenRead(); + cb_Blocking(m_Parent,true); + break; + case OUTPUT : + OSSClient::Get()->OpenWrite(); + cb_Blocking(m_Parent,true); + break; + case DUPLEX : + OSSClient::Get()->OpenReadWrite(); + cb_Blocking(m_Parent,true); + break; + + default:{} + } + + m_IsDead=false; +} + void OutputPlugin::Execute() { if (m_IsDead) @@ -153,7 +183,7 @@ if (m_Mode==NO_MODE && m_RefCount==1) { - if (OSSOutput::Get()->OpenWrite()) + if (OSSClient::Get()->OpenWrite()) { cb_Blocking(m_Parent,true); m_Mode=OUTPUT; @@ -163,11 +193,11 @@ if (m_Mode==OUTPUT || m_Mode==DUPLEX) { - OSSOutput::Get()->SendStereo(GetInput(0),GetInput(1)); + OSSClient::Get()->SendStereo(GetInput(0),GetInput(1)); } if (m_Mode==INPUT || m_Mode==DUPLEX) - OSSOutput::Get()->GetStereo(GetOutputBuf(0),GetOutputBuf(1)); + OSSClient::Get()->GetStereo(GetOutputBuf(0),GetOutputBuf(1)); } void OutputPlugin::ExecuteCommands() @@ -175,36 +205,26 @@ if (m_IsDead) return; - // Only Play() once per set of plugins - m_NoExecuted--; - if (m_NoExecuted<=0) - { - if (m_Mode==INPUT || m_Mode==DUPLEX) OSSOutput::Get()->Read(); - if (m_Mode==OUTPUT || m_Mode==DUPLEX) OSSOutput::Get()->Play(); - m_NoExecuted=m_RefCount; - } - - if (m_AudioCH->IsCommandWaiting()) { switch(m_AudioCH->GetCommand()) { case OPENREAD : - if (OSSOutput::Get()->OpenRead()) + if (OSSClient::Get()->OpenRead()) { m_Mode=INPUT; //cb_Blocking(m_Parent,true); } break; case OPENWRITE : - if (OSSOutput::Get()->OpenWrite()) + if (OSSClient::Get()->OpenWrite()) { m_Mode=OUTPUT; cb_Blocking(m_Parent,true); } break; case OPENDUPLEX : - if (OSSOutput::Get()->OpenReadWrite()) + if (OSSClient::Get()->OpenReadWrite()) { m_Mode=DUPLEX; cb_Blocking(m_Parent,true); @@ -213,10 +233,10 @@ case CLOSE : m_Mode=CLOSED; cb_Blocking(m_Parent,false); - OSSOutput::Get()->Close(); + OSSClient::Get()->Close(); break; case SET_VOLUME : - OSSOutput::Get()->SetVolume(m_Volume); + OSSClient::Get()->SetVolume(m_Volume); break; case CLEAR_NOTIFY: m_NotifyOpenOut=false; @@ -226,10 +246,25 @@ } } +void OutputPlugin::ProcessAudio() +{ + if (m_IsDead) + return; + + // Only Play() once per set of plugins + m_NoExecuted--; + if (m_NoExecuted<=0) + { + if (m_Mode==INPUT || m_Mode==DUPLEX) OSSClient::Get()->Read(); + if (m_Mode==OUTPUT || m_Mode==DUPLEX) OSSClient::Get()->Play(); + m_NoExecuted=m_RefCount; + } +} + ////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////// -OSSOutput::OSSOutput() : +OSSClient::OSSClient() : m_Amp(0.5), m_Channels(2), m_ReadBufferNum(0), @@ -246,7 +281,7 @@ ////////////////////////////////////////////////////////////////////// -OSSOutput::~OSSOutput() +OSSClient::~OSSClient() { Close(); DeallocateBuffer(); @@ -254,7 +289,7 @@ ////////////////////////////////////////////////////////////////////// -void OSSOutput::AllocateBuffer() +void OSSClient::AllocateBuffer() { if (m_Buffer[0]==NULL) { @@ -266,11 +301,9 @@ m_InBuffer[0] = (short*) calloc(m_BufSizeBytes/2,m_BufSizeBytes); m_InBuffer[1] = (short*) calloc(m_BufSizeBytes/2,m_BufSizeBytes); } - - m_Wav.SetSamplerate(host->SAMPLERATE); } -void OSSOutput::DeallocateBuffer() +void OSSClient::DeallocateBuffer() { if (m_Buffer[0]!=NULL) { @@ -286,7 +319,7 @@ ////////////////////////////////////////////////////////////////////// -void OSSOutput::SendStereo(const Sample *ldata,const Sample *rdata) +void OSSClient::SendStereo(const Sample *ldata,const Sample *rdata) { if (m_Channels!=2) return; @@ -319,7 +352,7 @@ ////////////////////////////////////////////////////////////////////// -void OSSOutput::Play() +void OSSClient::Play() { int BufferToSend=!m_WriteBufferNum; @@ -335,18 +368,13 @@ write(m_Dspfd,m_Buffer[BufferToSend],m_BufSizeBytes); } - if(m_Wav.Recording()) - { - m_Wav.Save(m_Buffer[BufferToSend],m_BufSizeBytes); - } - memset(m_Buffer[BufferToSend],0,m_BufSizeBytes); m_WriteBufferNum=BufferToSend; } ////////////////////////////////////////////////////////////////////// -void OSSOutput::GetStereo(Sample *ldata,Sample *rdata) +void OSSClient::GetStereo(Sample *ldata,Sample *rdata) { if (m_Channels!=2) return; @@ -365,7 +393,7 @@ ////////////////////////////////////////////////////////////////////// -void OSSOutput::Read() +void OSSClient::Read() { int BufferToRead=!m_ReadBufferNum; @@ -385,7 +413,7 @@ ////////////////////////////////////////////////////////////////////// -bool OSSOutput::Close() +bool OSSClient::Close() { cerr<<"Closing dsp output"< -#include +#include using namespace std; @@ -73,7 +73,7 @@ void OutputPluginGUI::UpdateValues(SpiralPlugin *o) { - Volume->value(OSSOutput::Get()->GetVolume()); + Volume->value(OSSClient::Get()->GetVolume()); } //// Callbacks //// diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/OutputPlugin/OutputPlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/OutputPlugin/OutputPlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/OutputPlugin/OutputPlugin.h 2004-02-08 18:36:17.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/OutputPlugin/OutputPlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -23,12 +23,12 @@ #ifndef OutputPLUGIN #define OutputPLUGIN -class OSSOutput +class OSSClient { public: - static OSSOutput *Get() { if(!m_Singleton) m_Singleton=new OSSOutput; return m_Singleton; } + static OSSClient *Get() { if(!m_Singleton) m_Singleton=new OSSClient; return m_Singleton; } static void PackUpAndGoHome() { if(m_Singleton) { delete m_Singleton; m_Singleton=NULL; } } - ~OSSOutput(); + ~OSSClient(); void AllocateBuffer(); void DeallocateBuffer(); @@ -39,8 +39,7 @@ float GetVolume() {return m_Amp;} void Play(); void Read(); - void WavOpen(char* name) {m_Wav.Open(name,WavFile::WRITE, WavFile::STEREO);} - void WavClose() {m_Wav.Close();} + short *GetBuffer() {return m_Buffer[m_WriteBufferNum];} bool OpenReadWrite(); @@ -49,9 +48,9 @@ bool Close(); void Kill() { m_IsDead = true; m_OutputOk=false; PackUpAndGoHome(); } private: - static OSSOutput* m_Singleton; + static OSSClient* m_Singleton; - OSSOutput(); + OSSClient(); short *m_Buffer[2]; short *m_InBuffer[2]; @@ -59,7 +58,7 @@ int m_Dspfd; float m_Amp; int m_Channels; - WavFile m_Wav; + int m_ReadBufferNum; int m_WriteBufferNum; bool m_OutputOk; @@ -67,7 +66,7 @@ }; -class OutputPlugin : public SpiralPlugin +class OutputPlugin : public AudioDriver { public: enum Mode {NO_MODE,INPUT,OUTPUT,DUPLEX,CLOSED}; @@ -77,24 +76,34 @@ virtual PluginInfo& Initialise(const HostInfo *Host); virtual SpiralGUIType* CreateGUI(); - virtual void Execute(); - virtual bool Kill(); - virtual void ExecuteCommands(); - virtual void StreamOut(std::ostream &s) {} - virtual void StreamIn(std::istream &s) {} + /* General Plugin Function */ + virtual void Execute(); + virtual void ExecuteCommands(); + + virtual bool Kill(); + virtual void Reset(); + + /* Audio Driver Specific Functions */ + virtual bool IsAudioDriver() { return true; } + virtual AudioProcessType ProcessType() { return AudioDriver::ALWAYS; } + virtual void ProcessAudio(); + + /* OSS Plugin Specific Functions */ enum GUICommands {NONE, OPENREAD, OPENWRITE, OPENDUPLEX, CLOSE, SET_VOLUME, CLEAR_NOTIFY}; float m_Volume; Mode GetMode() { return m_Mode; } + /* OSS Plugin Streaming - soon to be obsolete and for backward compatibility only*/ + virtual void StreamOut(std::ostream &s) {} + virtual void StreamIn(std::istream &s) {} private: static int m_RefCount; static int m_NoExecuted; static Mode m_Mode; bool m_NotifyOpenOut; bool m_CheckedAlready; - bool m_Recmode; }; #endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/OutputPlugin/OutputPlugin.pro spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/OutputPlugin/OutputPlugin.pro --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/OutputPlugin/OutputPlugin.pro 2002-07-28 23:18:15.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/OutputPlugin/OutputPlugin.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -HEADERS = ../SpiralPlugin.h \ - ../SpiralPluginGUI.h \ - ../Widgets/Fl_Knob.H \ - ../Widgets/Fl_DragBar.H \ - ../../Sample.h \ - ../../RiffWav.h \ - OutputPlugin.h \ - OutputPluginGUI.h - -SOURCES = ../SpiralPlugin.C \ - ../SpiralPluginGUI.C \ - ../Widgets/Fl_Knob.cxx \ - ../Widgets/Fl_DragBar.cxx \ - ../../Sample.C \ - ../../RiffWav.C \ - OutputPlugin.C \ - OutputPluginGUI.C - -TARGET = OutputPlugin.so diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/PoshSamplerPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/PoshSamplerPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/PoshSamplerPlugin/Makefile.in 2004-01-17 10:32:43.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/PoshSamplerPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -15,9 +15,6 @@ MOC = moc UIC = -TAR = tar -cf -GZIP = gzip -9f - INSTALL = @INSTALL@ ###### Autoconf variables @@ -45,6 +42,7 @@ ../../ChannelHandler.h \ ../../Sample.h \ ../../RiffWav.h \ + ../GUI/WaveChooser.h \ ../Widgets/Fl_Knob.H \ ../../../GUI/Widgets/SpiralGUI.H SOURCES = PoshSamplerPlugin.C \ @@ -54,6 +52,7 @@ ../../ChannelHandler.C \ ../../Sample.C \ ../../RiffWav.C \ + ../GUI/WaveChooser.C \ ../Widgets/Fl_Knob.cxx \ ../../../GUI/Widgets/SpiralGUI.C OBJECTS = PoshSamplerPlugin.o \ @@ -63,6 +62,7 @@ ../../ChannelHandler.o \ ../../Sample.o \ ../../RiffWav.o \ + ../GUI/WaveChooser.o \ ../Widgets/Fl_Knob.o \ ../../../GUI/Widgets/SpiralGUI.o INTERFACES = @@ -102,13 +102,6 @@ moc: $(SRCMOC) -tmake: - tmake PoshSamplerPlugin.pro - -dist: - $(TAR) PoshSamplerPlugin.tar PoshSamplerPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) PoshSamplerPlugin.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core @@ -148,6 +141,9 @@ ../../RiffWav.h \ ../../Sample.h +../GUI/WaveChooser.o: ../GUI/WaveChooser.C \ + ../GUI/WaveChooser.h + PoshSamplerPlugin.o: PoshSamplerPlugin.C \ PoshSamplerPlugin.h \ PoshSamplerPluginGUI.h \ diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPlugin.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -20,396 +20,376 @@ #include #include "SpiralIcon.xpm" #include "../../NoteTable.h" -#include - #include "../../RiffWav.h" +#include using namespace std; -static const int NOTETRIG = NUM_SAMPLES*2+1; -static const int REC_INPUT = 16; - -static const int S1_INPUT = 18; -static const int S2_INPUT = 19; -static const int S3_INPUT = 20; +static const int NOTETRIG = NUM_SAMPLES * 2 + 1; +static const int REC_INPUT = 16; +static const int S1_INPUT = 18; +static const int S2_INPUT = 19; +static const int S3_INPUT = 20; extern "C" { -SpiralPlugin* SpiralPlugin_CreateInstance() -{ - return new PoshSamplerPlugin; -} - -char** SpiralPlugin_GetIcon() -{ - return SpiralIcon_xpm; -} - -int SpiralPlugin_GetID() -{ - return 32; -} - -string SpiralPlugin_GetGroupName() -{ - return "Delay/Sampling"; -} + SpiralPlugin* SpiralPlugin_CreateInstance() { return new PoshSamplerPlugin; } + char** SpiralPlugin_GetIcon() { return SpiralIcon_xpm; } + int SpiralPlugin_GetID() { return 32; } + string SpiralPlugin_GetGroupName() { return "Delay/Sampling"; } } /////////////////////////////////////////////////////// -static void -InitializeSampleDescription(SampleDesc* NewDesc, const string &Pathname, int Note) -{ - if (NewDesc) { - NewDesc->Pathname = Pathname; - NewDesc->Volume = 1.0f; - NewDesc->Velocity = 1.0f; - NewDesc->Pitch = 1.0f; - NewDesc->PitchMod = 1.0f; - NewDesc->SamplePos = -1; - NewDesc->Loop = false; - NewDesc->PingPong = false; - NewDesc->Note = Note; - NewDesc->Octave = 0; - NewDesc->TriggerUp = true; - NewDesc->SamplePos = -1; - NewDesc->SampleRate = 44100; - NewDesc->Stereo = false; - NewDesc->PlayStart = 0; - NewDesc->LoopStart = 0; - NewDesc->LoopEnd = INT_MAX; - } -} - PoshSamplerPlugin::PoshSamplerPlugin() : m_Recording(false) { - m_PluginInfo.Name="PoshSampler"; - m_PluginInfo.Width=400; - m_PluginInfo.Height=215; - m_PluginInfo.NumInputs=21; - m_PluginInfo.NumOutputs=9; - m_PluginInfo.PortTips.push_back("Sample 1 Pitch"); - m_PluginInfo.PortTips.push_back("Sample 1 Trigger"); - m_PluginInfo.PortTips.push_back("Sample 2 Pitch"); - m_PluginInfo.PortTips.push_back("Sample 2 Trigger"); - m_PluginInfo.PortTips.push_back("Sample 3 Pitch"); - m_PluginInfo.PortTips.push_back("Sample 3 Trigger"); - m_PluginInfo.PortTips.push_back("Sample 4 Pitch"); - m_PluginInfo.PortTips.push_back("Sample 4 Trigger"); - m_PluginInfo.PortTips.push_back("Sample 5 Pitch"); - m_PluginInfo.PortTips.push_back("Sample 5 Trigger"); - m_PluginInfo.PortTips.push_back("Sample 6 Pitch"); - m_PluginInfo.PortTips.push_back("Sample 6 Trigger"); - m_PluginInfo.PortTips.push_back("Sample 7 Pitch"); - m_PluginInfo.PortTips.push_back("Sample 7 Trigger"); - m_PluginInfo.PortTips.push_back("Sample 8 Pitch"); - m_PluginInfo.PortTips.push_back("Sample 8 Trigger"); - m_PluginInfo.PortTips.push_back("Input"); - m_PluginInfo.PortTips.push_back("Sample trigger pitch"); - m_PluginInfo.PortTips.push_back("Sample 1 Start Pos"); - m_PluginInfo.PortTips.push_back("Sample 2 Start Pos"); - m_PluginInfo.PortTips.push_back("Sample 3 Start Pos"); - m_PluginInfo.PortTips.push_back("Mixed Output"); - m_PluginInfo.PortTips.push_back("Sample 1 Output"); - m_PluginInfo.PortTips.push_back("Sample 2 Output"); - m_PluginInfo.PortTips.push_back("Sample 3 Output"); - m_PluginInfo.PortTips.push_back("Sample 4 Output"); - m_PluginInfo.PortTips.push_back("Sample 5 Output"); - m_PluginInfo.PortTips.push_back("Sample 6 Output"); - m_PluginInfo.PortTips.push_back("Sample 7 Output"); - m_PluginInfo.PortTips.push_back("Sample 8 Output"); - - for (int n=0; nRegister("Num",&m_GUIArgs.Num); - m_AudioCH->Register("Value",&m_GUIArgs.Value); - m_AudioCH->Register("Bool",&m_GUIArgs.Boole); - m_AudioCH->Register("Int",&m_GUIArgs.Int); - m_AudioCH->Register("Start",&m_GUIArgs.Start); - m_AudioCH->Register("End",&m_GUIArgs.End); - m_AudioCH->Register("LoopStart",&m_GUIArgs.LoopStart); - m_AudioCH->RegisterData("Name",ChannelHandler::INPUT,&m_GUIArgs.Name,sizeof(m_GUIArgs.Name)); - m_AudioCH->Register("PlayPos",&m_CurrentPlayPos,ChannelHandler::OUTPUT); - m_AudioCH->RegisterData("SampleBuffer",ChannelHandler::OUTPUT_REQUEST,&m_SampleBuffer,TRANSBUF_SIZE); - m_AudioCH->Register("SampleSize",&m_SampleSize,ChannelHandler::OUTPUT_REQUEST); - -} - -PoshSamplerPlugin::~PoshSamplerPlugin() -{ - for (vector::iterator i=m_SampleVec.begin(); - i!=m_SampleVec.end(); i++) - { - delete(*i); - } - - for (vector::iterator i=m_SampleDescVec.begin(); - i!=m_SampleDescVec.end(); i++) - { - delete(*i); - } -} - -PluginInfo &PoshSamplerPlugin::Initialise(const HostInfo *Host) -{ - return SpiralPlugin::Initialise(Host);; -} - -SpiralGUIType *PoshSamplerPlugin::CreateGUI() -{ - return new PoshSamplerPluginGUI(m_PluginInfo.Width, - m_PluginInfo.Height, - this,m_AudioCH,m_HostInfo); -} - -void PoshSamplerPlugin::Execute() -{ - static bool Pong=false; - - for (int s=0; sZero(); - } - - float Freq=0; - - for (int n=0; nBUFSIZE; n++) - { - Freq=GetInputPitch(NOTETRIG,n); - - for (int s=0; sGetLength()) - { - // Convert the CV input into a useable trigger - - if (GetInput(s*2+1,n)>0 || feq(Freq,NoteTable[S->Note],0.01f)) - { - if (S->TriggerUp) - { - if (s==0 && InputExists(S1_INPUT)) - S->PlayStart=(long int)((GetInput(S1_INPUT,n)*0.5+0.5f)*(S->LoopEnd-S->LoopStart))+S->LoopStart; - if (s==1 && InputExists(S2_INPUT)) - S->PlayStart=(long int)((GetInput(S2_INPUT,n)*0.5+0.5f)*(S->LoopEnd-S->LoopStart))+S->LoopStart; - if (s==2 && InputExists(S3_INPUT)) - S->PlayStart=(long int)((GetInput(S3_INPUT,n)*0.5+0.5f)*(S->LoopEnd-S->LoopStart))+S->LoopStart; - - if (S->PlayStart<0) S->PlayStart=0; - - S->SamplePos=S->PlayStart; - S->TriggerUp=false; - S->Velocity=GetInput(s*2+1,n); - } - } - else - { - S->TriggerUp=true; - - // end it if it's looping - if (S->Loop) - { - S->SamplePos=-1; - } - } - - // if the sample has ended - if (S->SamplePos>=S->LoopEnd || S->SamplePos>=m_SampleVec[s]->GetLength()) - { - if (S->Loop) - { - if (S->PingPong) Pong=true; - else S->SamplePos=S->LoopStart; - } - else - { - S->SamplePos=-1; - } - } - - // if the sample has ended ponging - if (Pong && S->SamplePos<=S->LoopStart) - { - Pong=false; - } - - if (S->SamplePos!=-1) - { - if (InputExists(s*2)) - { - // Get the pitch from the CV - float PlayFreq=GetInputPitch(s*2,n); - - // assumtion: base frequency = 440 (middle A) - S->Pitch = PlayFreq/440; - S->Pitch *= S->SampleRate/(float)m_HostInfo->SAMPLERATE; - } - - // mix the sample to the output. - MixOutput(0,n,(*m_SampleVec[s])[S->SamplePos]*S->Volume*S->Velocity); - // copy the sample to it's individual output. - SetOutput(s+1,n,((*m_SampleVec[s])[S->SamplePos]*S->Volume)); - - float Freq=S->Pitch; - if (S->Octave>0) Freq*=1<<(S->Octave); - if (S->Octave<0) Freq/=1<<(-S->Octave); - - if (Pong) S->SamplePos-=Freq*S->PitchMod; - else S->SamplePos+=Freq*S->PitchMod; - } - } - } - } - - // record - static int LastRecording=false; - if(m_Recording && InputExists(REC_INPUT)) - { - int s=0;//GUI->GetCurrentSample(); - - if (!LastRecording) m_SampleVec[s]->Clear(); - - // new sample - if (m_SampleVec[s]->GetLength()==0) - { - *m_SampleVec[s]=*GetInput(REC_INPUT); - - m_SampleDescVec[s]->SampleRate=m_HostInfo->SAMPLERATE; - m_SampleDescVec[s]->Stereo=false; - m_SampleDescVec[s]->Pitch *= 1.0f; - m_SampleDescVec[s]->LoopEnd=m_SampleVec[s]->GetLength(); - - } - else - { - m_SampleVec[s]->Add(*GetInput(REC_INPUT)); - m_SampleDescVec[s]->LoopEnd=m_SampleVec[s]->GetLength(); - } - } - LastRecording=m_Recording; - - if (m_SampleDescVec[m_Current]->SamplePos>0) - { - m_CurrentPlayPos=(long)m_SampleDescVec[m_Current]->SamplePos; - } -} - -void PoshSamplerPlugin::ExecuteCommands() -{ - if (m_AudioCH->IsCommandWaiting()) - { - switch(m_AudioCH->GetCommand()) - { - case (LOAD) : LoadSample(m_GUIArgs.Num,m_GUIArgs.Name); break; - case (SAVE) : SaveSample(m_GUIArgs.Num,m_GUIArgs.Name); break; - case (SETVOL) : SetVolume(m_GUIArgs.Num,m_GUIArgs.Value); break; - case (SETPITCH) : SetPitch(m_GUIArgs.Num,m_GUIArgs.Value); break; - case (SETLOOP) : SetLoop(m_GUIArgs.Num,m_GUIArgs.Boole); break; - case (SETPING) : SetPingPong(m_GUIArgs.Num,m_GUIArgs.Boole); break; - case (SETNOTE) : SetNote(m_GUIArgs.Num,m_GUIArgs.Int); break; - case (SETOCT) : SetOctave(m_GUIArgs.Num,m_GUIArgs.Int); break; - case (SETPLAYPOINTS): - { - SetPlayStart(m_GUIArgs.Num,m_GUIArgs.Start); - SetLoopStart(m_GUIArgs.Num,m_GUIArgs.LoopStart); - SetLoopEnd(m_GUIArgs.Num,m_GUIArgs.End); - } break; - case (SETREC) : SetRecord(m_GUIArgs.Boole); break; - case (CUT) : Cut(m_GUIArgs.Num,m_GUIArgs.Start,m_GUIArgs.End); break; - case (COPY) : Copy(m_GUIArgs.Num,m_GUIArgs.Start,m_GUIArgs.End); break; - case (PASTE) : Paste(m_GUIArgs.Num,m_GUIArgs.Start,m_GUIArgs.End); break; - case (MIX) : Mix(m_GUIArgs.Num,m_GUIArgs.Start,m_GUIArgs.End); break; - case (CROP) : Crop(m_GUIArgs.Num,m_GUIArgs.Start,m_GUIArgs.End); break; - case (REV) : Reverse(m_GUIArgs.Num,m_GUIArgs.Start,m_GUIArgs.End); break; - case (AMP) : Amp(m_GUIArgs.Num,m_GUIArgs.Start,m_GUIArgs.End); break; - case (SETCURRENT) : m_Current = m_GUIArgs.Num; break; - case (GETSAMPLE) : - { - m_AudioCH->SetupBulkTransfer((void*)m_SampleVec[m_Current]->GetBuffer()); - m_SampleSize=m_SampleVec[m_Current]->GetLengthInBytes(); - } break; - }; - } -} - -void PoshSamplerPlugin::StreamOut(ostream &s) -{ - s<Volume<<" "<< - m_SampleDescVec[n]->PitchMod<<" "<< - m_SampleDescVec[n]->Loop<<" "<< - m_SampleDescVec[n]->PingPong<<" "<< - m_SampleDescVec[n]->Note<<" "<< - m_SampleDescVec[n]->Octave<<" "<< - m_SampleDescVec[n]->SamplePos<<" "<< - m_SampleDescVec[n]->PlayStart<<" "<< - m_SampleDescVec[n]->LoopStart<<" "<< - m_SampleDescVec[n]->LoopEnd<<" "<< - m_SampleDescVec[n]->Note<<" "; - } -} - -void PoshSamplerPlugin::StreamIn(istream &s) -{ - int version; - s>>version; - - for (int n=0; n>m_SampleDescVec[n]->Volume>> - m_SampleDescVec[n]->PitchMod>> - m_SampleDescVec[n]->Loop>> - m_SampleDescVec[n]->PingPong>> - m_SampleDescVec[n]->Note>> - m_SampleDescVec[n]->Octave>> - m_SampleDescVec[n]->SamplePos>> - m_SampleDescVec[n]->PlayStart>> - m_SampleDescVec[n]->LoopStart>> - m_SampleDescVec[n]->LoopEnd>> - m_SampleDescVec[n]->Note; - - if (version<3) - { - int size; - s>>size; - s.ignore(1); - char Buf[4096]; - s.get(Buf,size+1); - } - } -} - -void PoshSamplerPlugin::LoadSample(int n, const string &Name) -{ - WavFile Wav; - if (Wav.Open(Name,WavFile::READ)) - { - m_SampleVec[n]->Allocate(Wav.GetSize()); - Wav.Load(*m_SampleVec[n]); - InitializeSampleDescription(m_SampleDescVec[n], Name, n); - m_SampleDescVec[n]->SampleRate=Wav.GetSamplerate(); - m_SampleDescVec[n]->Stereo=Wav.IsStereo(); - m_SampleDescVec[n]->Pitch *= m_SampleDescVec[n]->SampleRate/(float)m_HostInfo->SAMPLERATE; - m_SampleDescVec[n]->LoopEnd=m_SampleVec[n]->GetLength()-1; - } + m_PluginInfo.Name = "PoshSampler"; + m_PluginInfo.Width = 400; + m_PluginInfo.Height = 215; + m_PluginInfo.NumInputs = 21; + m_PluginInfo.NumOutputs = 9; + m_PluginInfo.PortTips.push_back ("Sample 1 Pitch"); + m_PluginInfo.PortTips.push_back ("Sample 1 Trigger"); + m_PluginInfo.PortTips.push_back ("Sample 2 Pitch"); + m_PluginInfo.PortTips.push_back ("Sample 2 Trigger"); + m_PluginInfo.PortTips.push_back ("Sample 3 Pitch"); + m_PluginInfo.PortTips.push_back ("Sample 3 Trigger"); + m_PluginInfo.PortTips.push_back ("Sample 4 Pitch"); + m_PluginInfo.PortTips.push_back ("Sample 4 Trigger"); + m_PluginInfo.PortTips.push_back ("Sample 5 Pitch"); + m_PluginInfo.PortTips.push_back ("Sample 5 Trigger"); + m_PluginInfo.PortTips.push_back ("Sample 6 Pitch"); + m_PluginInfo.PortTips.push_back ("Sample 6 Trigger"); + m_PluginInfo.PortTips.push_back ("Sample 7 Pitch"); + m_PluginInfo.PortTips.push_back ("Sample 7 Trigger"); + m_PluginInfo.PortTips.push_back ("Sample 8 Pitch"); + m_PluginInfo.PortTips.push_back ("Sample 8 Trigger"); + m_PluginInfo.PortTips.push_back ("Input"); + m_PluginInfo.PortTips.push_back ("Sample trigger pitch"); + m_PluginInfo.PortTips.push_back ("Sample 1 Start Pos"); + m_PluginInfo.PortTips.push_back ("Sample 2 Start Pos"); + m_PluginInfo.PortTips.push_back ("Sample 3 Start Pos"); + m_PluginInfo.PortTips.push_back ("Mixed Output"); + m_PluginInfo.PortTips.push_back ("Sample 1 Output"); + m_PluginInfo.PortTips.push_back ("Sample 2 Output"); + m_PluginInfo.PortTips.push_back ("Sample 3 Output"); + m_PluginInfo.PortTips.push_back ("Sample 4 Output"); + m_PluginInfo.PortTips.push_back ("Sample 5 Output"); + m_PluginInfo.PortTips.push_back ("Sample 6 Output"); + m_PluginInfo.PortTips.push_back ("Sample 7 Output"); + m_PluginInfo.PortTips.push_back ("Sample 8 Output"); + for (int n=0; nRegister ("Num", &m_GUIArgs.Num); + m_AudioCH->Register ("Value", &m_GUIArgs.Value); + m_AudioCH->Register ("Bool", &m_GUIArgs.Boole); + m_AudioCH->Register ("Int", &m_GUIArgs.Int); + m_AudioCH->Register ("Start", &m_GUIArgs.Start); + m_AudioCH->Register ("End", &m_GUIArgs.End); + m_AudioCH->Register ("LoopStart", &m_GUIArgs.LoopStart); + m_AudioCH->RegisterData ("Name", ChannelHandler::INPUT, &m_GUIArgs.Name, sizeof (m_GUIArgs.Name)); + m_AudioCH->Register ("PlayPos", &m_CurrentPlayPos, ChannelHandler::OUTPUT); + m_AudioCH->RegisterData ("SampleBuffer", ChannelHandler::OUTPUT_REQUEST, &m_SampleBuffer, TRANSBUF_SIZE); + m_AudioCH->Register ("SampleSize", &m_SampleSize, ChannelHandler::OUTPUT_REQUEST); + m_AudioCH->Register ("BoolEcho", &m_GUIArgs.BoolEcho, ChannelHandler::OUTPUT); + m_AudioCH->Register ("ValEcho", &m_GUIArgs.ValEcho, ChannelHandler::OUTPUT); + m_AudioCH->Register ("IntEcho", &m_GUIArgs.IntEcho, ChannelHandler::OUTPUT); +} + +PoshSamplerPlugin::~PoshSamplerPlugin() { + for (vector::iterator i=m_SampleVec.begin(); i!=m_SampleVec.end(); i++) + delete(*i); + for (vector::iterator i=m_SampleDescVec.begin(); i!=m_SampleDescVec.end(); i++) + delete(*i); +} + +PluginInfo &PoshSamplerPlugin::Initialise (const HostInfo *Host) { + return SpiralPlugin::Initialise (Host); +} + +SpiralGUIType *PoshSamplerPlugin::CreateGUI() { + return new PoshSamplerPluginGUI (m_PluginInfo.Width, m_PluginInfo.Height, this, m_AudioCH, m_HostInfo); +} + +void PoshSamplerPlugin::Reset() { + ResetPorts(); + m_Current = 0; + for (int s=0; sPitch = m_InitialPitch[s] * m_SampleDescVec[s]->SampleRate / (float)m_HostInfo->SAMPLERATE; + m_SampleDescVec[s]->LoopEnd = m_SampleVec[s]->GetLength() - 1; + } +} + +void PoshSamplerPlugin::Execute() { + static bool Pong = false; + for (int s=0; sZero(); + float Freq = 0; + for (int n=0; nBUFSIZE; n++) { + Freq = GetInputPitch (NOTETRIG, n); + for (int s=0; sGetLength()) { + // Convert the CV input into a useable trigger + if (S->ReTrig || (S->SamplePos == -1)) { + if (GetInput (s*2 + 1, n) > 0 || feq (Freq, NoteTable[S->Note], 0.01f)) { + if (S->TriggerUp) { + if (s==0 && InputExists (S1_INPUT)) + S->PlayStart = (long int)((GetInput (S1_INPUT, n) * 0.5 + 0.5f) * (S->LoopEnd-S->LoopStart)) + S->LoopStart; + if (s==1 && InputExists (S2_INPUT)) + S->PlayStart = (long int)((GetInput (S2_INPUT, n) * 0.5 + 0.5f) * (S->LoopEnd-S->LoopStart)) + S->LoopStart; + if (s==2 && InputExists (S3_INPUT)) + S->PlayStart = (long int)((GetInput (S3_INPUT, n) * 0.5 + 0.5f) * (S->LoopEnd-S->LoopStart)) + S->LoopStart; + if (S->PlayStart < 0) S->PlayStart = 0; + S->SamplePos = S->PlayStart; + S->TriggerUp = false; + S->Velocity = GetInput (s * 2 + 1, n); + } + } + else { + S->TriggerUp = true; + // end it if it's looping + if (S->Loop) S->SamplePos = -1; + } + } + // if the sample has ended + if (S->SamplePos >= S->LoopEnd || S->SamplePos >= m_SampleVec[s]->GetLength()) { + if (S->Loop) { + if (S->PingPong) Pong = true; + else S->SamplePos = S->LoopStart; + } + else { + S->SamplePos = -1; + } + } + // if the sample has ended ponging + if (Pong && S->SamplePos <= S->LoopStart) + Pong = false; + if (S->SamplePos != -1) { + if (InputExists (s * 2)) { + // Get the pitch from the CV + float PlayFreq = GetInputPitch (s * 2, n); + // assumtion: base frequency = 440 (middle A) + S->Pitch = PlayFreq / 440; + S->Pitch *= S->SampleRate / (float)m_HostInfo->SAMPLERATE; + } + // mix the sample to the output. + MixOutput (0, n, (*m_SampleVec[s])[S->SamplePos] * S->Volume * S->Velocity); + // copy the sample to it's individual output. + SetOutput (s + 1, n, ((*m_SampleVec[s])[S->SamplePos] * S->Volume)); + float Freq = S->Pitch; + if (S->Octave > 0) Freq *= 1 << (S->Octave); + if (S->Octave < 0) Freq /= 1 << (-S->Octave); + if (Pong) S->SamplePos -= Freq * S->PitchMod; + else S->SamplePos += Freq * S->PitchMod; + } + } + } + } + // record + static int LastRecording = false; + if (m_Recording && InputExists (REC_INPUT)) { + int s = 0; //GUI->GetCurrentSample(); + if (!LastRecording) m_SampleVec[s]->Clear(); + // new sample + if (m_SampleVec[s]->GetLength() == 0) { + *m_SampleVec[s] =* GetInput (REC_INPUT); + m_SampleDescVec[s]->SampleRate = m_HostInfo->SAMPLERATE; + m_SampleDescVec[s]->Stereo = false; + m_SampleDescVec[s]->Pitch *= 1.0f; + m_InitialPitch[s] = m_SampleDescVec[s]->Pitch; + m_SampleDescVec[s]->LoopEnd = m_SampleVec[s]->GetLength(); + } + else { + m_SampleVec[s]->Add (*GetInput (REC_INPUT)); + m_SampleDescVec[s]->LoopEnd = m_SampleVec[s]->GetLength(); + } + } + LastRecording = m_Recording; + if (m_SampleDescVec[m_Current]->SamplePos > 0) { + m_CurrentPlayPos = (long)m_SampleDescVec[m_Current]->SamplePos; + } +} + +void PoshSamplerPlugin::ExecuteCommands() { + if (m_AudioCH->IsCommandWaiting()) { + switch (m_AudioCH->GetCommand()) { + case LOAD: + LoadSample (m_GUIArgs.Num, m_GUIArgs.Name); + break; + case SAVE: + SaveSample (m_GUIArgs.Num, m_GUIArgs.Name); + break; + case SETVOL: + m_SampleDescVec[m_GUIArgs.Num]->Volume=m_GUIArgs.Value; + break; + case SETPITCH: + m_SampleDescVec[m_GUIArgs.Num]->PitchMod=m_GUIArgs.Value; + break; + case SETLOOP: + m_SampleDescVec[m_GUIArgs.Num]->Loop=m_GUIArgs.Boole; + break; + case SETPING: + m_SampleDescVec[m_GUIArgs.Num]->PingPong=m_GUIArgs.Boole; + break; + case SETNOTE: + m_SampleDescVec[m_GUIArgs.Num]->Note=m_GUIArgs.Int; + break; + case SETOCT: + m_SampleDescVec[m_GUIArgs.Num]->Octave=m_GUIArgs.Int-6; + break; + case SETPLAYPOINTS: + m_SampleDescVec[m_GUIArgs.Num]->PlayStart=m_GUIArgs.Start; + m_SampleDescVec[m_GUIArgs.Num]->LoopStart=m_GUIArgs.LoopStart; + m_SampleDescVec[m_GUIArgs.Num]->LoopEnd=m_GUIArgs.End; + break; + case SETREC: + m_Recording=m_GUIArgs.Boole; + break; + case CUT: + Cut (m_GUIArgs.Num, m_GUIArgs.Start, m_GUIArgs.End); + break; + case COPY: + Copy (m_GUIArgs.Num, m_GUIArgs.Start, m_GUIArgs.End); + break; + case PASTE: + Paste (m_GUIArgs.Num, m_GUIArgs.Start, m_GUIArgs.End); + break; + case MIX: + Mix (m_GUIArgs.Num, m_GUIArgs.Start, m_GUIArgs.End); + break; + case CROP: + Crop (m_GUIArgs.Num, m_GUIArgs.Start, m_GUIArgs.End); + break; + case REV: + Reverse (m_GUIArgs.Num, m_GUIArgs.Start, m_GUIArgs.End); + break; + case AMP: + Amp (m_GUIArgs.Num, m_GUIArgs.Start, m_GUIArgs.End); + break; + case SETCURRENT: + m_Current = m_GUIArgs.Num; + break; + case GETSAMPLE: + m_AudioCH->SetupBulkTransfer ((void*)m_SampleVec[m_Current]->GetBuffer()); + m_SampleSize = m_SampleVec[m_Current]->GetLengthInBytes(); + break; + case SETRETRIG: + m_SampleDescVec[m_GUIArgs.Num]->ReTrig = m_GUIArgs.Boole; + break; + case GETLOOP: + m_GUIArgs.BoolEcho = m_SampleDescVec[m_Current]->Loop; + break; + case GETPING: + m_GUIArgs.BoolEcho = m_SampleDescVec[m_Current]->PingPong; + break; + case GETRETRIG: + m_GUIArgs.BoolEcho = m_SampleDescVec[m_Current]->ReTrig; + break; + case GETVOL: + m_GUIArgs.ValEcho = m_SampleDescVec[m_Current]->Volume; + break; + case GETPITCH: + m_GUIArgs.ValEcho = m_SampleDescVec[m_Current]->PitchMod; + break; + case GETOCT: + m_GUIArgs.IntEcho = m_SampleDescVec[m_Current]->Octave + 6; + break; + case GETNOTE: + m_GUIArgs.IntEcho = m_SampleDescVec[m_Current]->Note; + break; + }; + } +} + +void PoshSamplerPlugin::InitializeSampleDescription (SampleDesc* NewDesc, int num, int Note) { + if (NewDesc) { + NewDesc->Volume = 1.0f; + NewDesc->Velocity = 1.0f; + NewDesc->Pitch = 1.0f; + NewDesc->PitchMod = 1.0f; + NewDesc->SamplePos = -1; + NewDesc->Loop = false; + NewDesc->PingPong = false; + NewDesc->Note = Note; + NewDesc->Octave = 0; + NewDesc->TriggerUp = true; + NewDesc->SamplePos = -1; + NewDesc->SampleRate = 44100; + NewDesc->Stereo = false; + NewDesc->PlayStart = 0; + NewDesc->LoopStart = 0; + NewDesc->LoopEnd = INT_MAX; + NewDesc->ReTrig = true; + } +} + +void PoshSamplerPlugin::StreamOut (ostream &s) { + s << m_Version << " "; + for (int n=0; nVolume << " " << + m_SampleDescVec[n]->PitchMod << " " << + m_SampleDescVec[n]->Loop << " " << + m_SampleDescVec[n]->PingPong << " " << + m_SampleDescVec[n]->Note << " " << + m_SampleDescVec[n]->Octave << " " << + m_SampleDescVec[n]->SamplePos << " " << + m_SampleDescVec[n]->PlayStart << " " << + m_SampleDescVec[n]->LoopStart << " " << + m_SampleDescVec[n]->LoopEnd << " " << + m_SampleDescVec[n]->Note << " " << + m_SampleDescVec[n]->ReTrig << " "; + } +} + +void PoshSamplerPlugin::StreamIn (istream &s) { + int version; + s >> version; + for (int n=0; n> m_SampleDescVec[n]->Volume >> + m_SampleDescVec[n]->PitchMod >> + m_SampleDescVec[n]->Loop >> + m_SampleDescVec[n]->PingPong >> + m_SampleDescVec[n]->Note >> + m_SampleDescVec[n]->Octave >> + m_SampleDescVec[n]->SamplePos >> + m_SampleDescVec[n]->PlayStart >> + m_SampleDescVec[n]->LoopStart >> + m_SampleDescVec[n]->LoopEnd >> + m_SampleDescVec[n]->Note; + if (version < 3) { + int size; + s >> size; + s.ignore (1); + char Buf[4096]; + s.get (Buf, size+1); + } + if (version > 3) s >> m_SampleDescVec[n]->ReTrig; + else m_SampleDescVec[n]->ReTrig = true; + } +} + +void PoshSamplerPlugin::LoadSample (int n, const string &Name) { + WavFile Wav; + if (Wav.Open (Name, WavFile::READ)) { + m_SampleVec[n]->Allocate (Wav.GetSize()); + Wav.Load (*m_SampleVec[n]); + // andy preston - if this is not commented out, when we load a patch this overwrites the + // loaded data with the defaults + // InitializeSampleDescription (m_SampleDescVec[n], n, n); + m_SampleDescVec[n]->SampleRate = Wav.GetSamplerate(); + m_SampleDescVec[n]->Stereo = Wav.IsStereo(); + m_InitialPitch[n] = m_SampleDescVec[n]->Pitch; + m_SampleDescVec[n]->Pitch = m_InitialPitch[n] * m_SampleDescVec[n]->SampleRate / (float)m_HostInfo->SAMPLERATE; + m_SampleDescVec[n]->LoopEnd = m_SampleVec[n]->GetLength()-1; + } } void PoshSamplerPlugin::SaveSample(int n, const string &Name) @@ -468,42 +448,25 @@ } } +// The sprintf's in here should use strstream, but the current implementation (GCC 2.95.3) is buggy -bool PoshSamplerPlugin::SaveExternalFiles(const string &Dir) -{ - for (int n=0; nPathname = temp; - } - - for (int n=0; nGetLength()!=0) - { - SaveSample(n,Dir+m_SampleDescVec[n]->Pathname); - } - } - return true; -} - -void PoshSamplerPlugin::LoadExternalFiles(const string &Dir) -{ - for (int n=0; nPathname = temp; - } - - for (int n=0; nPathname); - } +bool PoshSamplerPlugin::SaveExternalFiles (const string &Dir) { + char temp[256]; + for (int n=0; nGetLength() != 0) { + sprintf (temp, "%sPoshSampler%d_%d.wav", Dir.c_str(), GetID(), n); + SaveSample (n, temp); + } + } + return true; +} + +void PoshSamplerPlugin::LoadExternalFiles(const string &Dir, int withID) { + int UseID = (withID==-1) ? GetID() : withID; + char temp[256]; + for (int n=0; n -#include +#include +#include "../GUI/WaveChooser.h" +#include using namespace std; @@ -43,10 +45,14 @@ { } -void Fl_WaveDisplay::SetSample(const float* s, long len) -{ - if (m_Sample) delete m_Sample; - m_Sample = new Sample(s,len); +void Fl_WaveDisplay::SetSample (const float *s, long len) { + if (m_Sample) delete m_Sample; + m_Sample = new Sample (s, len); +} + +void Fl_WaveDisplay::ClearSample (void) { + if (m_Sample) delete m_Sample; + m_Sample = NULL; } void Fl_WaveDisplay::draw() @@ -176,65 +182,65 @@ if (MousePos>m_EndPos) m_EndPos=MousePos; else m_StartPos=MousePos; } break; - + case 1: { m_StartPos=MousePos; if (m_StartPos>m_EndPos) Holding=2; // swap } break; - + case 2: { m_EndPos=MousePos; if (m_StartPos>m_EndPos) Holding=1; // swap } break; - + case 3: m_PlayStart=MousePos; break; case 4: m_LoopStart=MousePos; break; case 5: m_LoopEnd=MousePos; break; } } - + if (Mousebutton==2) { int Dist=(DragX-xx)*((m_ViewEnd-m_ViewStart)/w()); if (m_ViewStart>0 && m_ViewEndGetLength()-1) - { - m_ViewStart+=Dist; + { + m_ViewStart+=Dist; m_ViewEnd+=Dist; } else // stop it sticking when at end/beginning { if ((Dist>0 && m_ViewStart<=0) || - (Dist<0 && m_ViewEnd>=m_Sample->GetLength()-1)) + (Dist<0 && m_ViewEnd>=m_Sample->GetLength()-1)) { - m_ViewStart+=Dist; + m_ViewStart+=Dist; m_ViewEnd+=Dist; } } DragX=xx; DragY=yy; - } - + } + if (Mousebutton==3) { // only draw wave at 1 pixel = 1 sample if ((m_ViewEnd-m_ViewStart)/w()==1) { - int MousePos=(xx-x())*((m_ViewEnd-m_ViewStart)/w())+m_ViewStart; - float Value=-(yy-y())/((float)h()/2.0f)+1.0f; + int MousePos=(xx-x())*((m_ViewEnd-m_ViewStart)/w())+m_ViewStart; + float Value=-(yy-y())/((float)h()/2.0f)+1.0f; m_Sample->Set(MousePos,Value); redraw(); } } - + do_callback(); - redraw(); + redraw(); } - + if (m_EndPos>=m_Sample->GetLength()) m_EndPos=m_Sample->GetLength()-1; - + return 1; } @@ -243,17 +249,17 @@ int Zoom=(int)((m_ViewEnd-m_ViewStart)*0.03f); if ((m_ViewEnd-m_ViewStart)/w()>1) { - m_ViewStart+=Zoom; + m_ViewStart+=Zoom; m_ViewEnd-=Zoom; } - + redraw(); } void Fl_WaveDisplay::ZoomOut() { int Zoom=(int)((m_ViewEnd-m_ViewStart)*0.03f); - m_ViewStart-=Zoom; + m_ViewStart-=Zoom; m_ViewEnd+=Zoom; redraw(); } @@ -263,10 +269,10 @@ PoshSamplerPluginGUI::PoshSamplerPluginGUI(int w, int h,PoshSamplerPlugin *o,ChannelHandler *ch,const HostInfo *Info) : SpiralPluginGUI(w,h,o,ch), m_UpdateMe(false) -{ - int n=0; +{ + int n=0; - m_Load = new Fl_Button(5, 20, 70, 20, "Load"); + m_Load = new Fl_Button(5, 20, 50, 20, "Load"); m_Load->labelsize(10); m_Load->box (FL_PLASTIC_UP_BOX); m_Load->color (Info->GUI_COLOUR); @@ -274,7 +280,7 @@ m_Load->callback((Fl_Callback*)cb_Load); add(m_Load); - m_Save = new Fl_Button(5, 40, 70, 20, "Save"); + m_Save = new Fl_Button(55, 20, 50, 20, "Save"); m_Save->labelsize(10); m_Save->box (FL_PLASTIC_UP_BOX); m_Save->color (Info->GUI_COLOUR); @@ -282,7 +288,7 @@ m_Save->callback((Fl_Callback*)cb_Save); add(m_Save); - m_Record = new Fl_Button(5, 60, 70, 20, "Record"); + m_Record = new Fl_Button(105, 20, 50, 20, "Record"); m_Record->type (FL_TOGGLE_BUTTON); m_Record->box (FL_PLASTIC_UP_BOX); m_Record->color (FL_RED); @@ -292,7 +298,7 @@ m_Record->callback((Fl_Callback*)cb_Record); add(m_Record); - m_Loop = new Fl_Button(80, 20, 70, 20, "Loop"); + m_Loop = new Fl_Button(5, 40, 75, 20, "Loop"); m_Loop->type (FL_TOGGLE_BUTTON); m_Loop->labelsize(10); m_Loop->box (FL_PLASTIC_UP_BOX); @@ -301,8 +307,7 @@ m_Loop->callback((Fl_Callback*)cb_Loop); add(m_Loop); - m_PingPong = new Fl_Button(80, 40, 70, 20, "PingPong"); - m_PingPong->labelsize(10); + m_PingPong = new Fl_Button(80, 40, 75, 20, "PingPong"); m_PingPong->type (FL_TOGGLE_BUTTON); m_PingPong->labelsize(10); m_PingPong->box (FL_PLASTIC_UP_BOX); @@ -311,8 +316,7 @@ m_PingPong->callback((Fl_Callback*)cb_PingPong); add(m_PingPong); - m_PosMarker = new Fl_Button(80, 60, 70, 20, "PosMarker"); - m_PosMarker->labelsize(10); + m_PosMarker = new Fl_Button(5, 60, 75, 20, "PosMarker"); m_PosMarker->type (FL_TOGGLE_BUTTON); m_PosMarker->labelsize(10); m_PosMarker->box (FL_PLASTIC_UP_BOX); @@ -322,6 +326,16 @@ m_PosMarker->callback((Fl_Callback*)cb_PosMarker); add(m_PosMarker); + m_Retrig = new Fl_Button (80, 60, 75, 20, "Re-Trigger"); + m_Retrig->type (FL_TOGGLE_BUTTON); + m_Retrig->labelsize (10); + m_Retrig->box (FL_PLASTIC_UP_BOX); + m_Retrig->color (Info->GUI_COLOUR); + m_Retrig->selection_color (Info->GUI_COLOUR); + m_Retrig->value (1); + m_Retrig->callback ((Fl_Callback*)cb_Retrig); + add (m_Retrig); + m_Volume = new Fl_Knob(160, 20, 50, 50, "Volume"); m_Volume->color(Info->GUI_COLOUR); m_Volume->type(Fl_Knob::LINELIN); @@ -379,7 +393,7 @@ Info->SCOPE_SEL_COLOUR, Info->SCOPE_IND_COLOUR, Info->SCOPE_MRK_COLOUR); m_Display->callback((Fl_Callback*)cb_WaveDisplay); - int bx=5,by=190,bw=w/9-2,bh=20,bs=w/9-2; + int bx=5, by=190, bw=w/9-2, bh=20, bs=w/9-2; n=0; m_Cut = new Fl_Button(bx+(n++*bs),by,bw,bh,"Cut"); @@ -446,70 +460,61 @@ //m_ZoomOut->callback((Fl_Callback*)cb_ZoomOut); end(); - redraw(); } -void PoshSamplerPluginGUI::UpdateSampleDisplay(int num) -{ - m_GUICH->SetCommand(PoshSamplerPlugin::GETSAMPLE); - m_GUICH->Wait(); - m_GUICH->RequestChannelAndWait("SampleSize"); - long SampleSize=m_GUICH->GetLong("SampleSize"); - - if (SampleSize) - { - char *TempBuf = new char[SampleSize]; - m_GUICH->BulkTransfer("SampleBuffer",(void*)TempBuf,SampleSize); - m_Display->SetSample((float*)TempBuf,SampleSize/sizeof(float)); - delete[] TempBuf; - } -} - -void PoshSamplerPluginGUI::Update() -{ - SetPlayPos(m_GUICH->GetLong("PlayPos")); - - if (m_ZoomIn->value()) m_Display->ZoomIn(); - if (m_ZoomOut->value()) m_Display->ZoomOut(); - - if (m_UpdateMe) - { - UpdateSampleDisplay((int)m_SampleNum->value()); - m_Display->redraw(); - m_UpdateMe=false; - } - //redraw(); +void PoshSamplerPluginGUI::UpdateSampleDisplay(int num) { + m_GUICH->SetCommand (PoshSamplerPlugin::GETSAMPLE); + m_GUICH->Wait(); + m_GUICH->RequestChannelAndWait ("SampleSize"); + long SampleSize = m_GUICH->GetLong ("SampleSize"); + if (!SampleSize) m_Display->ClearSample(); + else { + char *TempBuf = new char[SampleSize]; + m_GUICH->BulkTransfer ("SampleBuffer", (void*)TempBuf, SampleSize); + m_Display->SetSample ((float*)TempBuf, SampleSize / sizeof(float)); + delete[] TempBuf; + } +} + +void PoshSamplerPluginGUI::Update() { + SetPlayPos (m_GUICH->GetLong ("PlayPos")); + if (m_ZoomIn->value()) m_Display->ZoomIn(); + if (m_ZoomOut->value()) m_Display->ZoomOut(); + if (m_UpdateMe) { + UpdateSampleDisplay ((int)m_SampleNum->value()); + m_Display->redraw(); + m_UpdateMe=false; + } + // redraw(); +} + +void PoshSamplerPluginGUI::UpdateValues (SpiralPlugin *o) { + PoshSamplerPlugin *Plugin = (PoshSamplerPlugin*)o; + m_Volume->value (Plugin->GetVolume ((int)m_SampleNum->value())); + m_Pitch->value (Plugin->GetPitch ((int)m_SampleNum->value())); + m_Note->value (Plugin->GetNote ((int)m_SampleNum->value())); + m_Loop->value (Plugin->GetLoop ((int)m_SampleNum->value())); + m_Retrig->value (Plugin->GetReTrig ((int)m_SampleNum->value())); + m_UpdateMe = true; + m_Display->SetPlayStart (Plugin->GetPlayStart ((int)m_SampleNum->value())); + m_Display->SetLoopStart (Plugin->GetLoopStart ((int)m_SampleNum->value())); + m_Display->SetLoopEnd (Plugin->GetLoopEnd ((int)m_SampleNum->value())); + m_Display->redraw(); } -void PoshSamplerPluginGUI::UpdateValues(SpiralPlugin *o) -{ - PoshSamplerPlugin *Plugin = (PoshSamplerPlugin*)o; - - m_Volume->value(Plugin->GetVolume((int)m_SampleNum->value())); - m_Pitch->value(Plugin->GetPitch((int)m_SampleNum->value())); - m_Note->value(Plugin->GetNote((int)m_SampleNum->value())); - m_Loop->value(Plugin->GetLoop((int)m_SampleNum->value())); - m_UpdateMe=true; - m_Display->SetPlayStart(Plugin->GetPlayStart((int)m_SampleNum->value())); - m_Display->SetLoopStart(Plugin->GetLoopStart((int)m_SampleNum->value())); - m_Display->SetLoopEnd(Plugin->GetLoopEnd((int)m_SampleNum->value())); - m_Display->redraw(); -} - inline void PoshSamplerPluginGUI::cb_Load_i(Fl_Button* o, void* v) -{ - char *fn=fl_file_chooser("Load a sample", "{*.wav,*.WAV}", NULL); - +{ + char *fn=WaveFileName (); if (fn && fn!='\0') { strcpy(m_TextBuf,fn); m_GUICH->SetData("Name",m_TextBuf); m_GUICH->Set("Num",(int)m_SampleNum->value()); m_GUICH->SetCommand(PoshSamplerPlugin::LOAD); - + m_GUICH->Wait(); // wait for the sample to load - + UpdateSampleDisplay((int)m_SampleNum->value()); m_Display->redraw(); redraw(); @@ -521,9 +526,9 @@ inline void PoshSamplerPluginGUI::cb_Save_i(Fl_Button* o, void* v) { char *fn=fl_file_chooser("Save sample", "{*.wav,*.WAV}", NULL); - + if (fn && fn!='\0') - { + { strcpy(m_TextBuf,fn); m_GUICH->Set("Name",m_TextBuf); m_GUICH->Set("Num",(int)m_SampleNum->value()); @@ -533,17 +538,18 @@ void PoshSamplerPluginGUI::cb_Save(Fl_Button* o, void* v) { ((PoshSamplerPluginGUI*)(o->parent()))->cb_Save_i(o,v);} -inline void PoshSamplerPluginGUI::cb_Volume_i(Fl_Knob* o, void* v) -{ - m_GUICH->Set("Value",(float)o->value()); - m_GUICH->Set("Num",(int)m_SampleNum->value()); - m_GUICH->SetCommand(PoshSamplerPlugin::SETVOL); +inline void PoshSamplerPluginGUI::cb_Volume_i (Fl_Knob *o, void *v) { + m_GUICH->Set ("Value", (float)o->value()); + m_GUICH->Set ("Num", (int)m_SampleNum->value()); + m_GUICH->SetCommand (PoshSamplerPlugin::SETVOL); +} + +void PoshSamplerPluginGUI::cb_Volume (Fl_Knob *o, void *v) { + ((PoshSamplerPluginGUI*)(o->parent()))->cb_Volume_i (o, v); } -void PoshSamplerPluginGUI::cb_Volume(Fl_Knob* o, void* v) -{ ((PoshSamplerPluginGUI*)(o->parent()))->cb_Volume_i(o,v);} inline void PoshSamplerPluginGUI::cb_Pitch_i(Fl_Knob* o, void* v) -{ +{ m_GUICH->Set("Value",(float)o->value()); m_GUICH->Set("Num",(int)m_SampleNum->value()); m_GUICH->SetCommand(PoshSamplerPlugin::SETPITCH); @@ -552,7 +558,7 @@ { ((PoshSamplerPluginGUI*)(o->parent()))->cb_Pitch_i(o,v);} inline void PoshSamplerPluginGUI::cb_Octave_i(Fl_Knob* o, void* v) -{ +{ m_GUICH->Set("Int",(int)o->value()); m_GUICH->Set("Num",(int)m_SampleNum->value()); m_GUICH->SetCommand(PoshSamplerPlugin::SETOCT); @@ -561,7 +567,7 @@ { ((PoshSamplerPluginGUI*)(o->parent()))->cb_Octave_i(o,v);} inline void PoshSamplerPluginGUI::cb_Loop_i(Fl_Button* o, void* v) -{ +{ m_GUICH->Set("Bool",(bool)o->value()); m_GUICH->Set("Num",(int)m_SampleNum->value()); m_GUICH->SetCommand(PoshSamplerPlugin::SETLOOP); @@ -569,8 +575,17 @@ void PoshSamplerPluginGUI::cb_Loop(Fl_Button* o, void* v) { ((PoshSamplerPluginGUI*)(o->parent()))->cb_Loop_i(o,v);} +inline void PoshSamplerPluginGUI::cb_Retrig_i (Fl_Button *o, void *v) { + m_GUICH->Set("Bool",(bool)o->value()); + m_GUICH->Set("Num",(int)m_SampleNum->value()); + m_GUICH->SetCommand(PoshSamplerPlugin::SETRETRIG); +} +void PoshSamplerPluginGUI::cb_Retrig (Fl_Button *o, void *v) { + ((PoshSamplerPluginGUI*)(o->parent()))->cb_Retrig_i (o, v); +} + inline void PoshSamplerPluginGUI::cb_PingPong_i(Fl_Button* o, void* v) -{ +{ m_GUICH->Set("Bool",(bool)o->value()); m_GUICH->Set("Num",(int)m_SampleNum->value()); m_GUICH->SetCommand(PoshSamplerPlugin::SETPING); @@ -593,7 +608,7 @@ { ((PoshSamplerPluginGUI*)(o->parent()))->cb_PosMarker_i(o,v);} inline void PoshSamplerPluginGUI::cb_Note_i(Fl_Counter* o, void* v) -{ +{ m_GUICH->Set("Int",(int)o->value()); m_GUICH->Set("Num",(int)m_SampleNum->value()); m_GUICH->SetCommand(PoshSamplerPlugin::SETNOTE); @@ -601,34 +616,55 @@ void PoshSamplerPluginGUI::cb_Note(Fl_Counter* o, void* v) { ((PoshSamplerPluginGUI*)(o->parent()))->cb_Note_i(o,v);} -inline void PoshSamplerPluginGUI::cb_SampleNum_i(Fl_Counter* o, void* v) -{ - if (m_SampleNum->value()<0) m_SampleNum->value(0); - if (m_SampleNum->value()>7) m_SampleNum->value(7); - m_GUICH->Set("Num",(int)m_SampleNum->value()); - m_GUICH->SetCommand(PoshSamplerPlugin::SETCURRENT); - m_GUICH->Wait(); - UpdateSampleDisplay((int)m_SampleNum->value()); +inline void PoshSamplerPluginGUI::cb_SampleNum_i (Fl_Counter *o, void *v) { + if (m_SampleNum->value() < 0) m_SampleNum->value (0); + if (m_SampleNum->value() > 7) m_SampleNum->value (7); + m_GUICH->Set ("Num", (int)m_SampleNum->value()); + m_GUICH->SetCommand (PoshSamplerPlugin::SETCURRENT); + m_GUICH->Wait(); + m_GUICH->SetCommand (PoshSamplerPlugin::GETLOOP); + m_GUICH->Wait(); + m_Loop->value (m_GUICH->GetBool ("BoolEcho")); + m_GUICH->SetCommand (PoshSamplerPlugin::GETPING); + m_GUICH->Wait(); + m_PingPong->value (m_GUICH->GetBool ("BoolEcho")); + m_GUICH->SetCommand (PoshSamplerPlugin::GETRETRIG); + m_GUICH->Wait(); + m_Retrig->value (m_GUICH->GetBool ("BoolEcho")); + m_GUICH->SetCommand (PoshSamplerPlugin::GETVOL); + m_GUICH->Wait(); + m_Volume->value (m_GUICH->GetFloat ("ValEcho")); + m_GUICH->SetCommand (PoshSamplerPlugin::GETPITCH); + m_GUICH->Wait(); + m_Pitch->value (m_GUICH->GetFloat ("ValEcho")); + m_GUICH->SetCommand (PoshSamplerPlugin::GETOCT); + m_GUICH->Wait(); + m_Octave->value (m_GUICH->GetInt ("IntEcho")); + m_GUICH->SetCommand (PoshSamplerPlugin::GETNOTE); + m_GUICH->Wait(); + m_Note->value (m_GUICH->GetInt ("IntEcho")); + UpdateSampleDisplay ((int)m_SampleNum->value()); } -void PoshSamplerPluginGUI::cb_SampleNum(Fl_Counter* o, void* v) -{ ((PoshSamplerPluginGUI*)(o->parent()))->cb_SampleNum_i(o,v);} +void PoshSamplerPluginGUI::cb_SampleNum (Fl_Counter *o, void *v) { + ((PoshSamplerPluginGUI*)(o->parent()))->cb_SampleNum_i (o, v); +} inline void PoshSamplerPluginGUI::cb_Cut_i(Fl_Button* o, void* v) -{ +{ m_GUICH->Set("Start",(long)m_Display->GetRangeStart()); m_GUICH->Set("End",(long)m_Display->GetRangeEnd()); m_GUICH->Set("Num",(int)m_SampleNum->value()); m_GUICH->SetCommand(PoshSamplerPlugin::CUT); - m_GUICH->Wait(); + m_GUICH->Wait(); UpdateSampleDisplay((int)m_SampleNum->value()); m_Display->redraw(); } void PoshSamplerPluginGUI::cb_Cut(Fl_Button* o, void* v) { ((PoshSamplerPluginGUI*)(o->parent()))->cb_Cut_i(o,v);} - + inline void PoshSamplerPluginGUI::cb_Copy_i(Fl_Button* o, void* v) -{ +{ m_GUICH->Set("Start",(long)m_Display->GetRangeStart()); m_GUICH->Set("End",(long)m_Display->GetRangeEnd()); m_GUICH->Set("Num",(int)m_SampleNum->value()); @@ -636,27 +672,27 @@ } void PoshSamplerPluginGUI::cb_Copy(Fl_Button* o, void* v) { ((PoshSamplerPluginGUI*)(o->parent()))->cb_Copy_i(o,v);} - + inline void PoshSamplerPluginGUI::cb_Paste_i(Fl_Button* o, void* v) { m_GUICH->Set("Start",(long)m_Display->GetRangeStart()); m_GUICH->Set("End",(long)m_Display->GetRangeEnd()); m_GUICH->Set("Num",(int)m_SampleNum->value()); m_GUICH->SetCommand(PoshSamplerPlugin::PASTE); - m_GUICH->Wait(); + m_GUICH->Wait(); UpdateSampleDisplay((int)m_SampleNum->value()); m_Display->redraw(); } void PoshSamplerPluginGUI::cb_Paste(Fl_Button* o, void* v) { ((PoshSamplerPluginGUI*)(o->parent()))->cb_Paste_i(o,v);} - + inline void PoshSamplerPluginGUI::cb_Mix_i(Fl_Button* o, void* v) { m_GUICH->Set("Start",(long)m_Display->GetRangeStart()); m_GUICH->Set("End",(long)m_Display->GetRangeEnd()); m_GUICH->Set("Num",(int)m_SampleNum->value()); m_GUICH->SetCommand(PoshSamplerPlugin::MIX); - m_GUICH->Wait(); + m_GUICH->Wait(); UpdateSampleDisplay((int)m_SampleNum->value()); m_Display->redraw(); } @@ -669,7 +705,7 @@ m_GUICH->Set("End",(long)m_Display->GetRangeEnd()); m_GUICH->Set("Num",(int)m_SampleNum->value()); m_GUICH->SetCommand(PoshSamplerPlugin::CROP); - m_GUICH->Wait(); + m_GUICH->Wait(); UpdateSampleDisplay((int)m_SampleNum->value()); m_Display->redraw(); } @@ -677,12 +713,12 @@ { ((PoshSamplerPluginGUI*)(o->parent()))->cb_Crop_i(o,v);} inline void PoshSamplerPluginGUI::cb_Reverse_i(Fl_Button* o, void* v) -{ +{ m_GUICH->Set("Start",(long)m_Display->GetRangeStart()); m_GUICH->Set("End",(long)m_Display->GetRangeEnd()); m_GUICH->Set("Num",(int)m_SampleNum->value()); m_GUICH->SetCommand(PoshSamplerPlugin::REV); - m_GUICH->Wait(); + m_GUICH->Wait(); UpdateSampleDisplay((int)m_SampleNum->value()); m_Display->redraw(); } @@ -695,7 +731,7 @@ m_GUICH->Set("End",(long)m_Display->GetRangeEnd()); m_GUICH->Set("Num",(int)m_SampleNum->value()); m_GUICH->SetCommand(PoshSamplerPlugin::AMP); - m_GUICH->Wait(); + m_GUICH->Wait(); UpdateSampleDisplay((int)m_SampleNum->value()); m_Display->redraw(); } @@ -706,7 +742,7 @@ { m_GUICH->Set("Start",(long)o->GetPlayStart()); m_GUICH->Set("End",(long)o->GetLoopEnd()); - m_GUICH->Set("LoopStart",(long)o->GetLoopStart()); + m_GUICH->Set("LoopStart",(long)o->GetLoopStart()); m_GUICH->Set("Num",(int)m_SampleNum->value()); m_GUICH->SetCommand(PoshSamplerPlugin::SETPLAYPOINTS); } @@ -727,12 +763,13 @@ void PoshSamplerPluginGUI::cb_ZoomOut(Fl_Button* o, void* v) { ((PoshSamplerPluginGUI*)(o->parent()))->cb_ZoomOut_i(o,v);} + const string PoshSamplerPluginGUI::GetHelpText(const string &loc){ - return string("") + return string("") + "A sampler that allows simple sample editing (cut copy paste etc),\n" - + "dirty time stretching (by modulating the start pos + retriggering +\n" + + "dirty time stretching (by modulating the start pos + retriggering +\n" + "modulating pitch) and loop start/end points with ping pong loop mode.\n" - + "Also implementations of controls, such as continuous pitch changing,\n" + + "Also implementations of controls, such as continuous pitch changing,\n" + "so you can add portmento to samples, trigger velocity sets sample\n" + "volume.\n\n" + "Can records input data too.\n\n" @@ -740,7 +777,7 @@ + "lmb: Select region\n" + "mmb: Move view\n" + "rmb: Draws samples at full zoom.\n\n" - + "Left mouse also drags loop points. The Loop end marker defaults to the\n" + + "Left mouse also drags loop points. The Loop end marker defaults to the\n" + "end of the sample.\n\n" + "Note: The loading and saving of samples is not yet realtime safe"; } diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPluginGUI.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPluginGUI.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPluginGUI.h 2003-08-08 17:55:51.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPluginGUI.h 2012-05-31 04:13:57.000000000 +0000 @@ -16,6 +16,9 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef POSH_SAMP_GUI_H +#define POSH_SAMP_GUI_H + #include #include #include @@ -23,143 +26,107 @@ #include "../SpiralPluginGUI.h" #include "../Widgets/Fl_Knob.H" -#ifndef POSH_SAMP_GUI_H -#define POSH_SAMP_GUI_H - -class Fl_WaveDisplay : public Fl_Widget -{ - public: - Fl_WaveDisplay(int x,int y,int w,int h, char* Name); - ~Fl_WaveDisplay(); - virtual void draw(); - virtual int handle(int event); - void SetSample(const float* s, long len); - long GetRangeStart() { return m_StartPos; } - long GetRangeEnd() { return m_EndPos; } - long GetViewStart() { return m_ViewStart; } - void SetViewStart(long s) { m_ViewStart=s; } - long GetViewEnd() { return m_ViewEnd; } - void SetViewEnd(long s) { m_ViewEnd=s; } - void SetPlayPos(long s) { m_PlayPos=s; if(m_PosMarker) redraw(); } - void SetPlayStart(long s) { m_PlayStart=s; } - long GetPlayStart() { return m_PlayStart; } - void SetLoopStart(long s) { m_LoopStart=s; } - long GetLoopStart() { return m_LoopStart; } - void SetLoopEnd(long s) { m_LoopEnd=s; } - long GetLoopEnd() { return m_LoopEnd; } - void SetPosMarker(bool s) { m_PosMarker=s; } - void ZoomIn(); - void ZoomOut(); - void SetColours (unsigned b, unsigned f, unsigned s, unsigned i, unsigned m) { - m_BGColour=(Fl_Color)b; m_FGColour=(Fl_Color)f; m_SelColour=(Fl_Color)s; - m_IndColour=(Fl_Color)i; m_MrkColour=(Fl_Color)m; - } - private: - Fl_Color m_BGColour, m_FGColour, m_SelColour, m_IndColour, m_MrkColour; - Sample *m_Sample; - long m_StartPos; - long m_EndPos; - - long m_ViewStart; - long m_ViewEnd; - long m_PlayPos; - - long m_PlayStart; - long m_LoopStart; - long m_LoopEnd; - bool m_PosMarker; +class Fl_WaveDisplay : public Fl_Widget { + public: + Fl_WaveDisplay (int x,int y,int w,int h, char* Name); + ~Fl_WaveDisplay(); + virtual void draw(); + virtual int handle (int event); + void SetSample (const float* s, long len); + void ClearSample (void); + long GetRangeStart() { return m_StartPos; } + long GetRangeEnd() { return m_EndPos; } + long GetViewStart() { return m_ViewStart; } + void SetViewStart(long s) { m_ViewStart=s; } + long GetViewEnd() { return m_ViewEnd; } + void SetViewEnd(long s) { m_ViewEnd=s; } + void SetPlayPos(long s) { m_PlayPos=s; if(m_PosMarker) redraw(); } + void SetPlayStart(long s) { m_PlayStart=s; } + long GetPlayStart() { return m_PlayStart; } + void SetLoopStart(long s) { m_LoopStart=s; } + long GetLoopStart() { return m_LoopStart; } + void SetLoopEnd(long s) { m_LoopEnd=s; } + long GetLoopEnd() { return m_LoopEnd; } + void SetPosMarker(bool s) { m_PosMarker=s; } + void ZoomIn(); + void ZoomOut(); + void SetColours (unsigned b, unsigned f, unsigned s, unsigned i, unsigned m) { + m_BGColour=(Fl_Color)b; m_FGColour=(Fl_Color)f; m_SelColour=(Fl_Color)s; + m_IndColour=(Fl_Color)i; m_MrkColour=(Fl_Color)m; + } + private: + Fl_Color m_BGColour, m_FGColour, m_SelColour, m_IndColour, m_MrkColour; + Sample *m_Sample; + long m_StartPos, m_EndPos, m_ViewStart, m_ViewEnd; + long m_PlayPos, m_PlayStart, m_LoopStart, m_LoopEnd; + bool m_PosMarker; }; -class PoshSamplerPluginGUI : public SpiralPluginGUI -{ -public: - PoshSamplerPluginGUI(int w, int h, PoshSamplerPlugin *o,ChannelHandler *ch, const HostInfo *Info); - - virtual void UpdateValues(SpiralPlugin *o); - virtual void Update(); - - void SetPlayPos(long s) { m_Display->SetPlayPos(s); } - int GetCurrentSample() { return (int)m_SampleNum->value(); } - -protected: - const std::string GetHelpText(const std::string &loc); - -private: - - void UpdateSampleDisplay(int num); - - char m_TextBuf[256]; - int Numbers[NUM_SAMPLES]; - bool m_UpdateMe; - - Fl_Button* m_Load; - Fl_Button* m_Save; - Fl_Button* m_PosMarker; - Fl_Knob* m_Volume; - Fl_Knob* m_Pitch; - Fl_Knob* m_Octave; - Fl_Button* m_Loop; - Fl_Button* m_PingPong; - Fl_Button* m_Record; - Fl_Counter* m_Note; - Fl_WaveDisplay* m_Display; - Fl_Counter* m_SampleNum; - Fl_Button* m_ZoomIn; - Fl_Button* m_ZoomOut; - - Fl_Button* m_Cut; - Fl_Button* m_Copy; - Fl_Button* m_Paste; - Fl_Button* m_Mix; - Fl_Button* m_Crop; - Fl_Button* m_Reverse; - Fl_Button* m_Amp; - - //// Callbacks //// - inline void cb_Load_i(Fl_Button* o, void* v); - static void cb_Load(Fl_Button* o, void* v); - inline void cb_Save_i(Fl_Button* o, void* v); - static void cb_Save(Fl_Button* o, void* v); - inline void cb_PosMarker_i(Fl_Button* o, void* v); - static void cb_PosMarker(Fl_Button* o, void* v); - inline void cb_Record_i(Fl_Button* o, void* v); - static void cb_Record(Fl_Button* o, void* v); - inline void cb_Volume_i(Fl_Knob* o, void* v); - static void cb_Volume(Fl_Knob* o, void* v); - inline void cb_Pitch_i(Fl_Knob* o, void* v); - static void cb_Pitch(Fl_Knob* o, void* v); - inline void cb_Octave_i(Fl_Knob* o, void* v); - static void cb_Octave(Fl_Knob* o, void* v); - inline void cb_Loop_i(Fl_Button* o, void* v); - static void cb_Loop(Fl_Button* o, void* v); - inline void cb_PingPong_i(Fl_Button* o, void* v); - static void cb_PingPong(Fl_Button* o, void* v); - inline void cb_Note_i(Fl_Counter* o, void* v); - static void cb_Note(Fl_Counter* o, void* v); - inline void cb_SampleNum_i(Fl_Counter* o, void* v); - static void cb_SampleNum(Fl_Counter* o, void* v); - - inline void cb_Cut_i(Fl_Button* o, void* v); - static void cb_Cut(Fl_Button* o, void* v); - inline void cb_Copy_i(Fl_Button* o, void* v); - static void cb_Copy(Fl_Button* o, void* v); - inline void cb_Paste_i(Fl_Button* o, void* v); - static void cb_Paste(Fl_Button* o, void* v); - inline void cb_Mix_i(Fl_Button* o, void* v); - static void cb_Mix(Fl_Button* o, void* v); - inline void cb_Crop_i(Fl_Button* o, void* v); - static void cb_Crop(Fl_Button* o, void* v); - inline void cb_Reverse_i(Fl_Button* o, void* v); - static void cb_Reverse(Fl_Button* o, void* v); - inline void cb_Amp_i(Fl_Button* o, void* v); - static void cb_Amp(Fl_Button* o, void* v); - inline void cb_ZoomIn_i(Fl_Button* o, void* v); - static void cb_ZoomIn(Fl_Button* o, void* v); - inline void cb_ZoomOut_i(Fl_Button* o, void* v); - static void cb_ZoomOut(Fl_Button* o, void* v); - inline void cb_WaveDisplay_i(Fl_WaveDisplay* o, void* v); - static void cb_WaveDisplay(Fl_WaveDisplay* o, void* v); +class PoshSamplerPluginGUI : public SpiralPluginGUI { + public: + PoshSamplerPluginGUI (int w, int h, PoshSamplerPlugin *o, ChannelHandler *ch, const HostInfo *Info); + virtual void UpdateValues (SpiralPlugin *o); + virtual void Update(); + void SetPlayPos (long s) { m_Display->SetPlayPos(s); } + int GetCurrentSample() { return (int)m_SampleNum->value(); } + protected: + const std::string GetHelpText(const std::string &loc); + private: + void UpdateSampleDisplay(int num); + char m_TextBuf[256]; + int Numbers[NUM_SAMPLES]; + bool m_UpdateMe; + Fl_Knob *m_Volume, *m_Pitch, *m_Octave; + Fl_Button *m_Load, *m_Save, *m_Record, *m_Loop, *m_PingPong, *m_PosMarker, *m_Retrig; + Fl_Button *m_ZoomIn, *m_ZoomOut, *m_Cut, *m_Copy, *m_Paste, *m_Mix, *m_Crop, *m_Reverse, *m_Amp; + Fl_Counter *m_Note, *m_SampleNum; + Fl_WaveDisplay *m_Display; + //// Callbacks //// + inline void cb_Load_i (Fl_Button *o, void *v); + static void cb_Load (Fl_Button *o, void *v); + inline void cb_Save_i (Fl_Button *o, void *v); + static void cb_Save (Fl_Button *o, void *v); + inline void cb_Record_i (Fl_Button *o, void *v); + static void cb_Record (Fl_Button *o, void *v); + inline void cb_Loop_i (Fl_Button *o, void *v); + static void cb_Loop (Fl_Button *o, void *v); + inline void cb_PingPong_i (Fl_Button *o, void *v); + static void cb_PingPong (Fl_Button *o, void *v); + inline void cb_PosMarker_i (Fl_Button *o, void *v); + static void cb_PosMarker (Fl_Button *o, void *v); + inline void cb_Retrig_i (Fl_Button *o, void *v); + static void cb_Retrig (Fl_Button *o, void *v); + inline void cb_Volume_i (Fl_Knob *o, void *v); + static void cb_Volume (Fl_Knob *o, void *v); + inline void cb_Pitch_i (Fl_Knob *o, void *v); + static void cb_Pitch (Fl_Knob *o, void *v); + inline void cb_Octave_i (Fl_Knob *o, void *v); + static void cb_Octave (Fl_Knob *o, void *v); + inline void cb_Note_i (Fl_Counter *o, void *v); + static void cb_Note (Fl_Counter *o, void *v); + inline void cb_SampleNum_i (Fl_Counter *o, void *v); + static void cb_SampleNum (Fl_Counter *o, void *v); + inline void cb_Cut_i (Fl_Button *o, void *v); + static void cb_Cut (Fl_Button *o, void *v); + inline void cb_Copy_i (Fl_Button *o, void *v); + static void cb_Copy (Fl_Button *o, void *v); + inline void cb_Paste_i (Fl_Button *o, void *v); + static void cb_Paste (Fl_Button *o, void *v); + inline void cb_Mix_i (Fl_Button *o, void *v); + static void cb_Mix (Fl_Button *o, void *v); + inline void cb_Crop_i (Fl_Button *o, void *v); + static void cb_Crop (Fl_Button *o, void *v); + inline void cb_Reverse_i (Fl_Button *o, void *v); + static void cb_Reverse (Fl_Button *o, void *v); + inline void cb_Amp_i (Fl_Button *o, void *v); + static void cb_Amp (Fl_Button *o, void *v); + inline void cb_ZoomIn_i (Fl_Button *o, void *v); + static void cb_ZoomIn (Fl_Button *o, void *v); + inline void cb_ZoomOut_i (Fl_Button *o, void *v); + static void cb_ZoomOut (Fl_Button *o, void *v); + inline void cb_WaveDisplay_i (Fl_WaveDisplay *o, void *v); + static void cb_WaveDisplay (Fl_WaveDisplay *o, void *v); }; #endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPlugin.h 2003-08-08 17:55:51.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -14,120 +14,84 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "../SpiralPlugin.h" -#include +*/ #ifndef PoshSamplerPLUGIN #define PoshSamplerPLUGIN +#include "../SpiralPlugin.h" +#include + static const int NUM_SAMPLES = 8; static const int TRANSBUF_SIZE = 0x10000; -struct SampleDesc -{ - std::string Pathname; - float Volume; - float Velocity; - float Pitch; - float PitchMod; - bool Loop; - bool PingPong; - int Note; - int Octave; - bool TriggerUp; - float SamplePos; - int SampleRate; - bool Stereo; - long PlayStart; - long LoopStart; - long LoopEnd; +struct SampleDesc { + float Volume, Velocity, Pitch, PitchMod; + bool Loop, PingPong; + int Note, Octave; + bool TriggerUp; + float SamplePos; + int SampleRate; + bool Stereo; + long PlayStart, LoopStart, LoopEnd; + bool ReTrig; }; -class PoshSamplerPlugin : public SpiralPlugin -{ -public: - PoshSamplerPlugin(); - virtual ~PoshSamplerPlugin(); - - virtual PluginInfo &Initialise(const HostInfo *Host); - virtual SpiralGUIType *CreateGUI(); - virtual void Execute(); - virtual void ExecuteCommands(); - virtual void StreamOut(std::ostream &s); - virtual void StreamIn(std::istream &s); - - virtual bool SaveExternalFiles(const std::string &Dir); - virtual void LoadExternalFiles(const std::string &Dir); - - enum GUICommands{NONE,LOAD,SAVE,SETVOL,SETPITCH,SETLOOP,SETPING,SETNOTE,SETOCT, - SETPLAYPOINTS,SETREC,CUT,COPY,PASTE,CROP,MIX,REV,AMP,SETCURRENT, - GETSAMPLE}; - - struct GUIArgs - { - int Num; - float Value; - bool Boole; - int Int; - long Start; - long End; - long LoopStart; - char Name[256]; - }; - - void LoadSample(int n, const std::string &Name); - void SaveSample(int n, const std::string &Name); - Sample* GetSample(int n) { return m_SampleVec[n]; } - - float GetVolume(int n) { return m_SampleDescVec[n]->Volume; } - float GetPitch(int n) { return m_SampleDescVec[n]->PitchMod; } - bool GetLoop(int n) { return m_SampleDescVec[n]->Loop; } - bool GetPingPong(int n) { return m_SampleDescVec[n]->PingPong; } - int GetNote(int n) { return m_SampleDescVec[n]->Note; } - int GetOctave(int n) { return m_SampleDescVec[n]->Octave+6; } - - long GetPlayStart(int n) { return m_SampleDescVec[n]->PlayStart; } - long GetLoopStart(int n) { return m_SampleDescVec[n]->LoopStart; } - long GetLoopEnd(int n) { return m_SampleDescVec[n]->LoopEnd; } - - std::vector m_SampleVec; - std::vector m_SampleDescVec; - -private: - - void SetVolume(int n, float s) { m_SampleDescVec[n]->Volume=s; } - void SetPitch(int n, float s) { m_SampleDescVec[n]->PitchMod=s; } - void SetLoop(int n, bool s) { m_SampleDescVec[n]->Loop=s; } - void SetPingPong(int n, bool s){ m_SampleDescVec[n]->PingPong=s; } - void SetNote(int n, int s) { m_SampleDescVec[n]->Note=s; } - void SetOctave(int n, int s) { m_SampleDescVec[n]->Octave=s-6; } - - void SetPlayStart(int n, long s) { m_SampleDescVec[n]->PlayStart=s; } - void SetLoopStart(int n, long s) { m_SampleDescVec[n]->LoopStart=s; } - void SetLoopEnd(int n, long s) { m_SampleDescVec[n]->LoopEnd=s; } - void SetRecord(bool s) { m_Recording=s; } - - void Cut(int n, long s, long e); - void Copy(int n, long s, long e); - void Paste(int n, long s, long e); - void Mix(int n, long s, long e); - void Crop(int n, long s, long e); - void Reverse(int n, long s, long e); - void Amp(int n, long s, long e); - - int m_Current; - - GUIArgs m_GUIArgs; - - Sample m_CopyBuffer; - bool m_Recording; - - char m_SampleBuffer[TRANSBUF_SIZE]; - long m_SampleSize; - - long m_CurrentPlayPos; +class PoshSamplerPlugin : public SpiralPlugin { + public: + PoshSamplerPlugin(); + virtual ~PoshSamplerPlugin(); + virtual PluginInfo &Initialise (const HostInfo *Host); + virtual SpiralGUIType *CreateGUI(); + virtual void Execute(); + virtual void Reset(); + virtual void ExecuteCommands(); + virtual void StreamOut (std::ostream &s); + virtual void StreamIn (std::istream &s); + virtual bool SaveExternalFiles (const std::string &Dir); + virtual void LoadExternalFiles (const std::string &Dir, int withID=-1); + enum GUICommands {NONE, LOAD, SAVE, SETVOL, SETPITCH, SETLOOP, SETPING, SETNOTE, SETOCT, + SETPLAYPOINTS, SETREC, CUT, COPY, PASTE, CROP, MIX, REV, AMP, SETCURRENT, + GETSAMPLE, SETRETRIG, GETLOOP, GETPING, GETRETRIG, GETVOL, GETPITCH, GETOCT, + GETNOTE}; + struct GUIArgs { + int Num, Int, IntEcho; + float Value, ValEcho; + bool Boole, BoolEcho; + long Start, End, LoopStart; + char Name[256]; + }; + void LoadSample (int n, const std::string &Name); + void SaveSample (int n, const std::string &Name); + Sample* GetSample (int n) { return m_SampleVec[n]; } + float GetVolume (int n) { return m_SampleDescVec[n]->Volume; } + float GetPitch (int n) { return m_SampleDescVec[n]->PitchMod; } + bool GetReTrig (int n) { return m_SampleDescVec[n]->ReTrig; } + bool GetLoop (int n) { return m_SampleDescVec[n]->Loop; } + bool GetPingPong (int n) { return m_SampleDescVec[n]->PingPong; } + int GetNote (int n) { return m_SampleDescVec[n]->Note; } + int GetOctave (int n) { return m_SampleDescVec[n]->Octave+6; } + long GetPlayStart (int n) { return m_SampleDescVec[n]->PlayStart; } + long GetLoopStart (int n) { return m_SampleDescVec[n]->LoopStart; } + long GetLoopEnd (int n) { return m_SampleDescVec[n]->LoopEnd; } + std::vector m_SampleVec; + std::vector m_SampleDescVec; + private: + void InitializeSampleDescription (SampleDesc* NewDesc, int num, int Note); + void Cut (int n, long s, long e); + void Copy (int n, long s, long e); + void Paste (int n, long s, long e); + void Mix (int n, long s, long e); + void Crop (int n, long s, long e); + void Reverse (int n, long s, long e); + void Amp (int n, long s, long e); + int m_Current; + GUIArgs m_GUIArgs; + Sample m_CopyBuffer; + bool m_Recording; + char m_SampleBuffer[TRANSBUF_SIZE]; + long m_SampleSize, m_CurrentPlayPos; + float m_InitialPitch[NUM_SAMPLES]; }; #endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPlugin.pro spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPlugin.pro --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPlugin.pro 2002-07-28 23:18:17.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPlugin.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -HEADERS = ../SpiralPlugin.h \ - ../SpiralPluginGUI.h \ - ../Widgets/Fl_Knob.H \ - ../Widgets/Fl_DragBar.H \ - ../../Sample.h \ - ../../RiffWav.h \ - PoshSamplerPlugin.h \ - PoshSamplerPluginGUI.h - -SOURCES = ../SpiralPlugin.C \ - ../SpiralPluginGUI.C \ - ../Widgets/Fl_Knob.cxx \ - ../Widgets/Fl_DragBar.cxx \ - ../../Sample.C \ - ../../RiffWav.C \ - PoshSamplerPlugin.C \ - PoshSamplerPluginGUI.C - -TARGET = PoshSamplerPlugin.so diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/RingModPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/RingModPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/RingModPlugin/Makefile.in 2004-01-17 10:32:43.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/RingModPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -15,9 +15,6 @@ MOC = moc UIC = -TAR = tar -cf -GZIP = gzip -9f - INSTALL = @INSTALL@ ###### Autoconf variables @@ -99,13 +96,6 @@ moc: $(SRCMOC) -tmake: - tmake RingModPlugin.pro - -dist: - $(TAR) RingModPlugin.tar RingModPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) RingModPlugin.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/RingModPlugin/RingModPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/RingModPlugin/RingModPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/RingModPlugin/RingModPluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/RingModPlugin/RingModPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -18,6 +18,7 @@ #include "RingModPluginGUI.h" #include +#include using namespace std; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/RingModPlugin/RingModPlugin.pro spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/RingModPlugin/RingModPlugin.pro --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/RingModPlugin/RingModPlugin.pro 2002-07-28 23:18:15.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/RingModPlugin/RingModPlugin.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -HEADERS = ../SpiralPlugin.h \ - ../SpiralPluginGUI.h \ - ../Widgets/Fl_Knob.H \ - ../Widgets/Fl_DragBar.H \ - ../../Sample.h \ - RingModPlugin.h \ - RingModPluginGUI.h - -SOURCES = ../SpiralPlugin.C \ - ../SpiralPluginGUI.C \ - ../Widgets/Fl_Knob.cxx \ - ../Widgets/Fl_DragBar.cxx \ - ../../Sample.C \ - RingModPlugin.C \ - RingModPluginGUI.C - -TARGET = RingModPlugin.so diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SampleHoldPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SampleHoldPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SampleHoldPlugin/Makefile.in 2004-01-17 10:32:43.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SampleHoldPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -13,10 +13,7 @@ LFLAGS = LIBS = @FLTK_LIBS@ MOC = moc -UIC = - -TAR = tar -cf -GZIP = gzip -9f +UIC = INSTALL = @INSTALL@ @@ -96,13 +93,6 @@ moc: $(SRCMOC) -tmake: - tmake SampleHoldPlugin.pro - -dist: - $(TAR) SampleHoldPlugin.tar SampleHoldPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) SampleHoldPlugin.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SampleHoldPlugin/SampleHoldPlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SampleHoldPlugin/SampleHoldPlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SampleHoldPlugin/SampleHoldPlugin.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SampleHoldPlugin/SampleHoldPlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -75,6 +75,13 @@ return NULL; } +void SampleHoldPlugin::Reset() +{ + ResetPorts(); + m_val = 0; + m_flag = 0; +} + void SampleHoldPlugin::Execute() { // Just copy the data through. diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SampleHoldPlugin/SampleHoldPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SampleHoldPlugin/SampleHoldPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SampleHoldPlugin/SampleHoldPluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SampleHoldPlugin/SampleHoldPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -18,6 +18,7 @@ #include "SampleHoldPluginGUI.h" #include +#include using namespace std; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SampleHoldPlugin/SampleHoldPlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SampleHoldPlugin/SampleHoldPlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SampleHoldPlugin/SampleHoldPlugin.h 2003-08-08 17:55:51.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SampleHoldPlugin/SampleHoldPlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -31,6 +31,8 @@ virtual PluginInfo& Initialise(const HostInfo *Host); virtual SpiralGUIType* CreateGUI(); virtual void Execute(); + virtual void Reset(); + virtual void StreamOut(std::ostream &s) {} virtual void StreamIn(std::istream &s) {} diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SampleHoldPlugin/SampleHoldPlugin.pro spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SampleHoldPlugin/SampleHoldPlugin.pro --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SampleHoldPlugin/SampleHoldPlugin.pro 2002-07-28 23:18:17.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SampleHoldPlugin/SampleHoldPlugin.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -HEADERS = ../SpiralPlugin.h \ - ../SpiralPluginGUI.h \ - ../Widgets/Fl_Knob.H \ - ../Widgets/Fl_DragBar.H \ - ../../Sample.h \ - SampleHoldPlugin.h \ - SampleHoldPluginGUI.h - -SOURCES = ../SpiralPlugin.C \ - ../SpiralPluginGUI.C \ - ../Widgets/Fl_Knob.cxx \ - ../Widgets/Fl_DragBar.cxx \ - ../../Sample.C \ - SampleHoldPlugin.C \ - SampleHoldPluginGUI.C - -TARGET = SampleHoldPlugin.so diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SamplerPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SamplerPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SamplerPlugin/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SamplerPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,163 @@ +############################################################################# +# Makefile for building SamplerPlugin.so +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ @FLTK_CFLAGS@ +CXXFLAGS= @CXXFLAGS@ @FLTK_CXXFLAGS@ +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = @FLTK_LIBS@ +MOC = moc +UIC = + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = SamplerPlugin.h \ + SamplerPluginGUI.h \ + ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../../ChannelHandler.h \ + ../../Sample.h \ + ../../RiffWav.h \ + ../Widgets/Fl_Knob.H \ + ../../../GUI/Widgets/SpiralGUI.H +SOURCES = SamplerPlugin.C \ + SamplerPluginGUI.C \ + ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../../ChannelHandler.C \ + ../../Sample.C \ + ../../RiffWav.C \ + ../Widgets/Fl_Knob.cxx \ + ../../../GUI/Widgets/SpiralGUI.C +OBJECTS = SamplerPlugin.o \ + SamplerPluginGUI.o \ + ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../../ChannelHandler.o \ + ../../Sample.o \ + ../../RiffWav.o \ + ../Widgets/Fl_Knob.o \ + ../../../GUI/Widgets/SpiralGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = SamplerPlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../ChannelHandler.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../SpiralPlugin.h \ + ../../ChannelHandler.h \ + ../../../GUI/Widgets/SpiralGUI.H + +../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_Knob.H + +../../../GUI/Widgets/SpiralGUI.o: ../../../GUI/Widgets/SpiralGUI.C \ + ../../../GUI/Widgets/SpiralGUI.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h + +../../RiffWav.o: ../../RiffWav.C \ + ../../RiffWav.h \ + ../../Sample.h + +SamplerPlugin.o: SamplerPlugin.C \ + SamplerPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../Sample.h \ + SamplerPluginGUI.h \ + ../SpiralPluginGUI.h \ + SpiralIcon.xpm \ + ../../RiffWav.h \ + ../../NoteTable.h + +SamplerPluginGUI.o: SamplerPluginGUI.C \ + SamplerPluginGUI.h \ + SamplerPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../Sample.h \ + ../SpiralPluginGUI.h \ + ../../../GUI/Widgets/SpiralGUI.H \ + ../Widgets/Fl_Knob.H + +../../ChannelHandler.o: ../../ChannelHandler.C \ + ../../ChannelHandler.h diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SamplerPlugin/SamplerPlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SamplerPlugin/SamplerPlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SamplerPlugin/SamplerPlugin.C 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SamplerPlugin/SamplerPlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,293 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include "SamplerPlugin.h" +#include "SamplerPluginGUI.h" +#include +#include "SpiralIcon.xpm" +#include "../../RiffWav.h" +#include "../../NoteTable.h" + +using namespace std; + +static const int NOTETRIG = NUM_SAMPLES*2+1; + +extern "C" { +SpiralPlugin* SpiralPlugin_CreateInstance() +{ + return new SamplerPlugin; +} + +char** SpiralPlugin_GetIcon() +{ + return SpiralIcon_xpm; +} + +int SpiralPlugin_GetID() +{ + return 0x0010; +} + +string SpiralPlugin_GetGroupName() +{ + return "Delay/Sampling"; +} +} + +/////////////////////////////////////////////////////// + +SamplerPlugin::SamplerPlugin() +{ + m_PluginInfo.Name="Sampler"; + m_PluginInfo.Width=245; + m_PluginInfo.Height=420; + m_PluginInfo.NumInputs=18; + m_PluginInfo.NumOutputs=9; + m_PluginInfo.PortTips.push_back("Sample 1 Pitch"); + m_PluginInfo.PortTips.push_back("Sample 1 Trigger"); + m_PluginInfo.PortTips.push_back("Sample 2 Pitch"); + m_PluginInfo.PortTips.push_back("Sample 2 Trigger"); + m_PluginInfo.PortTips.push_back("Sample 3 Pitch"); + m_PluginInfo.PortTips.push_back("Sample 3 Trigger"); + m_PluginInfo.PortTips.push_back("Sample 4 Pitch"); + m_PluginInfo.PortTips.push_back("Sample 4 Trigger"); + m_PluginInfo.PortTips.push_back("Sample 5 Pitch"); + m_PluginInfo.PortTips.push_back("Sample 5 Trigger"); + m_PluginInfo.PortTips.push_back("Sample 6 Pitch"); + m_PluginInfo.PortTips.push_back("Sample 6 Trigger"); + m_PluginInfo.PortTips.push_back("Sample 7 Pitch"); + m_PluginInfo.PortTips.push_back("Sample 7 Trigger"); + m_PluginInfo.PortTips.push_back("Sample 8 Pitch"); + m_PluginInfo.PortTips.push_back("Sample 8 Trigger"); + m_PluginInfo.PortTips.push_back("Input"); + m_PluginInfo.PortTips.push_back("Sample trigger pitch"); + m_PluginInfo.PortTips.push_back("Mixed Output"); + m_PluginInfo.PortTips.push_back("Sample 1 Output"); + m_PluginInfo.PortTips.push_back("Sample 2 Output"); + m_PluginInfo.PortTips.push_back("Sample 3 Output"); + m_PluginInfo.PortTips.push_back("Sample 4 Output"); + m_PluginInfo.PortTips.push_back("Sample 5 Output"); + m_PluginInfo.PortTips.push_back("Sample 6 Output"); + m_PluginInfo.PortTips.push_back("Sample 7 Output"); + m_PluginInfo.PortTips.push_back("Sample 8 Output"); + + for (int n=0; nVolume = 1.0f; + NewDesc->Pitch = 1.0f; + NewDesc->PitchMod = 1.0f; + NewDesc->SamplePos = -1; + NewDesc->Loop = false; + NewDesc->Note = n; + NewDesc->Pathname = "None"; + NewDesc->TriggerUp = true; + NewDesc->SampleRate = 44100; + NewDesc->Stereo = false; + + m_SampleDescVec.push_back(NewDesc); + } + + m_Version=2; +} + +SamplerPlugin::~SamplerPlugin() +{ + for (vector::iterator i=m_SampleVec.begin(); + i!=m_SampleVec.end(); i++) + { + delete(*i); + } + + for (vector::iterator i=m_SampleDescVec.begin(); + i!=m_SampleDescVec.end(); i++) + { + delete(*i); + } +} + +PluginInfo &SamplerPlugin::Initialise(const HostInfo *Host) +{ + return SpiralPlugin::Initialise(Host);; +} + +SpiralGUIType *SamplerPlugin::CreateGUI() +{ + m_GUI = new SamplerPluginGUI(m_PluginInfo.Width, + m_PluginInfo.Height, + this,m_HostInfo); + m_GUI->hide(); + return m_GUI; +} + +void SamplerPlugin::Execute() +{ + for (int s=0; sZero(); + } + + float Freq=0; + + for (int n=0; nBUFSIZE; n++) + { + Freq=GetInputPitch(NOTETRIG,n); + + for (int s=0; sGetLength()) + { + // Convert the CV input into a useable trigger + + if (GetInput(s*2+1,n)>0 || feq(Freq,NoteTable[S->Note],0.01f)) + { + if (S->TriggerUp) + { + S->SamplePos=0; + S->TriggerUp=false; + + if (InputExists(s*2)) + { + // Get the pitch from the CV + float PlayFreq=GetInputPitch(s*2,n); + + // assumtion: base frequency = 440 (middle A) + S->Pitch = PlayFreq/440; + S->Pitch *= S->SampleRate/(float)m_HostInfo->SAMPLERATE; + + // sort of legacy + if (S->Stereo) S->Pitch/=2; + } + } + } + else + { + S->TriggerUp=true; + + // end it if it's looping + if (S->Loop) + { + S->SamplePos=-1; + } + } + + // if the sample has ended + if (S->SamplePos>=m_SampleVec[s]->GetLength()) + { + if (S->Loop) S->SamplePos=0; + else + { + S->SamplePos=-1; + } + } + + if (S->SamplePos!=-1) + { + // mix the sample to the output. + MixOutput(0,n,(*m_SampleVec[s])[S->SamplePos]*S->Volume); + // copy the sample to it's individual output. + SetOutput(s+1,n,((*m_SampleVec[s])[S->SamplePos]*S->Volume)); + + S->SamplePos+=S->Pitch*S->PitchMod; + } + } + } + } +} + +void SamplerPlugin::StreamOut(ostream &s) +{ + s<1) + { + for (int n=0; nVolume<<" "<< + m_SampleDescVec[n]->PitchMod<<" "<< + m_SampleDescVec[n]->Pathname.size()<<" "<< + m_SampleDescVec[n]->Pathname<<" "<< + m_SampleDescVec[n]->Note<Volume<<" "<< + m_SampleDescVec[n]->PitchMod<<" "<< + m_SampleDescVec[n]->Pathname<<" "<< + m_SampleDescVec[n]->Note<>version; + if (version>1) + { + char Buf[4096]; + + for (int n=0; n>m_SampleDescVec[n]->Volume>> + m_SampleDescVec[n]->PitchMod; + + int size; + s>>size; + s.ignore(1); + s.get(Buf,size+1); + m_SampleDescVec[n]->Pathname=Buf; + + s>>m_SampleDescVec[n]->Note; + if (m_SampleDescVec[n]->Pathname!="None") LoadSample(n, m_SampleDescVec[n]->Pathname); + } + } + else + { + for (int n=0; n>m_SampleDescVec[n]->Volume>> + m_SampleDescVec[n]->PitchMod>> + m_SampleDescVec[n]->Pathname>> + m_SampleDescVec[n]->Note; + if (m_SampleDescVec[n]->Pathname!="None") LoadSample(n, m_SampleDescVec[n]->Pathname); + } + } +} + +void SamplerPlugin::LoadSample(int n, const string &Name) +{ + WavFile Wav; + if (Wav.Open(Name,WavFile::READ)) + { + m_SampleVec[n]->Allocate(Wav.GetSize()); + Wav.Load(*m_SampleVec[n]); + m_SampleDescVec[n]->Pathname=Name; + m_SampleDescVec[n]->SampleRate=Wav.GetSamplerate(); + m_SampleDescVec[n]->Stereo=Wav.IsStereo(); + m_SampleDescVec[n]->Pitch *= m_SampleDescVec[n]->SampleRate/(float)m_HostInfo->SAMPLERATE; + } +} diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SamplerPlugin/SamplerPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SamplerPlugin/SamplerPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SamplerPlugin/SamplerPluginGUI.C 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SamplerPlugin/SamplerPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,122 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "SamplerPluginGUI.h" +#include +#include +#include + +using namespace std; + +//////////////////////////////////////////// + +SamplerPluginGUI::SamplerPluginGUI(int w, int h,SamplerPlugin *o,const HostInfo *Info) : +SpiralPluginGUI(w,h,o) +{ + m_Plugin=o; + + for (int n=0; nlabelsize(10); + m_Load[n]->callback((Fl_Callback*)cb_Load,(void*)&Numbers[n]); + add(m_Load[n]); + + m_Volume[n] = new Fl_Knob(60, 15+n*50, 38, 38, "Volume"); + m_Volume[n]->color(Info->GUI_COLOUR); + m_Volume[n]->type(Fl_Knob::LINELIN); + m_Volume[n]->labelsize(10); + m_Volume[n]->maximum(2); + m_Volume[n]->step(0.001); + m_Volume[n]->value(1); + m_Volume[n]->callback((Fl_Callback*)cb_Volume,(void*)&Numbers[n]); + add(m_Volume[n]); + + m_Pitch[n] = new Fl_Knob(100, 15+n*50, 38, 38, "Pitch"); + m_Pitch[n]->color(Info->GUI_COLOUR); + m_Pitch[n]->type(Fl_Knob::LINELIN); + m_Pitch[n]->labelsize(10); + m_Pitch[n]->maximum(10); + m_Pitch[n]->step(0.001); + m_Pitch[n]->value(1); + m_Pitch[n]->callback((Fl_Callback*)cb_Pitch,(void*)&Numbers[n]); + add(m_Pitch[n]); + + m_Loop[n] = new Fl_Button(140, 20+n*50, 50, 30, "Loop"); + m_Loop[n]->labelsize(10); + m_Loop[n]->type(1); + m_Loop[n]->callback((Fl_Callback*)cb_Loop,(void*)&Numbers[n]); + add(m_Loop[n]); + + m_Note[n] = new Fl_Counter(190, 20+n*50, 50, 30, "Trig Note"); + m_Note[n]->labelsize(10); + m_Note[n]->type(FL_SIMPLE_COUNTER); + m_Note[n]->step(1); + m_Note[n]->value(n); + m_Note[n]->callback((Fl_Callback*)cb_Note,(void*)&Numbers[n]); + add(m_Note[n]); + } + + end(); +} + +void SamplerPluginGUI::UpdateValues() +{ + for (int n=0; nvalue(m_Plugin->GetVolume(n)); + m_Pitch[n]->value(m_Plugin->GetPitch(n)); + m_Note[n]->value(m_Plugin->GetNote(n)); + m_Loop[n]->value(m_Plugin->GetLoop(n)); + } +} + +inline void SamplerPluginGUI::cb_Load_i(Fl_Button* o, void* v) +{ + char *fn=fl_file_chooser("Load a sample", "{*.wav,*.WAV}",NULL); + + if (fn && fn!='\0') + { + m_Plugin->LoadSample(*(int*)v,fn); + } +} +void SamplerPluginGUI::cb_Load(Fl_Button* o, void* v) +{ ((SamplerPluginGUI*)(o->parent()))->cb_Load_i(o,v);} + +inline void SamplerPluginGUI::cb_Volume_i(Fl_Knob* o, void* v) +{ m_Plugin->SetVolume(*(int*)v,o->value()); } +void SamplerPluginGUI::cb_Volume(Fl_Knob* o, void* v) +{ ((SamplerPluginGUI*)(o->parent()))->cb_Volume_i(o,v);} + +inline void SamplerPluginGUI::cb_Pitch_i(Fl_Knob* o, void* v) +{ m_Plugin->SetPitch(*(int*)v,o->value()); } +void SamplerPluginGUI::cb_Pitch(Fl_Knob* o, void* v) +{ ((SamplerPluginGUI*)(o->parent()))->cb_Pitch_i(o,v);} + +inline void SamplerPluginGUI::cb_Loop_i(Fl_Button* o, void* v) +{ m_Plugin->SetLoop(*(int*)v,o->value()); } +void SamplerPluginGUI::cb_Loop(Fl_Button* o, void* v) +{ ((SamplerPluginGUI*)(o->parent()))->cb_Loop_i(o,v);} + +inline void SamplerPluginGUI::cb_Note_i(Fl_Counter* o, void* v) +{ m_Plugin->SetNote(*(int*)v,(int)o->value()); } +void SamplerPluginGUI::cb_Note(Fl_Counter* o, void* v) +{ ((SamplerPluginGUI*)(o->parent()))->cb_Note_i(o,v);} + diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SamplerPlugin/SamplerPluginGUI.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SamplerPlugin/SamplerPluginGUI.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SamplerPlugin/SamplerPluginGUI.h 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SamplerPlugin/SamplerPluginGUI.h 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,65 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include + +#include "SamplerPlugin.h" +#include "../SpiralPluginGUI.h" +#include "../Widgets/Fl_Knob.H" + +#ifndef MixerGUI +#define MixerGUI + + +class SamplerPluginGUI : public SpiralPluginGUI +{ +public: + SamplerPluginGUI(int w, int h, SamplerPlugin *o,const HostInfo *Info); + + virtual void UpdateValues(); + virtual SpiralPlugin* GetPlugin() { return m_Plugin; } + + SamplerPlugin *m_Plugin; +private: + + int Numbers[NUM_SAMPLES]; + + Fl_Button* m_Load[NUM_SAMPLES]; + Fl_Knob* m_Volume[NUM_SAMPLES]; + Fl_Knob* m_Pitch[NUM_SAMPLES]; + Fl_Button* m_Loop[NUM_SAMPLES]; + Fl_Counter* m_Note[NUM_SAMPLES]; + + //// Callbacks //// + inline void cb_Load_i(Fl_Button* o, void* v); + static void cb_Load(Fl_Button* o, void* v); + inline void cb_Volume_i(Fl_Knob* o, void* v); + static void cb_Volume(Fl_Knob* o, void* v); + inline void cb_Pitch_i(Fl_Knob* o, void* v); + static void cb_Pitch(Fl_Knob* o, void* v); + inline void cb_Loop_i(Fl_Button* o, void* v); + static void cb_Loop(Fl_Button* o, void* v); + inline void cb_Note_i(Fl_Counter* o, void* v); + static void cb_Note(Fl_Counter* o, void* v); + +}; + +#endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SamplerPlugin/SamplerPlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SamplerPlugin/SamplerPlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SamplerPlugin/SamplerPlugin.h 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SamplerPlugin/SamplerPlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,73 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../SpiralPlugin.h" +#include + +#ifndef SamplerPLUGIN +#define SamplerPLUGIN + +static const int NUM_SAMPLES = 8; + +struct SampleDesc +{ + std::string Pathname; + float Volume; + float Pitch; + float PitchMod; + bool Loop; + int Note; + bool TriggerUp; + float SamplePos; + int SampleRate; + bool Stereo; +}; + +class SamplerPlugin : public SpiralPlugin +{ +public: + SamplerPlugin(); + virtual ~SamplerPlugin(); + + virtual PluginInfo &Initialise(const HostInfo *Host); + virtual SpiralGUIType *CreateGUI(); + virtual void Execute(); + virtual void StreamOut(std::ostream &s); + virtual void StreamIn(std::istream &s); + + // has to be defined in the plugin + virtual void UpdateGUI() { Fl::check(); } + + void LoadSample(int n, const std::string &Name); + + void SetVolume(int n, float s) { m_SampleDescVec[n]->Volume=s; } + float GetVolume(int n) { return m_SampleDescVec[n]->Volume; } + void SetPitch(int n, float s) { m_SampleDescVec[n]->PitchMod=s; } + float GetPitch(int n) { return m_SampleDescVec[n]->PitchMod; } + void SetLoop(int n, bool s) { m_SampleDescVec[n]->Loop=s; } + bool GetLoop(int n) { return m_SampleDescVec[n]->Loop; } + void SetNote(int n, int s) { m_SampleDescVec[n]->Note=s; } + int GetNote(int n) { return m_SampleDescVec[n]->Note; } + + std::vector m_SampleVec; + std::vector m_SampleDescVec; + +private: +}; + +#endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SamplerPlugin/SpiralIcon.xpm spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SamplerPlugin/SpiralIcon.xpm --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SamplerPlugin/SpiralIcon.xpm 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SamplerPlugin/SpiralIcon.xpm 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,322 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"36 36 283 2", +" c None", +". c #8B889B", +"+ c #9C99AA", +"@ c #ADAAB9", +"# c #837F94", +"$ c #7D7990", +"% c #9995A7", +"& c #67627C", +"* c #CDCBD4", +"= c #FCFCFC", +"- c #D1D0D8", +"; c #FFFFFF", +"> c #F1F1F3", +", c #848095", +"' c #2A2248", +") c #CFCED6", +"! c #68637D", +"~ c #ABA8B6", +"{ c #D5D3DB", +"] c #9490A2", +"^ c #C4C4C4", +"/ c #1D1C1D", +"( c #313134", +"_ c #EEEFEE", +": c #FBFBFB", +"< c #EFEFEF", +"[ c #7B768D", +"} c #464060", +"| c #DEDEE1", +"1 c #CBCACC", +"2 c #EEEEF1", +"3 c #79758C", +"4 c #FBFBFC", +"5 c #A2A2A2", +"6 c #000000", +"7 c #F5F6F5", +"8 c #747474", +"9 c #2A2A2B", +"0 c #403958", +"a c #7D788F", +"b c #C0BEC8", +"c c #BCBAC6", +"d c #BCBAC5", +"e c #625C79", +"f c #2B2932", +"g c #191919", +"h c #CCCCCC", +"i c #807B91", +"j c #3B3556", +"k c #F2F2F4", +"l c #929292", +"m c #0E0E0E", +"n c #BFBFBF", +"o c #111111", +"p c #100E15", +"q c #868689", +"r c #FEFDFE", +"s c #D9D7DE", +"t c #9C98AA", +"u c #FDFCFD", +"v c #DDDDDD", +"w c #575755", +"x c #5E5E5E", +"y c #C4C2CD", +"z c #423C5C", +"A c #F0F0F2", +"B c #939393", +"C c #555555", +"D c #4A4A4A", +"E c #010101", +"F c #282828", +"G c #C2C2C2", +"H c #DBDAE0", +"I c #615C78", +"J c #F6F6F7", +"K c #DADADA", +"L c #545454", +"M c #0F0F0F", +"N c #B8B8B8", +"O c #48445C", +"P c #2B2B2C", +"Q c #181900", +"R c #D3D3D3", +"S c #C1BEC9", +"T c #474060", +"U c #31294D", +"V c #716C85", +"W c #65607A", +"X c #625D78", +"Y c #D5D4DB", +"Z c #F7F7F7", +"` c #8B8B8B", +" . c #161616", +".. c #0A0A0A", +"+. c #151700", +"@. c #1A1B00", +"#. c #060600", +"$. c #191A00", +"%. c #393643", +"&. c #47415F", +"*. c #9692A4", +"=. c #D9D8DE", +"-. c #F7F7F8", +";. c #918DA0", +">. c #B8B5C1", +",. c #D1D1D1", +"'. c #212121", +"). c #282900", +"!. c #030300", +"~. c #070700", +"{. c #020200", +"]. c #727175", +"^. c #FEFEFF", +"/. c #9D99AA", +"(. c #DBD9E0", +"_. c #E9E9E9", +":. c #CBCBCB", +"<. c #E0E0E0", +"[. c #6C6C6C", +"}. c #FEF100", +"|. c #515151", +"1. c #A6A6A7", +"2. c #827E93", +"3. c #615C77", +"4. c #EAEAED", +"5. c #DFDFE1", +"6. c #0C0C0C", +"7. c #191700", +"8. c #1E1D24", +"9. c #9894A7", +"0. c #B1AEBB", +"a. c #69686F", +"b. c #000001", +"c. c #615C76", +"d. c #5F5A75", +"e. c #413E4D", +"f. c #020203", +"g. c #1A1900", +"h. c #1A1A1C", +"i. c #C3C1CB", +"j. c #9D9D9D", +"k. c #202020", +"l. c #383838", +"m. c #4C4C4C", +"n. c #111112", +"o. c #C9C7D0", +"p. c #F1F1F1", +"q. c #F8F8F8", +"r. c #232323", +"s. c #050408", +"t. c #AEACB9", +"u. c #FEFEFE", +"v. c #1D1D1D", +"w. c #B7B5C1", +"x. c #9390A2", +"y. c #BBBBBB", +"z. c #414141", +"A. c #030303", +"B. c #28272A", +"C. c #F4F4F6", +"D. c #605B76", +"E. c #736E86", +"F. c #D8D8D8", +"G. c #727272", +"H. c #101010", +"I. c #848486", +"J. c #CCCBD3", +"K. c #747087", +"L. c #6D6881", +"M. c #1C1C1C", +"N. c #242424", +"O. c #656566", +"P. c #F6F6F6", +"Q. c #E8E6EA", +"R. c #706B84", +"S. c #E3E1E6", +"T. c #474746", +"U. c #151515", +"V. c #C8C8C8", +"W. c #AEAEAE", +"X. c #070707", +"Y. c #010100", +"Z. c #373639", +"`. c #FDFCFE", +" + c #ABA8B7", +".+ c #F1F0F3", +"++ c #6D6980", +"@+ c #0A090E", +"#+ c #95929E", +"$+ c #0A0810", +"%+ c #0D0D0D", +"&+ c #050505", +"*+ c #5B5A5C", +"=+ c #F7F6F7", +"-+ c #F4F3F5", +";+ c #908C9F", +">+ c #C8C6D0", +",+ c #837E96", +"'+ c #86868A", +")+ c #070608", +"!+ c #ECEBEE", +"~+ c #5B5571", +"{+ c #646078", +"]+ c #AFAFB0", +"^+ c #454545", +"/+ c #363636", +"(+ c #7A7A7A", +"_+ c #C8C8C9", +":+ c #212025", +"<+ c #060607", +"[+ c #969699", +"}+ c #FAFAFA", +"|+ c #F8F8F9", +"1+ c #A29EAF", +"2+ c #F7F6F8", +"3+ c #F0F0F1", +"4+ c #B8B7B9", +"5+ c #E4E4E4", +"6+ c #FDFDFD", +"7+ c #A5A2B2", +"8+ c #3B3456", +"9+ c #A8A5B4", +"0+ c #525252", +"a+ c #848387", +"b+ c #CDCDCD", +"c+ c #8D899C", +"d+ c #494262", +"e+ c #68627C", +"f+ c #40395A", +"g+ c #ECECEC", +"h+ c #020202", +"i+ c #B4B5B5", +"j+ c #0B0B0B", +"k+ c #313232", +"l+ c #E3E3E3", +"m+ c #B1AEBC", +"n+ c #BDBBC6", +"o+ c #3C3556", +"p+ c #898599", +"q+ c #EDEDED", +"r+ c #39393A", +"s+ c #040404", +"t+ c #333333", +"u+ c #F5F5F5", +"v+ c #2B2B2B", +"w+ c #2D2A3D", +"x+ c #B6B4C1", +"y+ c #F5F5F6", +"z+ c #605A76", +"A+ c #DAD8DF", +"B+ c #F5F4F6", +"C+ c #615B76", +"D+ c #524D6A", +"E+ c #E4E3E8", +"F+ c #D5D5D5", +"G+ c #1B1B1B", +"H+ c #303030", +"I+ c #AAABAB", +"J+ c #585464", +"K+ c #B0AEBB", +"L+ c #A29FAF", +"M+ c #E9E8E9", +"N+ c #787779", +"O+ c #0F0E15", +"P+ c #2D2D2E", +"Q+ c #595959", +"R+ c #FAFAFB", +"S+ c #807B92", +"T+ c #B0ADBB", +"U+ c #E8E7EB", +"V+ c #3A3258", +"W+ c #E6E5EA", +"X+ c #DFDEE3", +"Y+ c #443E5E", +"Z+ c #BAB8C4", +"`+ c #C1BFCA", +" @ c #E0E0E5", +".@ c #D0CED6", +"+@ c #362F52", +"@@ c #CECCD5", +"#@ c #413A5B", +"$@ c #6A657F", +"%@ c #9793A6", +" ", +" ", +" ", +" . + @ # $ % ", +" & * = * - ; > , ' ; ; ; ) ! ", +" ~ ; ; { ] ; ^ / ( _ ; : < [ ", +" } | 1 2 3 4 5 6 6 7 : 8 9 0 a b ", +" c : d e f g h i j k l 6 m ; n o 6 p q r s ", +" t u ; v w 6 6 x y z A B 6 C ; D E 6 F G ; H ", +" I J ; ; K L 6 6 M N O P E 6 6 6 Q Q M R S T U V W ", +" X Y ; ; ; ; Z ` .6 ..6 6 6 6 6 +.@.#.$.%.&.*.=.-.;. ", +" >.; ; ; ; ; ; = ,.'.).!.6 6 6 ~.{.6 6 6 E ].^.; ; /. ", +" (.; ; _.R h :.<.[.6 6 }.}.6 6 6 6 6 6 6 6 E |.1.4 2. ", +" 3.4.; 5.6.6 6 6 6 6 6 }.6 }.6 6 6 6 6 6 6 6 7.6 8.9. ", +" V @ 0.a.b.6 6 6 6 6 6 }.6 6 }.6 6 6 }.}.6 6 7.6 ", +" c.d.e.6 f.6 6 6 6 6 }.6 6 }.6 6 }.6 g.}.6 6 6 h. ", +" i.; ; j.k.k.l.m.k.6 }.}.}.}.}.}.}.}.}.}.}.}.6 6 n. ", +" o.; ; p.q.; ; ; r.6 6 }.6 6 }.6 6 }.6 6 }.}.6 6 s. ", +" t.; ; ; ; u.; ; v.6 6 }.6 6 }.6 6 }.6 6 6 6 6 6 6 w., ", +" x.; ; u.; : y.z.A.6 }.6 6 6 6 }.}.6 6 6 6 6 6 6 B.u.C.D. ", +" E.; ; ; F.G.H.6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 I.; ; J.K. ", +" L.J ; : M.6 6 6 6 N.6 6 6 6 6 6 6 6 6 6 6 6 6 6 O.P.; ; Q.R. ", +" S.; ; T.6 E 6 U.V.W.X.6 6 6 6 6 6 6 6 Y.6 6 6 6 Z.`.; ; > R. ", +" +; .+++@+6 6 W.u.; #+$+6 6 6 6 6 6 6 6 %+&+6 6 6 *+=+; ; -+;+ ", +" R.>+! ,+'+)+x ; ; !+~+{+]+l ^+6 6 6 /+(+_+:+6 6 6 <+[+}+; ; |+@ ", +" 1+2+3+4+5+6+; 7+8+9+; P.^+6 6 E 0+; ; a+6 6 E 6 o b+; ; = c+ ", +" d+> ; ; ; ; ; ; e+f+; ; g+l.6 6 h+D ; ; i+j+6 6 6 k+l+; ; m+ ", +" > ; ; ; ; n+o+p+; ; q+r+6 6 s+t+; ; u+v+6 6 w+x+; y+3 ", +" z+A+= ; B+C+D+E+; ; F+G+6 6 h+H+; ; ; I+0+J+ ", +" K+4 L+ X ; ; ; M+N+H+O+P+Q+; ; ; u.R+S+ ", +" T+; ; ; ; ; U+V+W+; ; ; ; = X+Y+ ", +" Z+`+ @4 ; ; .@+@@@; ; ; s p+T ", +" #@ $@%@p+ ", +" ", +" ", +" "}; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/ScopePlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/ScopePlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/ScopePlugin/Makefile.in 2004-01-17 10:32:43.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/ScopePlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -13,10 +13,7 @@ LFLAGS = LIBS = @FLTK_LIBS@ MOC = moc -UIC = - -TAR = tar -cf -GZIP = gzip -9f +UIC = INSTALL = @INSTALL@ @@ -99,13 +96,6 @@ moc: $(SRCMOC) -tmake: - tmake ScopePlugin.pro - -dist: - $(TAR) ScopePlugin.tar ScopePlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) ScopePlugin.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/ScopePlugin/ScopePlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/ScopePlugin/ScopePlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/ScopePlugin/ScopePlugin.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/ScopePlugin/ScopePlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -30,13 +30,14 @@ int SpiralPlugin_GetID() { return 0x0001; } -string SpiralPlugin_GetGroupName() { return "Control"; } +string SpiralPlugin_GetGroupName() { return "InputOutput"; } } /////////////////////////////////////////////////////// ScopePlugin::ScopePlugin(): -m_DataReady(false) +m_DataReady(false), +m_DataSize(0) { m_PluginInfo.Name = "Scope"; m_PluginInfo.Width = 260; @@ -46,6 +47,8 @@ m_PluginInfo.PortTips.push_back("Input"); m_PluginInfo.PortTips.push_back("Output"); m_AudioCH->Register ("DataReady", &m_DataReady, ChannelHandler::OUTPUT); + m_AudioCH->Register ("DataSizeChanged", &m_DataSizeChanged, ChannelHandler::OUTPUT); + m_AudioCH->Register ("DataSize", &m_DataSize, ChannelHandler::OUTPUT); } ScopePlugin::~ScopePlugin() @@ -55,8 +58,9 @@ PluginInfo &ScopePlugin::Initialise(const HostInfo *Host) { PluginInfo& Info = SpiralPlugin::Initialise(Host); - m_Data = new float[Host->BUFSIZE]; - m_AudioCH->RegisterData("AudioData",ChannelHandler::OUTPUT,m_Data,Host->BUFSIZE*sizeof(float)); + m_DataSize = m_HostInfo->BUFSIZE; + m_Data = new float[m_DataSize]; + m_AudioCH->RegisterData("AudioData",ChannelHandler::OUTPUT,m_Data,m_DataSize*sizeof(float)); return Info; } @@ -65,12 +69,41 @@ return new ScopePluginGUI(m_PluginInfo.Width, m_PluginInfo.Height, this, m_AudioCH, m_HostInfo); } +void ScopePlugin::Reset() +{ + ResetPorts(); + m_DataReady = false; + delete m_Data; + m_DataSize = m_HostInfo->BUFSIZE; + m_Data = new float[m_DataSize]; + m_DataSizeChanged = true; +} + void ScopePlugin::Execute() { // Just copy the data through. m_DataReady = InputExists (0); if (GetOutputBuf (0)) GetOutputBuf (0)->Zero(); if (m_DataReady) { GetOutputBuf (0)->Mix (*GetInput(0), 0); - memcpy (m_Data, GetInput (0)->GetBuffer (), m_HostInfo->BUFSIZE * sizeof (float)); + memcpy (m_Data, GetInput (0)->GetBuffer (), m_DataSize * sizeof (float)); } } + +void ScopePlugin::ExecuteCommands() +{ + if (m_AudioCH->IsCommandWaiting()) + { + switch (m_AudioCH->GetCommand()) { + case UPDATEDATASIZE : + { + m_AudioCH->ReplaceData("AudioData", m_Data, m_DataSize*sizeof(float)); + m_DataSizeChanged = false; + } + break; + + default: + { + } + } + } +} diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/ScopePlugin/ScopePluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/ScopePlugin/ScopePluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/ScopePlugin/ScopePluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/ScopePlugin/ScopePluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -18,6 +18,7 @@ #include "ScopePluginGUI.h" #include +#include using namespace std; @@ -103,6 +104,16 @@ SpiralGUIType::draw(); const float *data; //cerr<<"getting and drawing..."<GetBool ("DataSizeChanged")) + { + m_GUICH->SetCommand(ScopePlugin::UPDATEDATASIZE); + m_GUICH->Wait(); + + m_BufSize = m_GUICH->GetInt("DataSize"); + delete[] m_Scope->m_Data; + m_Scope->m_Data = new float[m_BufSize]; + } + if (m_GUICH->GetBool ("DataReady")) m_GUICH->GetData ("AudioData", (void*)m_Scope->m_Data); else memset ((void*)m_Scope->m_Data, 0, m_BufSize * sizeof (float)); if (!m_Bypass) m_Scope->redraw(); diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/ScopePlugin/ScopePlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/ScopePlugin/ScopePlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/ScopePlugin/ScopePlugin.h 2004-02-14 08:42:36.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/ScopePlugin/ScopePlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -29,11 +29,17 @@ virtual PluginInfo& Initialise(const HostInfo *Host); virtual SpiralGUIType* CreateGUI(); virtual void Execute(); + virtual void ExecuteCommands(); + virtual void Reset(); virtual void StreamOut(std::ostream &s) {} virtual void StreamIn(std::istream &s) {} + + enum GUICommands{NONE,UPDATEDATASIZE}; private: float *m_Data; bool m_DataReady; + int m_DataSize; + bool m_DataSizeChanged; }; #endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/ScopePlugin/ScopePlugin.pro spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/ScopePlugin/ScopePlugin.pro --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/ScopePlugin/ScopePlugin.pro 2002-07-28 23:18:14.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/ScopePlugin/ScopePlugin.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -HEADERS = ../SpiralPlugin.h \ - ../SpiralPluginGUI.h \ - ../Widgets/Fl_Knob.H \ - ../Widgets/Fl_DragBar.H \ - ../../Sample.h \ - ScopePlugin.h \ - ScopePluginGUI.h - -SOURCES = ../SpiralPlugin.C \ - ../SpiralPluginGUI.C \ - ../Widgets/Fl_Knob.cxx \ - ../Widgets/Fl_DragBar.cxx \ - ../../Sample.C \ - ScopePlugin.C \ - ScopePluginGUI.C - -TARGET = ScopePlugin.so diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SeqPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SeqPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SeqPlugin/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SeqPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,169 @@ +############################################################################# +# Makefile for building SeqPlugin.so +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ @FLTK_CFLAGS@ +CXXFLAGS= @CXXFLAGS@ @FLTK_CXXFLAGS@ +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = @FLTK_LIBS@ +MOC = moc +UIC = + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = SeqPlugin.h \ + SeqPluginGUI.h \ + ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../../ChannelHandler.h \ + ../../Sample.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_EventMap.h \ + ../Widgets/Fl_SEvent.h \ + ../../../GUI/Widgets/SpiralGUI.H +SOURCES = SeqPlugin.C \ + SeqPluginGUI.C \ + ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../../ChannelHandler.C \ + ../../Sample.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_EventMap.C \ + ../Widgets/Fl_SEvent.C \ + ../../../GUI/Widgets/SpiralGUI.C +OBJECTS = SeqPlugin.o \ + SeqPluginGUI.o \ + ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../../ChannelHandler.o \ + ../../Sample.o \ + ../Widgets/Fl_Knob.o \ + ../Widgets/Fl_EventMap.o \ + ../Widgets/Fl_SEvent.o \ + ../../../GUI/Widgets/SpiralGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = SeqPlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../ChannelHandler.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../SpiralPlugin.h \ + ../../ChannelHandler.h \ + ../../../GUI/Widgets/SpiralGUI.H + +../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_Knob.H + +../../../GUI/Widgets/SpiralGUI.o: ../../../GUI/Widgets/SpiralGUI.C \ + ../../../GUI/Widgets/SpiralGUI.H + +../Widgets/Fl_EventMap.o: ../Widgets/Fl_EventMap.C \ + ../Widgets/Fl_EventMap.h \ + ../Widgets/Fl_SEvent.h + +../Widgets/Fl_SEvent.o: ../Widgets/Fl_SEvent.C \ + ../Widgets/Fl_SEvent.h \ + ../Widgets/Fl_EventMap.h + +../../Sample.o: ../../Sample.C \ + ../../Sample.h + +SeqPlugin.o: SeqPlugin.C \ + SeqPlugin.h \ + SeqPluginGUI.h \ + ../SpiralPluginGUI.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + SpiralIcon.xpm \ + ../../NoteTable.h + +SeqPluginGUI.o: SeqPluginGUI.C \ + SeqPluginGUI.h \ + SeqPlugin.h \ + ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../../Sample.h \ + ../Widgets/Fl_EventMap.h \ + ../Widgets/Fl_SEvent.h \ + ../../../GUI/Widgets/SpiralGUI.H \ + ../Widgets/Fl_Knob.H + +../../ChannelHandler.o: ../../ChannelHandler.C \ + ../../ChannelHandler.h diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SeqPlugin/SeqPlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SeqPlugin/SeqPlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SeqPlugin/SeqPlugin.C 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SeqPlugin/SeqPlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,273 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include "SeqPlugin.h" +#include "SeqPluginGUI.h" +#include +#include "SpiralIcon.xpm" +#include "../../NoteTable.h" + +using namespace std; + +// for note on's +static const float TRIGGER_LEV=0.1; + +extern "C" { +SpiralPlugin* SpiralPlugin_CreateInstance() +{ + return new SeqPlugin; +} + +char** SpiralPlugin_GetIcon() +{ + return SpiralIcon_xpm; +} + +int SpiralPlugin_GetID() +{ + return 0x0011; +} + +string SpiralPlugin_GetGroupName() +{ + return "Sequencing"; +} +} + +/////////////////////////////////////////////////////// + +SeqPlugin::SeqPlugin() : +m_Time(0.0f), +m_Length(10.0f), +m_SpeedMod(1.0f), +m_CurrentNoteCV(0), +m_CurrentTriggerCV(0), +m_InNoteDown(false), +m_InNoteID(0), +m_CurrentPattern(0), +m_Triggered(false) +{ + m_Version=2; + + m_PluginInfo.Name="Sequencer"; + m_PluginInfo.Width=540; + m_PluginInfo.Height=290; + m_PluginInfo.NumInputs=4; + m_PluginInfo.NumOutputs=2; + m_PluginInfo.PortTips.push_back("Play Trigger"); + m_PluginInfo.PortTips.push_back("Speed CV"); + m_PluginInfo.PortTips.push_back("Input Pitch CV"); + m_PluginInfo.PortTips.push_back("Input Trigger CV"); + m_PluginInfo.PortTips.push_back("Output Pitch"); + m_PluginInfo.PortTips.push_back("Output Trigger"); +} + +SeqPlugin::~SeqPlugin() +{ +} + +PluginInfo &SeqPlugin::Initialise(const HostInfo *Host) +{ + return SpiralPlugin::Initialise(Host); +} + +SpiralGUIType *SeqPlugin::CreateGUI() +{ + m_GUI = new SeqPluginGUI(m_PluginInfo.Width, + m_PluginInfo.Height, + this,m_HostInfo); + m_GUI->hide(); + return m_GUI; +} + +void SeqPlugin::SetPattern(int s) +{ + m_Eventmap[m_CurrentPattern]->hide(); + m_CurrentPattern=s; + m_Eventmap[m_CurrentPattern]->show(); +} + + +void SeqPlugin::Execute() +{ + float Speed; + + for (int n=0; nBUFSIZE; n++) + { + if (GetInputPitch(0,n)>0) + { + if (!m_Triggered) + { + float Freq=GetInputPitch(0,n); + + // Notes 0 to 16 trigger patterns 0 to 16 + // No other notes catered for + for (int i=0; iSAMPLERATE) * (GetInput(1,n)+1.0f); + else + Speed =1.1025f/m_HostInfo->SAMPLERATE; + + if (!m_InNoteDown) + { + // Check trigger + if (GetInput(3,n)>TRIGGER_LEV) + { + m_InNoteDown=true; + + float Freq=GetInputPitch(2,n); + + int NoteNum=0; + for (int i=0; i<131; i++) + { + if (feq(Freq,NoteTable[i],0.01f)) + { + NoteNum=i; + break; + } + } + + /*cerr<<"note recieved ="<>version; + + switch (version) + { + case 2: + { + s>>m_Time; + s>>m_Length; + s>>m_SpeedMod; + s>>m_Loop; + s>>m_NoteCut; + s>>m_CurrentPattern; + } + // fallthrough + + case 1: + { + for(int n=0; n>*m_Eventmap[n]; + } + } break; + } +} diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SeqPlugin/SeqPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SeqPlugin/SeqPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SeqPlugin/SeqPluginGUI.C 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SeqPlugin/SeqPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,169 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include "SeqPluginGUI.h" +#include +#include +#include + +using namespace std; + +//////////////////////////////////////////// + +SeqPluginGUI::SeqPluginGUI(int w, int h,SeqPlugin *o,const HostInfo *Info) : +SpiralPluginGUI(w,h,o) +{ + m_Plugin=o; + //size_range(10,10); + + m_Scroll = new Fl_Scroll(50, 20, w-57, h-26, ""); + add(m_Scroll); + + for (int n=0; nSetEventMap(n,new Fl_EventMap(0, 0, 1000, 1000, "")); + m_Plugin->GetEventMap(n)->SetType(Fl_EventMap::MELODY_MAP); + m_Scroll->add(m_Plugin->GetEventMap(n)); + m_Plugin->GetEventMap(n)->CreateWindow(); + m_Plugin->GetEventMap(n)->SetUpdateLineClip(0, 18, w, h-38); + m_Plugin->GetEventMap(n)->hide(); + } + + m_Plugin->GetEventMap(0)->show(); + + m_Pattern = new Fl_Counter(5, 20, 40, 20, "Pattern"); + m_Pattern->labelsize(10); + m_Pattern->type(FL_SIMPLE_COUNTER); + m_Pattern->step(1); + m_Pattern->value(0); + m_Pattern->callback((Fl_Callback*)cb_Pattern); + add(m_Pattern); + + m_Length = new Fl_Knob(5, 60, 40, 40, "Length"); + m_Length->color(Info->GUI_COLOUR); + m_Length->type(Fl_Knob::DOTLIN); + m_Length->labelsize(10); + m_Length->maximum(30); + m_Length->step(0.01); + m_Length->value(1.0); + m_Length->callback((Fl_Callback*)cb_Length); + add(m_Length); + + m_Speed = new Fl_Knob(5, 115, 40, 40, "Speed"); + m_Speed->color(Info->GUI_COLOUR); + m_Speed->type(Fl_Knob::DOTLIN); + m_Speed->labelsize(10); + m_Speed->maximum(4); + m_Speed->step(0.01); + m_Speed->value(2.0); + m_Speed->callback((Fl_Callback*)cb_Speed); + add(m_Speed); + + m_Zoom = new Fl_Knob(5,170,40,40,"Zoom"); + m_Zoom->color(Info->GUI_COLOUR); + m_Zoom->type(Fl_Knob::DOTLIN); + m_Zoom->labelsize(10); + m_Zoom->maximum(2); + m_Zoom->step(0.01); + m_Zoom->value(1.0); + m_Zoom->callback((Fl_Callback*)cb_Zoom); + add(m_Zoom); + + m_Update = new Fl_Button(2,225,45,20,"Update"); + m_Update->type(1); + m_Update->labelsize(10); + m_Update->value(1); + m_Update->callback((Fl_Callback*)cb_Update,NULL); + add(m_Update); + + m_NoteCut = new Fl_Button(2,245,45,20,"NoteCut"); + m_NoteCut->type(1); + m_NoteCut->labelsize(10); + m_NoteCut->value(0); + m_NoteCut->callback((Fl_Callback*)cb_NoteCut); + add(m_NoteCut); + + m_Clear = new Fl_Button(2,265,45,20,"Clear"); + m_Clear->type(0); + m_Clear->labelsize(10); + m_Clear->value(0); + m_Clear->callback((Fl_Callback*)cb_Clear); + add(m_Clear); + + end(); +} + +void SeqPluginGUI::UpdateValues() +{ +} + +inline void SeqPluginGUI::cb_Update_i(Fl_Button* o, void* v) +{ + m_Plugin->SetUpdate(o->value()); +} +void SeqPluginGUI::cb_Update(Fl_Button* o, void* v) +{ ((SeqPluginGUI*)(o->parent()))->cb_Update_i(o,v);} + +inline void SeqPluginGUI::cb_NoteCut_i(Fl_Button* o, void* v) +{ + m_Plugin->SetNoteCut(o->value()); +} +void SeqPluginGUI::cb_NoteCut(Fl_Button* o, void* v) +{ ((SeqPluginGUI*)(o->parent()))->cb_NoteCut_i(o,v);} + +inline void SeqPluginGUI::cb_Zoom_i(Fl_Knob* o, void* v) +{ + m_Plugin->SetZoom(o->value()); +} +void SeqPluginGUI::cb_Zoom(Fl_Knob* o, void* v) +{ ((SeqPluginGUI*)(o->parent()))->cb_Zoom_i(o,v);} + + + +inline void SeqPluginGUI::cb_Pattern_i(Fl_Counter* o, void* v) +{ + if (o->value()<0) o->value(0); + if (o->value()>NUM_PATTERNS-1) o->value(NUM_PATTERNS-1); + m_Plugin->SetPattern((int)o->value()); + //UpdateValues(); +} +void SeqPluginGUI::cb_Pattern(Fl_Counter* o, void* v) +{ ((SeqPluginGUI*)(o->parent()))->cb_Pattern_i(o,v);} + +inline void SeqPluginGUI::cb_Length_i(Fl_Knob* o, void* v) +{ + m_Plugin->SetEndTime(o->value()); +} +void SeqPluginGUI::cb_Length(Fl_Knob* o, void* v) +{ ((SeqPluginGUI*)(o->parent()))->cb_Length_i(o,v);} + +inline void SeqPluginGUI::cb_Speed_i(Fl_Knob* o, void* v) +{ + m_Plugin->SetSpeed(o->value()-2.0f); +} +void SeqPluginGUI::cb_Speed(Fl_Knob* o, void* v) +{ ((SeqPluginGUI*)(o->parent()))->cb_Speed_i(o,v);} + +inline void SeqPluginGUI::cb_Clear_i(Fl_Button* o, void* v) +{ + m_Plugin->ClearAll(); +} +void SeqPluginGUI::cb_Clear(Fl_Button* o, void* v) +{ ((SeqPluginGUI*)(o->parent()))->cb_Clear_i(o,v);} + diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SeqPlugin/SeqPluginGUI.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SeqPlugin/SeqPluginGUI.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SeqPlugin/SeqPluginGUI.h 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SeqPlugin/SeqPluginGUI.h 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,73 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include + +#include "SeqPlugin.h" +#include "../SpiralPluginGUI.h" +#include "../Widgets/Fl_Knob.H" +#include "../Widgets/Fl_EventMap.h" + +#ifndef MixerGUI +#define MixerGUI + + +class SeqPluginGUI : public SpiralPluginGUI +{ +public: + SeqPluginGUI(int w, int h, SeqPlugin *o,const HostInfo *Info); + + virtual void UpdateValues(); + virtual SpiralPlugin* GetPlugin() { return m_Plugin; } + + SeqPlugin *m_Plugin; +private: + + Fl_Scroll* m_Scroll; + Fl_Button* m_Update; + Fl_Button* m_NoteCut; + Fl_Knob* m_Zoom; + Fl_Counter* m_Pattern; + Fl_Knob* m_Length; + Fl_Knob* m_Speed; + Fl_Button* m_Clear; + + //// Callbacks //// + inline void cb_Update_i(Fl_Button* o, void* v); + static void cb_Update(Fl_Button* o, void* v); + inline void cb_Zoom_i(Fl_Knob* o, void* v); + static void cb_Zoom(Fl_Knob* o, void* v); + inline void cb_NoteCut_i(Fl_Button* o, void* v); + static void cb_NoteCut(Fl_Button* o, void* v); + inline void cb_Pattern_i(Fl_Counter* o, void* v); + static void cb_Pattern(Fl_Counter* o, void* v); + inline void cb_Length_i(Fl_Knob* o, void* v); + static void cb_Length(Fl_Knob* o, void* v); + inline void cb_Speed_i(Fl_Knob* o, void* v); + static void cb_Speed(Fl_Knob* o, void* v); + inline void cb_Clear_i(Fl_Button* o, void* v); + static void cb_Clear(Fl_Button* o, void* v); +}; + +#endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SeqPlugin/SeqPlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SeqPlugin/SeqPlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SeqPlugin/SeqPlugin.h 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SeqPlugin/SeqPlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,72 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../SpiralPlugin.h" +#include +#include "../Widgets/Fl_EventMap.h" + +#ifndef SeqPLUGIN +#define SeqPLUGIN + +const int NUM_PATTERNS = 16; + +class SeqPlugin : public SpiralPlugin +{ +public: + SeqPlugin(); + virtual ~SeqPlugin(); + + virtual PluginInfo &Initialise(const HostInfo *Host); + virtual SpiralGUIType *CreateGUI(); + virtual void Execute(); + virtual void StreamOut(std::ostream &s); + virtual void StreamIn(std::istream &s); + + // has to be defined in the plugin + virtual void UpdateGUI() { Fl::check(); } + + void SetEventMap(int n, Fl_EventMap* s) { m_Eventmap[n]=s; } + Fl_EventMap* GetEventMap(int n) { return m_Eventmap[n]; } + void SetUpdate(bool s) { m_Eventmap[m_CurrentPattern]->SetUpdate(s); } + void SetZoom(float s) { m_Eventmap[m_CurrentPattern]->SetZoomLevel(s); } + void SetNoteCut(bool s) { m_NoteCut=s; } + bool GetNoteCut() { return m_NoteCut; } + void SetEndTime(float s) { m_Eventmap[m_CurrentPattern]->SetEndTime(s); m_Length=s; } + void SetSpeed(float s) { m_SpeedMod=s; } + void ClearAll() { m_Eventmap[m_CurrentPattern]->RemoveAllEvents(); } + void SetPattern(int s); + int GetCurrentPattern() { return m_CurrentPattern; } + +private: + Fl_EventMap* m_Eventmap[NUM_PATTERNS]; + + float m_Time; + float m_Length; + bool m_Loop; + bool m_NoteCut; + float m_SpeedMod; + float m_CurrentNoteCV; + float m_CurrentTriggerCV; + bool m_InNoteDown; + int m_InNoteID; + float m_InNoteTime; + int m_CurrentPattern; + bool m_Triggered; +}; + +#endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SeqPlugin/SpiralIcon.xpm spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SeqPlugin/SpiralIcon.xpm --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SeqPlugin/SpiralIcon.xpm 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SeqPlugin/SpiralIcon.xpm 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,325 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"36 36 286 2", +" c None", +". c #8B889B", +"+ c #9C99AA", +"@ c #ADAAB9", +"# c #837F94", +"$ c #7D7990", +"% c #9995A7", +"& c #67627C", +"* c #CDCBD4", +"= c #FCFCFC", +"- c #D1D0D8", +"; c #FFFFFF", +"> c #F1F1F3", +", c #848095", +"' c #2A2248", +") c #CFCED6", +"! c #68637D", +"~ c #ABA8B6", +"{ c #D5D3DB", +"] c #9490A2", +"^ c #C4C4C4", +"/ c #1D1C1D", +"( c #313134", +"_ c #EEEFEE", +": c #FBFBFB", +"< c #EFEFEF", +"[ c #7B768D", +"} c #464060", +"| c #DEDEE1", +"1 c #CBCACC", +"2 c #EEEEF1", +"3 c #79758C", +"4 c #FBFBFC", +"5 c #A2A2A2", +"6 c #000000", +"7 c #F5F6F5", +"8 c #747474", +"9 c #2A2A2B", +"0 c #403958", +"a c #7D788F", +"b c #C0BEC8", +"c c #BCBAC6", +"d c #BCBAC5", +"e c #625C79", +"f c #2B2932", +"g c #191919", +"h c #CCCCCC", +"i c #807B91", +"j c #3B3556", +"k c #F2F2F4", +"l c #929292", +"m c #0E0E0E", +"n c #BFBFBF", +"o c #111111", +"p c #100E15", +"q c #868689", +"r c #FEFDFE", +"s c #D9D7DE", +"t c #9C98AA", +"u c #FDFCFD", +"v c #DDDDDD", +"w c #575755", +"x c #5E5E5E", +"y c #C4C2CD", +"z c #423C5C", +"A c #F0F0F2", +"B c #939393", +"C c #555555", +"D c #4A4A4A", +"E c #010101", +"F c #282828", +"G c #C2C2C2", +"H c #DBDAE0", +"I c #615C78", +"J c #F6F6F7", +"K c #DADADA", +"L c #545454", +"M c #0F0F0F", +"N c #B8B8B8", +"O c #48445C", +"P c #2B2B2C", +"Q c #181900", +"R c #D3D3D3", +"S c #C1BEC9", +"T c #474060", +"U c #31294D", +"V c #716C85", +"W c #65607A", +"X c #625D78", +"Y c #D5D4DB", +"Z c #F7F7F7", +"` c #8B8B8B", +" . c #161616", +".. c #0A0A0A", +"+. c #151700", +"@. c #1A1B00", +"#. c #060600", +"$. c #191A00", +"%. c #393643", +"&. c #47415F", +"*. c #9692A4", +"=. c #D9D8DE", +"-. c #F7F7F8", +";. c #918DA0", +">. c #B8B5C1", +",. c #D1D1D1", +"'. c #212121", +"). c #282900", +"!. c #030300", +"~. c #070700", +"{. c #020200", +"]. c #727175", +"^. c #FEFEFF", +"/. c #9D99AA", +"(. c #DBD9E0", +"_. c #E9E9E9", +":. c #CBCBCB", +"<. c #E0E0E0", +"[. c #6C6C6C", +"}. c #FEF100", +"|. c #515151", +"1. c #A6A6A7", +"2. c #827E93", +"3. c #615C77", +"4. c #EAEAED", +"5. c #DFDFE1", +"6. c #0C0C0C", +"7. c #191700", +"8. c #1E1D24", +"9. c #9894A7", +"0. c #B1AEBB", +"a. c #69686F", +"b. c #000001", +"c. c #615C76", +"d. c #5F5A75", +"e. c #413E4D", +"f. c #020203", +"g. c #010100", +"h. c #1A1A1C", +"i. c #C3C1CB", +"j. c #9D9D9D", +"k. c #202020", +"l. c #383838", +"m. c #4C4C4C", +"n. c #1E1C00", +"o. c #111112", +"p. c #C9C7D0", +"q. c #F1F1F1", +"r. c #F8F8F8", +"s. c #232323", +"t. c #050408", +"u. c #AEACB9", +"v. c #FEFEFE", +"w. c #1D1D1D", +"x. c #B7B5C1", +"y. c #9390A2", +"z. c #BBBBBB", +"A. c #414141", +"B. c #030303", +"C. c #28272A", +"D. c #F4F4F6", +"E. c #605B76", +"F. c #736E86", +"G. c #D8D8D8", +"H. c #727272", +"I. c #101010", +"J. c #848486", +"K. c #CCCBD3", +"L. c #747087", +"M. c #6D6881", +"N. c #1C1C1C", +"O. c #242424", +"P. c #212205", +"Q. c #1B1D00", +"R. c #000100", +"S. c #656566", +"T. c #F6F6F6", +"U. c #E8E6EA", +"V. c #706B84", +"W. c #E3E1E6", +"X. c #474746", +"Y. c #151515", +"Z. c #C8C8C8", +"`. c #AEAEAE", +" + c #070707", +".+ c #373639", +"++ c #FDFCFE", +"@+ c #ABA8B7", +"#+ c #F1F0F3", +"$+ c #6D6980", +"%+ c #0A090E", +"&+ c #95929E", +"*+ c #0A0810", +"=+ c #0D0D0D", +"-+ c #050505", +";+ c #5B5A5C", +">+ c #F7F6F7", +",+ c #F4F3F5", +"'+ c #908C9F", +")+ c #C8C6D0", +"!+ c #837E96", +"~+ c #86868A", +"{+ c #070608", +"]+ c #ECEBEE", +"^+ c #5B5571", +"/+ c #646078", +"(+ c #AFAFB0", +"_+ c #454545", +":+ c #363636", +"<+ c #7A7A7A", +"[+ c #C8C8C9", +"}+ c #212025", +"|+ c #060607", +"1+ c #969699", +"2+ c #FAFAFA", +"3+ c #F8F8F9", +"4+ c #A29EAF", +"5+ c #F7F6F8", +"6+ c #F0F0F1", +"7+ c #B8B7B9", +"8+ c #E4E4E4", +"9+ c #FDFDFD", +"0+ c #A5A2B2", +"a+ c #3B3456", +"b+ c #A8A5B4", +"c+ c #525252", +"d+ c #848387", +"e+ c #CDCDCD", +"f+ c #8D899C", +"g+ c #494262", +"h+ c #68627C", +"i+ c #40395A", +"j+ c #ECECEC", +"k+ c #020202", +"l+ c #B4B5B5", +"m+ c #0B0B0B", +"n+ c #313232", +"o+ c #E3E3E3", +"p+ c #B1AEBC", +"q+ c #BDBBC6", +"r+ c #3C3556", +"s+ c #898599", +"t+ c #EDEDED", +"u+ c #39393A", +"v+ c #040404", +"w+ c #333333", +"x+ c #F5F5F5", +"y+ c #2B2B2B", +"z+ c #2D2A3D", +"A+ c #B6B4C1", +"B+ c #F5F5F6", +"C+ c #605A76", +"D+ c #DAD8DF", +"E+ c #F5F4F6", +"F+ c #615B76", +"G+ c #524D6A", +"H+ c #E4E3E8", +"I+ c #D5D5D5", +"J+ c #1B1B1B", +"K+ c #303030", +"L+ c #AAABAB", +"M+ c #585464", +"N+ c #B0AEBB", +"O+ c #A29FAF", +"P+ c #E9E8E9", +"Q+ c #787779", +"R+ c #0F0E15", +"S+ c #2D2D2E", +"T+ c #595959", +"U+ c #FAFAFB", +"V+ c #807B92", +"W+ c #B0ADBB", +"X+ c #E8E7EB", +"Y+ c #3A3258", +"Z+ c #E6E5EA", +"`+ c #DFDEE3", +" @ c #443E5E", +".@ c #BAB8C4", +"+@ c #C1BFCA", +"@@ c #E0E0E5", +"#@ c #D0CED6", +"$@ c #362F52", +"%@ c #CECCD5", +"&@ c #413A5B", +"*@ c #6A657F", +"=@ c #9793A6", +" ", +" ", +" ", +" . + @ # $ % ", +" & * = * - ; > , ' ; ; ; ) ! ", +" ~ ; ; { ] ; ^ / ( _ ; : < [ ", +" } | 1 2 3 4 5 6 6 7 : 8 9 0 a b ", +" c : d e f g h i j k l 6 m ; n o 6 p q r s ", +" t u ; v w 6 6 x y z A B 6 C ; D E 6 F G ; H ", +" I J ; ; K L 6 6 M N O P E 6 6 6 Q Q M R S T U V W ", +" X Y ; ; ; ; Z ` .6 ..6 6 6 6 6 +.@.#.$.%.&.*.=.-.;. ", +" >.; ; ; ; ; ; = ,.'.).!.6 6 6 ~.{.6 6 6 E ].^.; ; /. ", +" (.; ; _.R h :.<.[.6 }.}.}.}.}.}.}.}.}.}.}.E |.1.4 2. ", +" 3.4.; 5.6.6 6 6 6 6 6 }.6 6 6 6 6 6 6 6 6 }.7.6 8.9. ", +" V @ 0.a.b.6 6 6 6 6 {.}.6 6 6 6 }.}.}.6 6 }.6 6 ", +" c.d.e.6 f.6 6 6 6 g.}.}.}.6 6 6 6 6 6 6 }.6 6 h. ", +" i.; ; j.k.k.l.m.k.6 6 }.6 6 6 6 6 n.6 6 6 }.6 6 o. ", +" p.; ; q.r.; ; ; s.6 6 }.6 6 }.}.}.6 6 }.}.}.6 6 t. ", +" u.; ; ; ; v.; ; w.6 6 }.6 6 6 6 6 6 6 6 6 }.6 6 6 x., ", +" y.; ; v.; : z.A.B.6 6 }.6 6 6 6 6 6 6 6 6 }.6 6 C.v.D.E. ", +" F.; ; ; G.H.I.6 6 6 6 }.}.}.}.}.}.}.}.}.}.}.6 6 J.; ; K.L. ", +" M.J ; : N.6 6 6 6 O.P.Q.6 R.6 6 6 6 6 6 6 6 6 6 S.T.; ; U.V. ", +" W.; ; X.6 E 6 Y.Z.`. +6 6 6 6 6 6 6 6 g.6 6 6 6 .+++; ; > V. ", +" @+; #+$+%+6 6 `.v.; &+*+6 6 6 6 6 6 6 6 =+-+6 6 6 ;+>+; ; ,+'+ ", +" V.)+! !+~+{+x ; ; ]+^+/+(+l _+6 6 6 :+<+[+}+6 6 6 |+1+2+; ; 3+@ ", +" 4+5+6+7+8+9+; 0+a+b+; T._+6 6 E c+; ; d+6 6 E 6 o e+; ; = f+ ", +" g+> ; ; ; ; ; ; h+i+; ; j+l.6 6 k+D ; ; l+m+6 6 6 n+o+; ; p+ ", +" > ; ; ; ; q+r+s+; ; t+u+6 6 v+w+; ; x+y+6 6 z+A+; B+3 ", +" C+D+= ; E+F+G+H+; ; I+J+6 6 k+K+; ; ; L+c+M+ ", +" N+4 O+ X ; ; ; P+Q+K+R+S+T+; ; ; v.U+V+ ", +" W+; ; ; ; ; X+Y+Z+; ; ; ; = `+ @ ", +" .@+@@@4 ; ; #@$@%@; ; ; s s+T ", +" &@ *@=@s+ ", +" ", +" ", +" "}; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SeqSelectorPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SeqSelectorPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SeqSelectorPlugin/Makefile.in 2004-01-17 10:32:43.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SeqSelectorPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -14,8 +14,6 @@ LIBS = @FLTK_LIBS@ MOC = moc UIC = -TAR = tar -cf -GZIP = gzip -9f INSTALL = @INSTALL@ @@ -98,13 +96,6 @@ moc: $(SRCMOC) -tmake: - tmake SeqSelectorPlugin.pro - -dist: - $(TAR) SeqSelectorPlugin.tar SeqSelectorPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) SeqSelectorPlugin.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SeqSelectorPlugin/SeqSelectorPlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SeqSelectorPlugin/SeqSelectorPlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SeqSelectorPlugin/SeqSelectorPlugin.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SeqSelectorPlugin/SeqSelectorPlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -90,6 +90,14 @@ this,m_AudioCH,m_HostInfo); } +void SeqSelectorPlugin::Reset() +{ + ResetPorts(); + m_Pos=0; + m_Triggered=false; + m_UseRange=false; +} + void SeqSelectorPlugin::Execute() { for (int n=0; nBUFSIZE; n++) diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SeqSelectorPlugin/SeqSelectorPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SeqSelectorPlugin/SeqSelectorPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SeqSelectorPlugin/SeqSelectorPluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SeqSelectorPlugin/SeqSelectorPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -19,6 +19,7 @@ #include #include "SeqSelectorPluginGUI.h" #include +#include #include using namespace std; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SeqSelectorPlugin/SeqSelectorPlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SeqSelectorPlugin/SeqSelectorPlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SeqSelectorPlugin/SeqSelectorPlugin.h 2003-08-08 17:55:52.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SeqSelectorPlugin/SeqSelectorPlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -33,6 +33,7 @@ virtual PluginInfo &Initialise(const HostInfo *Host); virtual SpiralGUIType *CreateGUI(); virtual void Execute(); + virtual void Reset(); virtual void ExecuteCommands(); virtual void StreamOut(std::ostream &s); virtual void StreamIn(std::istream &s); diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SeqSelectorPlugin/SeqSelectorPlugin.pro spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SeqSelectorPlugin/SeqSelectorPlugin.pro --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SeqSelectorPlugin/SeqSelectorPlugin.pro 2002-07-28 23:18:17.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SeqSelectorPlugin/SeqSelectorPlugin.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -HEADERS = ../SpiralPlugin.h \ - ../SpiralPluginGUI.h \ - ../Widgets/Fl_Knob.H \ - ../Widgets/Fl_DragBar.H \ - ../../Sample.h \ - ../Widgets/Fl_LED_Button.H \ - SeqSelectorPlugin.h \ - SeqSelectorPluginGUI.h - -SOURCES = ../SpiralPlugin.C \ - ../SpiralPluginGUI.C \ - ../Widgets/Fl_Knob.cxx \ - ../Widgets/Fl_DragBar.cxx \ - ../../Sample.C \ - ../Widgets/Fl_LED_Button.cxx \ - SeqSelectorPlugin.C \ - SeqSelectorPluginGUI.C - -TARGET = SeqSelectorPlugin.so diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SequencerPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SequencerPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SequencerPlugin/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SequencerPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,169 @@ +############################################################################# +# Makefile for building SequencerPlugin.so +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ @FLTK_CFLAGS@ +CXXFLAGS= @CXXFLAGS@ @FLTK_CXXFLAGS@ +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = @FLTK_LIBS@ +MOC = moc +UIC = + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = SequencerPlugin.h \ + SequencerPluginGUI.h \ + ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../../ChannelHandler.h \ + ../../Sample.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_EventMap.h \ + ../Widgets/Fl_SEvent.h \ + ../../../GUI/Widgets/SpiralGUI.H +SOURCES = SequencerPlugin.C \ + SequencerPluginGUI.C \ + ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../../ChannelHandler.C \ + ../../Sample.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_EventMap.C \ + ../Widgets/Fl_SEvent.C \ + ../../../GUI/Widgets/SpiralGUI.C +OBJECTS = SequencerPlugin.o \ + SequencerPluginGUI.o \ + ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../../ChannelHandler.o \ + ../../Sample.o \ + ../Widgets/Fl_Knob.o \ + ../Widgets/Fl_EventMap.o \ + ../Widgets/Fl_SEvent.o \ + ../../../GUI/Widgets/SpiralGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = SequencerPlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../ChannelHandler.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../SpiralPlugin.h \ + ../../ChannelHandler.h \ + ../../../GUI/Widgets/SpiralGUI.H + +../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_Knob.H + +../../../GUI/Widgets/SpiralGUI.o: ../../../GUI/Widgets/SpiralGUI.C \ + ../../../GUI/Widgets/SpiralGUI.H + +../Widgets/Fl_EventMap.o: ../Widgets/Fl_EventMap.C \ + ../Widgets/Fl_EventMap.h \ + ../Widgets/Fl_SEvent.h + +../Widgets/Fl_SEvent.o: ../Widgets/Fl_SEvent.C \ + ../Widgets/Fl_SEvent.h \ + ../Widgets/Fl_EventMap.h + +../../Sample.o: ../../Sample.C \ + ../../Sample.h + +SequencerPlugin.o: SequencerPlugin.C \ + SequencerPlugin.h \ + SequencerPluginGUI.h \ + ../SpiralPluginGUI.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../NoteTable.h \ + SpiralIcon.xpm + +SequencerPluginGUI.o: SequencerPluginGUI.C \ + SequencerPluginGUI.h \ + SequencerPlugin.h \ + ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../../Sample.h \ + ../Widgets/Fl_EventMap.h \ + ../Widgets/Fl_SEvent.h \ + ../../../GUI/Widgets/SpiralGUI.H \ + ../Widgets/Fl_Knob.H + +../../ChannelHandler.o: ../../ChannelHandler.C \ + ../../ChannelHandler.h diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SequencerPlugin/SequencerPlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SequencerPlugin/SequencerPlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SequencerPlugin/SequencerPlugin.C 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SequencerPlugin/SequencerPlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,777 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include "SequencerPlugin.h" +#include "SequencerPluginGUI.h" +#include +#include "SpiralIcon.xpm" +#include "../../NoteTable.h" + +using namespace std; + +// for note on's +static const float TRIGGER_LEV=0.1; + +////////////////////////////////////////////////////////////////////////// +// base sequencing stuff + +Note::Note(float t=0, float l=0.1f, int n=0, float v=1.0f) +{ + Time = t; + Length = l; + MidiNote = n; + Vol = v; +} + +Note::~Note() +{ +} + +istream &operator>>(istream &s, Note &o) +{ + int version=1; + string dummy; + s>>version>>dummy>>o.Time>>o.Length>>o.MidiNote>>o.Vol; + + return s; +} + +ostream &operator<<(ostream &s, Note &o) +{ + int version=1; + s<m_NoteMap; + + int c=0; + for (map::const_iterator i = o->m_NoteMap.begin(); + i!=o->m_NoteMap.end(); i++) + { + m_NoteMap[c++]=i->second; + } +} + +void Pattern::AddNote(int ID, float t, float l, int n, float v) +{ + map::iterator i = m_NoteMap.find(ID); + if (i != m_NoteMap.end()) + { + cerr<<"duplicate note "<::iterator i = m_NoteMap.find(ID); + if (i == m_NoteMap.end()) + { + cerr<<"couldn't find note "<::iterator i = m_NoteMap.find(ID); + if (i == m_NoteMap.end()) + { + cerr<<"couldn't find note "<second; +} + +istream &operator>>(istream &s, Pattern &o) +{ + int version=1,Num; + string dummy; + int id=0; + s>>version>>dummy>>Num; + for (int n=0; n>t; + o.m_NoteMap[id++]=t; + } + + return s; +} + +ostream &operator<<(ostream &s, Pattern &o) +{ + int version=1; + s<::iterator i = o.m_NoteMap.begin(); + i!=o.m_NoteMap.end(); i++) + { + s<second; + } + s<>(istream &s, Sequence &o) +{ + int version=1; + string dummy; + s>>version>>dummy>>o.m_StartTime>>o.m_Pattern>>o.m_Colour>>o.m_YPos>>o.m_Length>>o.m_Channel; + + char Buf[4096]; + int size; + s>>size; + s.ignore(1); + s.get(Buf,size+1); + o.m_Name=Buf; + + return s; +} + +ostream &operator<<(ostream &s, Sequence &o) +{ + int version=1; + s<::iterator i = m_SequenceMap.find(ID); + if (i != m_SequenceMap.end()) + { + cerr<<"duplicate sequence "<SetColour(GetSequence(ID)->GetColour()); + s->SetName(GetSequence(ID)->GetName()); + s->SetLength(GetSequence(ID)->GetLength()); + s->SetYPos(GetSequence(ID)->GetYPos()); + s->SetPatternID(GetSequence(ID)->GetPatternID()); + s->SetStartTime(GetSequence(ID)->GetStartTime()); + s->SetChannel(GetSequence(ID)->GetChannel()); +} + +// duplicate the sequence, and copy the pattern to it's own version +void Track::CopySequence(int ID, int nID) +{ + AddSequence(nID); + Sequence *s=GetSequence(nID); + s->SetColour(GetSequence(ID)->GetColour()); + s->SetName(GetSequence(ID)->GetName()); + s->SetLength(GetSequence(ID)->GetLength()); + s->SetYPos(GetSequence(ID)->GetYPos()); + s->SetStartTime(GetSequence(ID)->GetStartTime()); + s->SetChannel(GetSequence(ID)->GetChannel()); + AddPattern(m_NextPatternID); + GetPattern(m_NextPatternID)->Copy(GetPattern(GetSequence(ID)->GetPatternID())); + GetSequence(nID)->SetPatternID(m_NextPatternID); + m_NextPatternID++; +} + +// copy the sequences pattern, so it's got it's own version +void Track::InstanceSequence(int ID) +{ + AddPattern(m_NextPatternID); + GetPattern(m_NextPatternID)->Copy(GetPattern(GetSequence(ID)->GetPatternID())); + GetSequence(ID)->SetPatternID(m_NextPatternID); + m_NextPatternID++; +} + +void Track::RemoveSequence(int ID) +{ + map::iterator i = m_SequenceMap.find(ID); + if (i == m_SequenceMap.end()) + { + cerr<<"couldn't find sequence "<::iterator i = m_SequenceMap.find(ID); + if (i == m_SequenceMap.end()) + { + cerr<<"couldn't find sequence "<second; +} + +void Track::AddNote(int ID, int Sequence, float t, float l, int n, float v) +{ + GetPattern(GetSequence(Sequence)->GetPatternID())->AddNote(ID,t,l,n,v); +} + +void Track::RemoveNote(int ID, int Sequence) +{ + GetPattern(GetSequence(Sequence)->GetPatternID())->RemoveNote(ID); +} + +void Track::ChangeNote(int ID, int Sequence, float t, float l, int n, float v) +{ + Note *note = GetPattern(GetSequence(Sequence)->GetPatternID())->GetNote(ID); + note->Time = t; + note->Length = l; + note->MidiNote = n; + note->Vol = v; +} + +void Track::ReadTrack(float t, int channel, vector &NoteVec) +{ + // for every sequence + for (map::iterator i = m_SequenceMap.begin(); + i!=m_SequenceMap.end(); i++) + { + if (i->second.GetChannel()==channel) + { + Pattern *p=GetPattern(i->second.GetPatternID()); + float SeqTime=i->second.GetStartTime(); + + // for every note in the pattern + for (map::iterator n = p->m_NoteMap.begin(); + n!=p->m_NoteMap.end(); n++) + { + if (n->second.Time+SeqTimesecond.Time+n->second.Length+SeqTime>t) + { + NoteVec.push_back(n->second); + } + } + } + } +} + +//// private ////// + +void Track::AddPattern(int ID) +{ + map::iterator i = m_PatternMap.find(ID); + if (i != m_PatternMap.end()) + { + cerr<<"duplicate pattern "<::iterator i = m_PatternMap.find(ID); + if (i == m_PatternMap.end()) + { + cerr<<"couldn't find pattern "<::iterator i = m_PatternMap.find(ID); + if (i == m_PatternMap.end()) + { + cerr<<"couldn't find pattern "<second; +} + +istream &operator>>(istream &s, Track &o) +{ + int version=1,Num,id=0; + string dummy; + s>>version>>dummy; + + s>>Num; + for (int n=0; n>t; + o.m_PatternMap[id++]=t; + } + s>>Num; + id=0; + for (int n=0; n>t; + o.m_SequenceMap[id++]=t; + + cerr<<"Loaded sequence "<>o.m_NextPatternID; + o.m_NextPatternID=o.m_PatternMap.size(); + return s; +} + +ostream &operator<<(ostream &s, Track &o) +{ + int version=1; + + s<::iterator i = o.m_PatternMap.begin(); + i!=o.m_PatternMap.end(); i++) + { + s<second; + } + + s<::iterator i = o.m_SequenceMap.begin(); + i!=o.m_SequenceMap.end(); i++) + { + s<second; + } + s<Register("ID",&m_GUIArgs.Num); + m_AudioCH->Register("ID2",&m_GUIArgs.Num2); + m_AudioCH->Register("Channel",&m_GUIArgs.Channel); + m_AudioCH->Register("Sequence",&m_GUIArgs.Sequence); + m_AudioCH->Register("Time",&m_GUIArgs.t); + m_AudioCH->Register("Length",&m_GUIArgs.l); + m_AudioCH->Register("Vol",&m_GUIArgs.v); + m_AudioCH->Register("Note",&m_GUIArgs.n); + m_AudioCH->Register("CurrentTime",&m_Time,ChannelHandler::OUTPUT); + m_AudioCH->Register("TotalLength",&m_Length); + m_AudioCH->Register("BeatsPerBar",&m_BeatsPerBar); + m_AudioCH->Register("BarLength",&m_BarLength); + m_AudioCH->RegisterData("Name",ChannelHandler::INPUT,m_GUIArgs.Name,sizeof(m_GUIArgs.Name)); + + // use OUTPUT_REQUEST for these, as we don't have to copy them constantly (and the gui can request them) + m_AudioCH->Register("TransCount",&m_TransferCount,ChannelHandler::OUTPUT_REQUEST); + m_AudioCH->RegisterData("TransNote",ChannelHandler::OUTPUT_REQUEST,&m_Transfer,sizeof(m_Transfer)); +} + +SequencerPlugin::~SequencerPlugin() +{ +} + +PluginInfo &SequencerPlugin::Initialise(const HostInfo *Host) +{ + return SpiralPlugin::Initialise(Host); +} + +SpiralGUIType *SequencerPlugin::CreateGUI() +{ + return new SequencerPluginGUI(m_PluginInfo.Width, + m_PluginInfo.Height, + this,m_AudioCH,m_HostInfo); +} + +void SequencerPlugin::SetPattern(int s) +{ + //m_Eventmap[m_CurrentPattern]->hide(); + m_CurrentPattern=s; + //m_Eventmap[m_CurrentPattern]->show(); +} + + +void SequencerPlugin::Execute() +{ + float Speed; + + for (int n=0; nBUFSIZE; n++) + { + if (GetInputPitch(0,n)>0) + { + if (!m_Triggered) + { + float Freq=GetInputPitch(0,n); + + // Notes 0 to 16 trigger patterns 0 to 16 + // No other notes catered for + for (int i=0; iSAMPLERATE) * (GetInput(1,n)+1.0f); + else + Speed =1.1025f/m_HostInfo->SAMPLERATE; + + if (!m_InNoteDown) + { + // Check trigger + if (GetInput(3,n)>TRIGGER_LEV) + { + m_InNoteDown=true; + + float Freq=GetInputPitch(2,n); + + int NoteNum=0; + for (int i=0; i<131; i++) + { + if (feq(Freq,NoteTable[i],0.01f)) + { + NoteNum=i; + break; + } + } + + /*cerr<<"note recieved ="<Time<<" "<Length<MidiNote]; + m_CurrentTriggerCV[channel]=1; + } + SetOutputPitch(channel*2,n,m_CurrentNoteCV[channel]); + SetOutput(channel*2+1,n,m_CurrentTriggerCV[channel]); + } + + m_Time+=Speed*m_SpeedMod; + + // deal with the beat calculation + if (m_Time>m_NextBeatTime) + { + float BeatTime=m_BarLength/m_BeatsPerBar; + m_NextBeatTime=m_Time+BeatTime; + if (m_BeatLevel!=1.0f) m_BeatLevel=1.0f; + else m_BeatLevel=-1.0f; + + m_BeatCount++; + } + SetOutput(NUM_CHANNELS*2,n,m_BeatLevel); + + if (m_BeatCount>=m_BeatsPerBar) + { + m_BeatCount=0; + m_BarCount++; + } + + if (m_BarCount>=m_Length) + { + m_Time=0; + m_BeatCount=-1; + m_BarCount=0; + m_NextBeatTime=0; + } + + if (m_Time<0) + { + m_Time=m_Length; + } + } +} + +void SequencerPlugin::ExecuteCommands() +{ + if (m_AudioCH->IsCommandWaiting()) + { + switch (m_AudioCH->GetCommand()) + { + case NEW_NOTE : m_Track.AddNote(m_GUIArgs.Num,m_GUIArgs.Sequence,m_GUIArgs.t,m_GUIArgs.l,m_GUIArgs.n,m_GUIArgs.v); break; + case CHG_NOTE : m_Track.ChangeNote(m_GUIArgs.Num,m_GUIArgs.Sequence,m_GUIArgs.t,m_GUIArgs.l,m_GUIArgs.n,m_GUIArgs.v); break; + case REM_NOTE : m_Track.RemoveNote(m_GUIArgs.Num,m_GUIArgs.Sequence); break; + case NEW_SEQ : + { + m_Track.AddSequence(m_GUIArgs.Num); + m_Track.GetSequence(m_GUIArgs.Num)->SetColour(m_GUIArgs.Num2); + m_Track.GetSequence(m_GUIArgs.Num)->SetName(m_GUIArgs.Name); + m_Track.GetSequence(m_GUIArgs.Num)->SetLength(m_GUIArgs.l); + m_Track.GetSequence(m_GUIArgs.Num)->SetYPos(m_GUIArgs.n); + m_Track.GetSequence(m_GUIArgs.Num)->SetChannel(m_GUIArgs.Channel); + } break; + case COPY_SEQ : m_Track.CopySequence(m_GUIArgs.Num,m_GUIArgs.Num2); break; + case INST_SEQ : m_Track.InstanceSequence(m_GUIArgs.Num); break; + case CLONE_SEQ : m_Track.CloneSequence(m_GUIArgs.Num,m_GUIArgs.Num2); break; + case REM_SEQ : m_Track.RemoveSequence(m_GUIArgs.Num); break; + case CHG_SEQ : + { + m_Track.GetSequence(m_GUIArgs.Num)->SetColour(m_GUIArgs.Num2); + m_Track.GetSequence(m_GUIArgs.Num)->SetName(m_GUIArgs.Name); + m_Track.GetSequence(m_GUIArgs.Num)->SetLength(m_GUIArgs.l); + m_Track.GetSequence(m_GUIArgs.Num)->SetYPos(m_GUIArgs.n); + m_Track.GetSequence(m_GUIArgs.Num)->SetChannel(m_GUIArgs.Channel); + m_Track.GetSequence(m_GUIArgs.Num)->SetStartTime(m_GUIArgs.t); + } break; + case GET_PATTERN : + { + // start of transfer + if (m_TransferPattern==-1) + { + m_TransferPattern=m_Track.GetSequence(m_GUIArgs.Num)->GetPatternID(); + m_TransferNote=m_Track.GetPattern(m_TransferPattern)->m_NoteMap.begin(); + m_TransferCount=m_Track.GetPattern(m_TransferPattern)->GetNoteCount(); + + cerr<<"going to transfer "<m_NoteMap.end()) + { + m_TransferPattern=-1; + } + else + { + // copy this note over + m_Transfer.Time = m_TransferNote->second.Time; + m_Transfer.Length = m_TransferNote->second.Length; + m_Transfer.MidiNote = m_TransferNote->second.MidiNote; + m_Transfer.Vol = m_TransferNote->second.Vol; + + m_TransferNote++; + } + } + } break; + default: break; + } + } +} + +void SequencerPlugin::StreamOut(ostream &s) +{ + s<>version; + + switch (version) + { + case 1: + { + s>>m_Time>>m_Length>>m_BarLength>>m_BeatsPerBar; + s>>m_Track; + } break; + } +} diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SequencerPlugin/SequencerPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SequencerPlugin/SequencerPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SequencerPlugin/SequencerPluginGUI.C 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SequencerPlugin/SequencerPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,530 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include "SequencerPluginGUI.h" +#include +#include +#include +#include + +using namespace std; + +//////////////////////////////////////////// + +SequencerPluginGUI::PatternWin::PatternWin(int w,int h,const char* n) : +Fl_Double_Window(w,h,n) +{ + m_Scroll = new Fl_Scroll(0, 0, w, h, ""); + resizable(m_Scroll); + add(m_Scroll); + m_NextNoteID=0; + + m_Melody = new Fl_EventMap(0, 0, 1000, 1000, ""); + m_Melody->SetType(Fl_EventMap::MELODY_MAP); + m_Scroll->add(m_Melody); + m_Scroll->position(0,350); + m_Melody->CreateWindow(); + m_Melody->show(); + + // callbacks for note events + Fl_EventMap::EventCallbacks cb; + cb.cb_NewEvent=(Fl_Callback*)cb_NewNote; + cb.cb_MoveEvent=(Fl_Callback*)cb_MoveNote; + cb.cb_DelEvent=(Fl_Callback*)cb_RemoveNote; + + m_Melody->SetCallbacks(cb); + + end(); +} + +//////////////////////////////////////////// + +SequencerPluginGUI::SequencerPluginGUI(int w, int h,SequencerPlugin *o,ChannelHandler *ch,const HostInfo *Info) : +SpiralPluginGUI(w,h,o,ch) +{ + m_Scroll = new Fl_Scroll(50, 20, w-57, h-26, ""); + add(m_Scroll); + m_ArrangementMap = new Fl_EventMap(0, 0, 1000, 132*10, ""); + // num midi notes * gridsize y ^ + m_ArrangementMap->user_data((void*)this); + m_ArrangementMap->SetType(Fl_EventMap::ARRANGE_MAP); + m_Scroll->add(m_ArrangementMap); + m_Scroll->position(-50,350); + m_ArrangementMap->CreateWindow(); + m_ArrangementMap->SetZoomLevel(3.0f); + m_ArrangementMap->show(); + + // callbacks for sequence events + Fl_EventMap::EventCallbacks cb; + cb.cb_EventDoubleClicked=(Fl_Callback*)cb_ArrangeRM; + cb.cb_MoveEvent=(Fl_Callback*)cb_MoveSequence; + cb.cb_RenameEvent=(Fl_Callback*)cb_Rename; + cb.cb_Recolour=(Fl_Callback*)cb_Recolour; + cb.cb_CopyEvent=(Fl_Callback*)cb_Copy; + cb.cb_DelEvent=(Fl_Callback*)cb_RemoveSequence; + cb.cb_EditEvent=(Fl_Callback*)cb_Edit; + + m_ArrangementMap->SetCallbacks(cb); + + m_Length = new Fl_Input(12, 15, 24, 12, "LengthBars"); + m_Length->color(Info->GUI_COLOUR); + m_Length->labelsize(8); + m_Length->align(FL_ALIGN_BOTTOM|FL_ALIGN_CENTER); + m_Length->textsize(8); + m_Length->value("4"); + m_Length->callback((Fl_Callback*)cb_Length); + add(m_Length); + + m_BeatsPerBar = new Fl_Input(12, 38, 24, 12, "BeatsPerBar"); + m_BeatsPerBar->color(Info->GUI_COLOUR); + m_BeatsPerBar->labelsize(8); + m_BeatsPerBar->align(FL_ALIGN_BOTTOM|FL_ALIGN_CENTER); + m_BeatsPerBar->textsize(8); + m_BeatsPerBar->value("4"); + m_BeatsPerBar->callback((Fl_Callback*)cb_BeatsPerBar); + add(m_BeatsPerBar); + + m_BarLength = new Fl_Knob(5, 60, 40, 40, "BarLength"); + m_BarLength->color(Info->GUI_COLOUR); + m_BarLength->type(Fl_Knob::DOTLIN); + m_BarLength->labelsize(10); + m_BarLength->maximum(10); + m_BarLength->step(0.01); + m_BarLength->value(1.0); + m_BarLength->callback((Fl_Callback*)cb_BarLength); + add(m_BarLength); + + m_Speed = new Fl_Knob(5, 115, 40, 40, "Speed"); + m_Speed->color(Info->GUI_COLOUR); + m_Speed->type(Fl_Knob::DOTLIN); + m_Speed->labelsize(10); + m_Speed->maximum(4); + m_Speed->step(0.01); + m_Speed->value(2.0); + m_Speed->callback((Fl_Callback*)cb_Speed); + add(m_Speed); + + m_Zoom = new Fl_Knob(5,170,40,40,"Zoom"); + m_Zoom->color(Info->GUI_COLOUR); + m_Zoom->type(Fl_Knob::DOTLIN); + m_Zoom->labelsize(10); + m_Zoom->maximum(6); + m_Zoom->step(0.01); + m_Zoom->value(3.0); + m_Zoom->callback((Fl_Callback*)cb_Zoom); + add(m_Zoom); + + m_NewPattern = new Fl_Button(2,225,45,20,"New Pat"); + m_NewPattern->type(0); + m_NewPattern->labelsize(10); + m_NewPattern->callback((Fl_Callback*)cb_NewPattern,NULL); + add(m_NewPattern); + + m_NoteCut = new Fl_Button(2,245,45,20,"NoteCut"); + m_NoteCut->type(1); + m_NoteCut->labelsize(10); + m_NoteCut->value(0); + m_NoteCut->callback((Fl_Callback*)cb_NoteCut); + add(m_NoteCut); + + m_Clear = new Fl_Button(2,265,45,20,"Clear"); + m_Clear->type(0); + m_Clear->labelsize(10); + m_Clear->value(0); + m_Clear->callback((Fl_Callback*)cb_Clear); + add(m_Clear); + + end(); +} + +void SequencerPluginGUI::LoadPatternData(int ID) +{ + Note note(0,1.0f,0,0); + + m_PatternWinMap[ID]->GetEventMap()->RemoveAllEvents(); + + m_GUICH->Wait(); + m_GUICH->Set("ID",ID); + m_GUICH->SetCommand(SequencerPlugin::GET_PATTERN); + m_GUICH->Wait(); + + m_GUICH->RequestChannelAndWait("TransCount"); + int c = m_GUICH->GetInt("TransCount"); + cerr<<"TransCount="<SetCommand(SequencerPlugin::GET_PATTERN); + m_GUICH->RequestChannelAndWait("TransNote"); + m_GUICH->GetData("TransNote",(void*)¬e); + + cerr<<"Adding note "<GetEventMap()->AddEventTime(note.Time,note.MidiNote,note.Length,Fl_SEvent::MELODY,false); + } +} + +void SequencerPluginGUI::UpdateValues(SpiralPlugin *o) +{ + SequencerPlugin *Plugin = (SequencerPlugin *)o; + Track *t = Plugin->GetTrack(); + map *seqmap=t->GetSequenceMap(); + map::iterator pi; + + // for each sequence + for (map::iterator i=seqmap->begin(); + i!=seqmap->end(); i++) + { + int eid = m_ArrangementMap->AddEventTime(i->second.GetStartTime(),i->second.GetYPos(),i->second.GetLength(),Fl_SEvent::NO_TYPE,false); + m_ArrangementMap->GetEvent(eid)->SetName(i->second.GetName()); + m_ArrangementMap->GetEvent(eid)->SetColour(i->second.GetColour()); + m_ArrangementMap->GetEvent(eid)->SetChannel(i->second.GetChannel()); + m_ArrangementMap->GetEvent(eid)->SetLengthTime(i->second.GetLength()); + m_PatternWinMap[eid] = new PatternWin(400,200,m_ArrangementMap->GetEvent(eid)->GetName().c_str()); + + Fl_EventMap *map = m_PatternWinMap[eid]->GetEventMap(); + map->user_data((void*)this); + map->SetID(eid); + + // load the pattern data + Pattern *p = t->GetPattern(i->second.GetPatternID()); + + for (pi=p->m_NoteMap.begin(); + pi!=p->m_NoteMap.end(); pi++) + { + map->AddEventTime(pi->second.Time,pi->second.MidiNote,pi->second.Length,Fl_SEvent::MELODY,false); + } + } + + redraw(); +} + +void SequencerPluginGUI::Update() +{ + float Time=m_GUICH->GetFloat("CurrentTime"); + m_ArrangementMap->SetTime(Time); + + for (map::iterator i=m_PatternWinMap.begin(); + i!=m_PatternWinMap.end(); i++) + { + i->second->GetEventMap()->SetTime(Time); + } +} + +void SequencerPluginGUI::ChangeSequenceHelper(Fl_SEvent *event) +{ + m_GUICH->Set("ID",event->GetID()); + m_GUICH->Set("ID2",event->GetColour()); + char t[256]; + sprintf(t,"%s",event->GetName().c_str()); + m_GUICH->SetData("Name",(void*)t); + m_GUICH->Set("Length",event->GetLengthTime()); + m_GUICH->Set("Note",event->GetGroup()); + m_GUICH->Set("Channel",event->GetChannel()); + m_GUICH->Set("Time",event->GetStartTime()); + m_GUICH->SetCommand(SequencerPlugin::CHG_SEQ); +} + +inline void SequencerPluginGUI::cb_NoteCut_i(Fl_Button* o, void* v) +{ + //m_Plugin->SetNoteCut(o->value()); +} +void SequencerPluginGUI::cb_NoteCut(Fl_Button* o, void* v) +{ ((SequencerPluginGUI*)(o->parent()))->cb_NoteCut_i(o,v);} + +inline void SequencerPluginGUI::cb_Zoom_i(Fl_Knob* o, void* v) +{ + if (o->value()!=0) m_ArrangementMap->SetZoomLevel(o->value()); +} +void SequencerPluginGUI::cb_Zoom(Fl_Knob* o, void* v) +{ ((SequencerPluginGUI*)(o->parent()))->cb_Zoom_i(o,v);} + + + +inline void SequencerPluginGUI::cb_Pattern_i(Fl_Counter* o, void* v) +{ + if (o->value()<0) o->value(0); + if (o->value()>NUM_PATTERNS-1) o->value(NUM_PATTERNS-1); + //m_Plugin->SetPattern((int)o->value()); + //UpdateValues(); +} +void SequencerPluginGUI::cb_Pattern(Fl_Counter* o, void* v) +{ ((SequencerPluginGUI*)(o->parent()))->cb_Pattern_i(o,v);} + +inline void SequencerPluginGUI::cb_Length_i(Fl_Input* o, void* v) +{ + int val=(int)strtod(o->value(),NULL); + if (val<1) o->value("error!"); + else + { + m_GUICH->Set("TotalLength",val); + } +} +void SequencerPluginGUI::cb_Length(Fl_Input* o, void* v) +{ ((SequencerPluginGUI*)(o->parent()))->cb_Length_i(o,v);} + +inline void SequencerPluginGUI::cb_BeatsPerBar_i(Fl_Input* o, void* v) +{ + int val=(int)strtod(o->value(),NULL); + if (val<1) o->value("error!"); + else + { + m_GUICH->Set("BeatsPerBar",val); + m_ArrangementMap->SetBeatsBar(val); + m_ArrangementMap->redraw(); + + for (map::iterator i=m_PatternWinMap.begin(); + i!=m_PatternWinMap.end(); i++) + { + i->second->GetEventMap()->SetBeatsBar(val); + i->second->GetEventMap()->redraw(); + } + } +} +void SequencerPluginGUI::cb_BeatsPerBar(Fl_Input* o, void* v) +{ ((SequencerPluginGUI*)(o->parent()))->cb_BeatsPerBar_i(o,v);} + +inline void SequencerPluginGUI::cb_BarLength_i(Fl_Knob* o, void* v) +{ + if (o->value()!=0) + { + m_GUICH->Set("BarLength",(float)o->value()); + m_ArrangementMap->SetBarLength(o->value()); + m_ArrangementMap->redraw(); + + for (map::iterator i=m_PatternWinMap.begin(); + i!=m_PatternWinMap.end(); i++) + { + i->second->GetEventMap()->SetBarLength(o->value()); + i->second->GetEventMap()->redraw(); + } + + redraw(); + } +} +void SequencerPluginGUI::cb_BarLength(Fl_Knob* o, void* v) +{ ((SequencerPluginGUI*)(o->parent()))->cb_BarLength_i(o,v);} + +inline void SequencerPluginGUI::cb_Speed_i(Fl_Knob* o, void* v) +{ + //m_Plugin->SetSpeed(o->value()-2.0f); +} +void SequencerPluginGUI::cb_Speed(Fl_Knob* o, void* v) +{ ((SequencerPluginGUI*)(o->parent()))->cb_Speed_i(o,v);} + +inline void SequencerPluginGUI::cb_Clear_i(Fl_Button* o, void* v) +{ + //m_Plugin->ClearAll(); +} +void SequencerPluginGUI::cb_Clear(Fl_Button* o, void* v) +{ ((SequencerPluginGUI*)(o->parent()))->cb_Clear_i(o,v);} + +/// sequence callbacks ///////////////////////////////////////////////////////// + +inline void SequencerPluginGUI::cb_NewPattern_i(Fl_Button* o, void* v) +{ + int eid = m_ArrangementMap->AddEventTime(1,50,2,Fl_SEvent::NO_TYPE); + m_ArrangementMap->GetEvent(eid)->SetName("My Pattern"); + m_PatternWinMap[eid] = new PatternWin(400,200,m_ArrangementMap->GetEvent(eid)->GetName().c_str()); + + Fl_EventMap *map = m_PatternWinMap[eid]->GetEventMap(); + Fl_SEvent *event = m_ArrangementMap->GetEvent(eid); + + // setup the stuff needed by the callbacks + map->user_data((void*)this); + map->SetID(eid); + + m_GUICH->Set("ID",eid); + m_GUICH->Set("ID2",event->GetColour()); + char t[256]; + sprintf(t,"%s",event->GetName().c_str()); + m_GUICH->SetData("Name",(void*)t); + m_GUICH->Set("Length",event->GetLengthTime()); + m_GUICH->Set("Channel",event->GetChannel()); + m_GUICH->Set("Note",event->GetGroup()); + m_GUICH->SetCommand(SequencerPlugin::NEW_SEQ); + + redraw(); +} +void SequencerPluginGUI::cb_NewPattern(Fl_Button* o, void* v) +{ ((SequencerPluginGUI*)(o->parent()))->cb_NewPattern_i(o,v);} + +inline void SequencerPluginGUI::cb_Rename_i(Fl_Widget* o, void* v) +{ + Fl_SEvent *event = ((Fl_SEvent*)v); + + const char *name = fl_input("Rename the sequence:", + m_ArrangementMap->GetEvent(event->GetID())->GetName().c_str()); + if (name) m_ArrangementMap->GetEvent(event->GetID())->SetName(name); + + ChangeSequenceHelper(event); + redraw(); +} + +void SequencerPluginGUI::cb_Rename(Fl_Widget* o, void* v) +{ ((SequencerPluginGUI*)(o->parent()->parent()->user_data()))->cb_Rename_i(o,v);} + +inline void SequencerPluginGUI::cb_Recolour_i(Fl_Widget* o, void* v) +{ + Fl_SEvent *event = ((Fl_SEvent*)v); + + unsigned char r=255,g=255,b=255; + if (fl_color_chooser("colour",r,g,b)) + { + fl_color(r,g,b); + Fl_Color col=fl_color(); + m_ArrangementMap->GetEvent(event->GetID())->SetColour(col); + ChangeSequenceHelper(event); + redraw(); + } +} +void SequencerPluginGUI::cb_Recolour(Fl_Widget* o, void* v) +{ ((SequencerPluginGUI*)(o->parent()->parent()->user_data()))->cb_Recolour_i(o,v);} + +inline void SequencerPluginGUI::cb_RemoveSequence_i(Fl_Widget* o, void* v) +{ + Fl_SEvent *event = ((Fl_SEvent*)v); + Fl_EventMap *map = ((Fl_EventMap*)event->parent()); + + event->KillMe(); + map->redraw(); + + m_GUICH->Set("ID",event->GetID()); + m_GUICH->SetCommand(SequencerPlugin::REM_SEQ); +} +void SequencerPluginGUI::cb_RemoveSequence(Fl_Widget* o, void* v) +{ ((SequencerPluginGUI*)(o->parent()->parent()->user_data()))->cb_RemoveSequence_i(o,v);} + +inline void SequencerPluginGUI::cb_Copy_i(Fl_Widget* o, void* v) +{ + Fl_SEvent *event = ((Fl_SEvent*)v); + int NewID = m_ArrangementMap->CopyEvent(event->x()+event->w(),event->y(),event->w(),event->GetID(), event->GetLengthTime()); + + m_PatternWinMap[NewID] = new PatternWin(400,200,m_ArrangementMap->GetEvent(NewID)->GetName().c_str()); + m_PatternWinMap[NewID]->GetEventMap()->user_data((void*)this); + m_PatternWinMap[NewID]->GetEventMap()->SetID(NewID); + + m_GUICH->Set("ID",event->GetID()); + m_GUICH->Set("ID2",NewID); + + m_GUICH->SetCommand(SequencerPlugin::COPY_SEQ); + + LoadPatternData(NewID); +} +void SequencerPluginGUI::cb_Copy(Fl_Widget* o, void* v) +{ ((SequencerPluginGUI*)(o->parent()->parent()->user_data()))->cb_Copy_i(o,v);} + +inline void SequencerPluginGUI::cb_MoveSequence_i(Fl_Widget* o, void* v) +{ + Fl_SEvent *event = ((Fl_SEvent*)o); + m_PatternWinMap[event->GetID()]->GetEventMap()->SetTimeOffset(event->GetStartTime()); + ChangeSequenceHelper(event); +} +void SequencerPluginGUI::cb_MoveSequence(Fl_Widget* o, void* v) +{ ((SequencerPluginGUI*)(o->parent()->user_data()))->cb_MoveSequence_i(o,v);} + +inline void SequencerPluginGUI::cb_ArrangeRM_i(Fl_Button* o, void* v) +{ + int ID=((Fl_SEvent*)o)->GetID(); + + if (m_PatternWinMap[ID]->shown()) m_PatternWinMap[ID]->hide(); + else m_PatternWinMap[ID]->show(); +} +void SequencerPluginGUI::cb_ArrangeRM(Fl_Button* o, void* v) +{ ((SequencerPluginGUI*)(o->parent()->user_data()))->cb_ArrangeRM_i(o,v);} +#include +inline void SequencerPluginGUI::cb_Edit_i(Fl_Widget* o, void* v) +{ + Fl_SEvent *event = ((Fl_SEvent*)v); + + Fl_Double_Window *EditWin = new Fl_Double_Window(100,100,"Properties"); + Fl_Button *exit = new Fl_Button(10,80,80,10,"Exit"); + exit->labelsize(8); + Fl_Counter *channel = new Fl_Counter(5,10,90,20,"Channel"); + channel->labelsize(8); + channel->textsize(8); + channel->type(FL_SIMPLE_COUNTER); + channel->step(1); + channel->value(event->GetChannel()); + EditWin->show(); + while (!exit->value() || !EditWin->shown()) + { + Fl::check(); + usleep(10000); + } + event->SetChannel((int)channel->value()); + ChangeSequenceHelper(event); + redraw(); + + EditWin->hide(); +} +void SequencerPluginGUI::cb_Edit(Fl_Widget* o, void* v) +{ ((SequencerPluginGUI*)(o->parent()->parent()->user_data()))->cb_Edit_i(o,v);} + +/// note callbacks /////////////////////////////////////////////////////////////// + +inline void SequencerPluginGUI::cb_NewNote_i(Fl_Widget* o, void* v) +{ + Fl_SEvent *event = ((Fl_SEvent*)o); + Fl_EventMap *map = ((Fl_EventMap*)o->parent()); + + m_GUICH->Set("ID",event->GetID()); + m_GUICH->Set("Sequence",map->GetID()); + m_GUICH->Set("Time",event->GetStartTime()); + m_GUICH->Set("Length",event->GetLengthTime()); + m_GUICH->Set("Note",event->GetGroup()); + m_GUICH->Set("Vol",1.0f); + + m_GUICH->SetCommand(SequencerPlugin::NEW_NOTE); +} +void SequencerPluginGUI::cb_NewNote(Fl_Widget* o, void* v) +{ ((SequencerPluginGUI*)(o->parent()->user_data()))->cb_NewNote_i(o,v);} + +inline void SequencerPluginGUI::cb_MoveNote_i(Fl_Widget* o, void* v) +{ + Fl_SEvent *event = ((Fl_SEvent*)o); + Fl_EventMap *map = ((Fl_EventMap*)o->parent()); + + m_GUICH->Set("ID",event->GetID()); + m_GUICH->Set("Sequence",map->GetID()); + m_GUICH->Set("Time",event->GetStartTime()); + m_GUICH->Set("Length",event->GetLengthTime()); + m_GUICH->Set("Note",event->GetGroup()); + m_GUICH->Set("Vol",1.0f); + + m_GUICH->SetCommand(SequencerPlugin::CHG_NOTE); +} +void SequencerPluginGUI::cb_MoveNote(Fl_Widget* o, void* v) +{ ((SequencerPluginGUI*)(o->parent()->user_data()))->cb_MoveNote_i(o,v);} + +inline void SequencerPluginGUI::cb_RemoveNote_i(Fl_Widget* o, void* v) +{ + Fl_SEvent *event = ((Fl_SEvent*)v); + Fl_EventMap *map = ((Fl_EventMap*)event->parent()); + + event->KillMe(); + map->redraw(); + + m_GUICH->Set("ID",event->GetID()); + m_GUICH->Set("Sequence",map->GetID()); + m_GUICH->SetCommand(SequencerPlugin::REM_NOTE); +} +void SequencerPluginGUI::cb_RemoveNote(Fl_Widget* o, void* v) +{ ((SequencerPluginGUI*)(o->parent()->parent()->user_data()))->cb_RemoveNote_i(o,v);} + diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SequencerPlugin/SequencerPluginGUI.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SequencerPlugin/SequencerPluginGUI.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SequencerPlugin/SequencerPluginGUI.h 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SequencerPlugin/SequencerPluginGUI.h 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,124 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "SequencerPlugin.h" +#include "../SpiralPluginGUI.h" +#include "../Widgets/Fl_Knob.H" +#include "../Widgets/Fl_EventMap.h" + +#ifndef MixerGUI +#define MixerGUI + + +class SequencerPluginGUI : public SpiralPluginGUI +{ +public: + SequencerPluginGUI(int w, int h, SequencerPlugin *o, ChannelHandler *ch,const HostInfo *Info); + + virtual void UpdateValues(SpiralPlugin *o); + virtual void Update(); + +private: + + Fl_Scroll* m_Scroll; + Fl_Button* m_NewPattern; + Fl_Button* m_NoteCut; + Fl_Knob* m_Zoom; + Fl_Knob* m_Speed; + Fl_Button* m_Clear; + Fl_Input* m_Length; + Fl_Input* m_BeatsPerBar; + Fl_Knob* m_BarLength; + + int m_NextPatternID; + + class PatternWin : public Fl_Double_Window + { + public: + PatternWin(int w,int h,const char* n); + Fl_EventMap *GetEventMap() { return m_Melody; } + + private: + Fl_Scroll* m_Scroll; + Fl_EventMap* m_Melody; + int m_NextNoteID; + }; + + map m_PatternWinMap; + Fl_EventMap* m_ArrangementMap; + + // get the notes from the audio thread + void LoadPatternData(int ID); + + void ChangeSequenceHelper(Fl_SEvent *event); + + //// Callbacks //// + inline void cb_Zoom_i(Fl_Knob* o, void* v); + static void cb_Zoom(Fl_Knob* o, void* v); + inline void cb_NoteCut_i(Fl_Button* o, void* v); + static void cb_NoteCut(Fl_Button* o, void* v); + inline void cb_Pattern_i(Fl_Counter* o, void* v); + static void cb_Pattern(Fl_Counter* o, void* v); + inline void cb_Length_i(Fl_Input* o, void* v); + static void cb_Length(Fl_Input* o, void* v); + inline void cb_BeatsPerBar_i(Fl_Input* o, void* v); + static void cb_BeatsPerBar(Fl_Input* o, void* v); + inline void cb_BarLength_i(Fl_Knob* o, void* v); + static void cb_BarLength(Fl_Knob* o, void* v); + inline void cb_Speed_i(Fl_Knob* o, void* v); + static void cb_Speed(Fl_Knob* o, void* v); + inline void cb_Clear_i(Fl_Button* o, void* v); + static void cb_Clear(Fl_Button* o, void* v); + inline void cb_NewPattern_i(Fl_Button* o, void* v); + static void cb_NewPattern(Fl_Button* o, void* v); + + // sequence event callbacks + inline void cb_ArrangeRM_i(Fl_Button* o, void* v); + static void cb_ArrangeRM(Fl_Button* o, void* v); + inline void cb_MoveSequence_i(Fl_Widget* o, void* v); + static void cb_MoveSequence(Fl_Widget* o, void* v); + inline void cb_Rename_i(Fl_Widget* o, void* v); + static void cb_Rename(Fl_Widget* o, void* v); + inline void cb_Recolour_i(Fl_Widget* o, void* v); + static void cb_Recolour(Fl_Widget* o, void* v); + inline void cb_Copy_i(Fl_Widget* o, void* v); + static void cb_Copy(Fl_Widget* o, void* v); + inline void cb_RemoveSequence_i(Fl_Widget* o, void* v); + static void cb_RemoveSequence(Fl_Widget* o, void* v); + inline void cb_Edit_i(Fl_Widget* o, void* v); + static void cb_Edit(Fl_Widget* o, void* v); + + // note event callbacks + inline void cb_NewNote_i(Fl_Widget* o, void* v); + static void cb_NewNote(Fl_Widget* o, void* v); + inline void cb_MoveNote_i(Fl_Widget* o, void* v); + static void cb_MoveNote(Fl_Widget* o, void* v); + inline void cb_RemoveNote_i(Fl_Widget* o, void* v); + static void cb_RemoveNote(Fl_Widget* o, void* v); +}; + +#endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SequencerPlugin/SequencerPlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SequencerPlugin/SequencerPlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SequencerPlugin/SequencerPlugin.h 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SequencerPlugin/SequencerPlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,221 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../SpiralPlugin.h" +#include +#include "../Widgets/Fl_EventMap.h" +#include + +#ifndef SequencerPLUGIN +#define SequencerPLUGIN + +const int NUM_PATTERNS = 8; +const int NUM_CHANNELS = 8; + +////////////////////////////////////////////////////////////////////////// +// base sequencing stuff + +class Note +{ +public: + Note(float t, float l, int n, float v); + virtual ~Note(); + + float Time; + float Length; + int MidiNote; + float Vol; + + friend std::istream &operator>>(std::istream &s, Note &o); + friend std::ostream &operator<<(std::ostream &s, Note &o); +}; + +std::istream &operator>>(std::istream &s, Note &o); +std::ostream &operator<<(std::ostream &s, Note &o); + +class Pattern +{ +public: + Pattern(); + virtual ~Pattern(); + + void Copy(const Pattern *o); + void AddNote(int ID, float t, float l, int n, float v); + void RemoveNote(int ID); + Note *GetNote(int ID); + int GetNoteCount() { return m_NoteMap.size(); } + + map m_NoteMap; + + friend std::istream &operator>>(std::istream &s, Pattern &o); + friend std::ostream &operator<<(std::ostream &s, Pattern &o); +}; + +std::istream &operator>>(std::istream &s, Pattern &o); +std::ostream &operator<<(std::ostream &s, Pattern &o); + +class Sequence +{ +public: + Sequence(float st=0, int pat=0); + virtual ~Sequence(); + + void SetStartTime(float t) { m_StartTime=t; } + float GetStartTime() { return m_StartTime; } + void SetPatternID(int p) { m_Pattern=p; } + int GetPatternID() { return m_Pattern; } + void SetName(string s) { m_Name=s; } + string GetName() { return m_Name; } + void SetColour(int s) { m_Colour=s; } + int GetColour() { return m_Colour; } + void SetYPos(int s) { m_YPos=s; } + int GetYPos() { return m_YPos; } + void SetLength(float t) { m_Length=t; } + float GetLength() { return m_Length; } + void SetChannel(int s) { m_Channel=s; } + int GetChannel() { return m_Channel; } + +private: + float m_StartTime; + int m_Pattern; + string m_Name; + int m_Colour; + int m_YPos; + float m_Length; + int m_Channel; + + friend std::istream &operator>>(std::istream &s, Sequence &o); + friend std::ostream &operator<<(std::ostream &s, Sequence &o); +}; + +std::istream &operator>>(std::istream &s, Sequence &o); +std::ostream &operator<<(std::ostream &s, Sequence &o); + +class Track +{ +public: + Track(); + virtual ~Track(); + + void AddSequence(int ID); + void CloneSequence(int ID, int nID); + void CopySequence(int ID, int nID); + void InstanceSequence(int ID); + void RemoveSequence(int ID); + Sequence *GetSequence(int ID); + + void AddNote(int ID, int Sequence, float t, float l, int n, float v); + void RemoveNote(int ID, int Sequence); + void ChangeNote(int ID, int Sequence, float t, float l, int n, float v); + void ReadTrack(float t, int channel, vector &NoteVec); + Pattern *GetPattern(int ID); + + map *GetSequenceMap() { return &m_SequenceMap; } + +private: + void AddPattern(int ID); + void RemovePattern(int ID); + + std::map m_PatternMap; + std::map m_SequenceMap; + + int m_NextPatternID; + + friend std::istream &operator>>(std::istream &s, Track &o); + friend std::ostream &operator<<(std::ostream &s, Track &o); +}; + +std::istream &operator>>(std::istream &s, Track &o); +std::ostream &operator<<(std::ostream &s, Track &o); + +/////////////////////////////////////////////////////////////////////////// + +class SequencerPlugin : public SpiralPlugin +{ +public: + SequencerPlugin(); + virtual ~SequencerPlugin(); + + virtual PluginInfo &Initialise(const HostInfo *Host); + virtual SpiralGUIType *CreateGUI(); + virtual void Execute(); + virtual void ExecuteCommands(); + virtual void StreamOut(ostream &s); + virtual void StreamIn(istream &s); + + bool GetNoteCut() { return m_NoteCut; } + void ClearAll() { /*m_Eventmap[m_CurrentPattern]->RemoveAllEvents();*/ } + int GetCurrentPattern() { return m_CurrentPattern; } + Track *GetTrack() { return &m_Track; } + + enum GUICommands {NONE,NEW_NOTE,REM_NOTE,CHG_NOTE,NEW_SEQ,CHG_SEQ,COPY_SEQ, + INST_SEQ,CLONE_SEQ,REM_SEQ,GET_PATTERN}; + + struct GUIArgs + { + int Num,Num2; + int Sequence; + float t,l,v; + int n; + char Name[256]; + int Channel; + }; + +private: + + GUIArgs m_GUIArgs; + + Track m_Track; + + int m_TransferPattern; + //int m_TransferNote; + map::iterator m_TransferNote; + int m_TransferCount; + Note m_Transfer; + + void SetEventMap(int n, Fl_EventMap* s) { /*m_Eventmap[n]=s;*/ } + void SetUpdate(bool s) { /*m_Eventmap[m_CurrentPattern]->SetUpdate(s);*/ } + void SetZoom(float s) { /*m_Eventmap[m_CurrentPattern]->SetZoomLevel(s);*/ } + void SetNoteCut(bool s) { m_NoteCut=s; } + //void SetEndTime(float s) { /*m_Eventmap[m_CurrentPattern]->SetEndTime(s);*/ m_Length=s; } + void SetSpeed(float s) { m_SpeedMod=s; } + void SetPattern(int s); + + float m_Time; + int m_Length; // in bars + float m_BarLength; + int m_BeatsPerBar; + float m_NextBeatTime; + float m_BeatLevel; + int m_BeatCount; + int m_BarCount; + bool m_Loop; + bool m_NoteCut; + float m_SpeedMod; + + float m_CurrentNoteCV[NUM_CHANNELS]; + float m_CurrentTriggerCV[NUM_CHANNELS]; + + bool m_InNoteDown; + int m_InNoteID; + float m_InNoteTime; + int m_CurrentPattern; + bool m_Triggered; +}; + +#endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SequencerPlugin/SpiralIcon.xpm spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SequencerPlugin/SpiralIcon.xpm --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SequencerPlugin/SpiralIcon.xpm 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SequencerPlugin/SpiralIcon.xpm 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,325 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"36 36 286 2", +" c None", +". c #8B889B", +"+ c #9C99AA", +"@ c #ADAAB9", +"# c #837F94", +"$ c #7D7990", +"% c #9995A7", +"& c #67627C", +"* c #CDCBD4", +"= c #FCFCFC", +"- c #D1D0D8", +"; c #FFFFFF", +"> c #F1F1F3", +", c #848095", +"' c #2A2248", +") c #CFCED6", +"! c #68637D", +"~ c #ABA8B6", +"{ c #D5D3DB", +"] c #9490A2", +"^ c #C4C4C4", +"/ c #1D1C1D", +"( c #313134", +"_ c #EEEFEE", +": c #FBFBFB", +"< c #EFEFEF", +"[ c #7B768D", +"} c #464060", +"| c #DEDEE1", +"1 c #CBCACC", +"2 c #EEEEF1", +"3 c #79758C", +"4 c #FBFBFC", +"5 c #A2A2A2", +"6 c #000000", +"7 c #F5F6F5", +"8 c #747474", +"9 c #2A2A2B", +"0 c #403958", +"a c #7D788F", +"b c #C0BEC8", +"c c #BCBAC6", +"d c #BCBAC5", +"e c #625C79", +"f c #2B2932", +"g c #191919", +"h c #CCCCCC", +"i c #807B91", +"j c #3B3556", +"k c #F2F2F4", +"l c #929292", +"m c #0E0E0E", +"n c #BFBFBF", +"o c #111111", +"p c #100E15", +"q c #868689", +"r c #FEFDFE", +"s c #D9D7DE", +"t c #9C98AA", +"u c #FDFCFD", +"v c #DDDDDD", +"w c #575755", +"x c #5E5E5E", +"y c #C4C2CD", +"z c #423C5C", +"A c #F0F0F2", +"B c #939393", +"C c #555555", +"D c #4A4A4A", +"E c #010101", +"F c #282828", +"G c #C2C2C2", +"H c #DBDAE0", +"I c #615C78", +"J c #F6F6F7", +"K c #DADADA", +"L c #545454", +"M c #0F0F0F", +"N c #B8B8B8", +"O c #48445C", +"P c #2B2B2C", +"Q c #181900", +"R c #D3D3D3", +"S c #C1BEC9", +"T c #474060", +"U c #31294D", +"V c #716C85", +"W c #65607A", +"X c #625D78", +"Y c #D5D4DB", +"Z c #F7F7F7", +"` c #8B8B8B", +" . c #161616", +".. c #0A0A0A", +"+. c #151700", +"@. c #1A1B00", +"#. c #060600", +"$. c #191A00", +"%. c #393643", +"&. c #47415F", +"*. c #9692A4", +"=. c #D9D8DE", +"-. c #F7F7F8", +";. c #918DA0", +">. c #B8B5C1", +",. c #D1D1D1", +"'. c #212121", +"). c #282900", +"!. c #030300", +"~. c #070700", +"{. c #020200", +"]. c #727175", +"^. c #FEFEFF", +"/. c #9D99AA", +"(. c #DBD9E0", +"_. c #E9E9E9", +":. c #CBCBCB", +"<. c #E0E0E0", +"[. c #6C6C6C", +"}. c #FEF100", +"|. c #515151", +"1. c #A6A6A7", +"2. c #827E93", +"3. c #615C77", +"4. c #EAEAED", +"5. c #DFDFE1", +"6. c #0C0C0C", +"7. c #191700", +"8. c #1E1D24", +"9. c #9894A7", +"0. c #B1AEBB", +"a. c #69686F", +"b. c #000001", +"c. c #615C76", +"d. c #5F5A75", +"e. c #413E4D", +"f. c #020203", +"g. c #010100", +"h. c #1A1A1C", +"i. c #C3C1CB", +"j. c #9D9D9D", +"k. c #202020", +"l. c #383838", +"m. c #4C4C4C", +"n. c #1E1C00", +"o. c #111112", +"p. c #C9C7D0", +"q. c #F1F1F1", +"r. c #F8F8F8", +"s. c #232323", +"t. c #050408", +"u. c #AEACB9", +"v. c #FEFEFE", +"w. c #1D1D1D", +"x. c #B7B5C1", +"y. c #9390A2", +"z. c #BBBBBB", +"A. c #414141", +"B. c #030303", +"C. c #28272A", +"D. c #F4F4F6", +"E. c #605B76", +"F. c #736E86", +"G. c #D8D8D8", +"H. c #727272", +"I. c #101010", +"J. c #848486", +"K. c #CCCBD3", +"L. c #747087", +"M. c #6D6881", +"N. c #1C1C1C", +"O. c #242424", +"P. c #212205", +"Q. c #1B1D00", +"R. c #000100", +"S. c #656566", +"T. c #F6F6F6", +"U. c #E8E6EA", +"V. c #706B84", +"W. c #E3E1E6", +"X. c #474746", +"Y. c #151515", +"Z. c #C8C8C8", +"`. c #AEAEAE", +" + c #070707", +".+ c #373639", +"++ c #FDFCFE", +"@+ c #ABA8B7", +"#+ c #F1F0F3", +"$+ c #6D6980", +"%+ c #0A090E", +"&+ c #95929E", +"*+ c #0A0810", +"=+ c #0D0D0D", +"-+ c #050505", +";+ c #5B5A5C", +">+ c #F7F6F7", +",+ c #F4F3F5", +"'+ c #908C9F", +")+ c #C8C6D0", +"!+ c #837E96", +"~+ c #86868A", +"{+ c #070608", +"]+ c #ECEBEE", +"^+ c #5B5571", +"/+ c #646078", +"(+ c #AFAFB0", +"_+ c #454545", +":+ c #363636", +"<+ c #7A7A7A", +"[+ c #C8C8C9", +"}+ c #212025", +"|+ c #060607", +"1+ c #969699", +"2+ c #FAFAFA", +"3+ c #F8F8F9", +"4+ c #A29EAF", +"5+ c #F7F6F8", +"6+ c #F0F0F1", +"7+ c #B8B7B9", +"8+ c #E4E4E4", +"9+ c #FDFDFD", +"0+ c #A5A2B2", +"a+ c #3B3456", +"b+ c #A8A5B4", +"c+ c #525252", +"d+ c #848387", +"e+ c #CDCDCD", +"f+ c #8D899C", +"g+ c #494262", +"h+ c #68627C", +"i+ c #40395A", +"j+ c #ECECEC", +"k+ c #020202", +"l+ c #B4B5B5", +"m+ c #0B0B0B", +"n+ c #313232", +"o+ c #E3E3E3", +"p+ c #B1AEBC", +"q+ c #BDBBC6", +"r+ c #3C3556", +"s+ c #898599", +"t+ c #EDEDED", +"u+ c #39393A", +"v+ c #040404", +"w+ c #333333", +"x+ c #F5F5F5", +"y+ c #2B2B2B", +"z+ c #2D2A3D", +"A+ c #B6B4C1", +"B+ c #F5F5F6", +"C+ c #605A76", +"D+ c #DAD8DF", +"E+ c #F5F4F6", +"F+ c #615B76", +"G+ c #524D6A", +"H+ c #E4E3E8", +"I+ c #D5D5D5", +"J+ c #1B1B1B", +"K+ c #303030", +"L+ c #AAABAB", +"M+ c #585464", +"N+ c #B0AEBB", +"O+ c #A29FAF", +"P+ c #E9E8E9", +"Q+ c #787779", +"R+ c #0F0E15", +"S+ c #2D2D2E", +"T+ c #595959", +"U+ c #FAFAFB", +"V+ c #807B92", +"W+ c #B0ADBB", +"X+ c #E8E7EB", +"Y+ c #3A3258", +"Z+ c #E6E5EA", +"`+ c #DFDEE3", +" @ c #443E5E", +".@ c #BAB8C4", +"+@ c #C1BFCA", +"@@ c #E0E0E5", +"#@ c #D0CED6", +"$@ c #362F52", +"%@ c #CECCD5", +"&@ c #413A5B", +"*@ c #6A657F", +"=@ c #9793A6", +" ", +" ", +" ", +" . + @ # $ % ", +" & * = * - ; > , ' ; ; ; ) ! ", +" ~ ; ; { ] ; ^ / ( _ ; : < [ ", +" } | 1 2 3 4 5 6 6 7 : 8 9 0 a b ", +" c : d e f g h i j k l 6 m ; n o 6 p q r s ", +" t u ; v w 6 6 x y z A B 6 C ; D E 6 F G ; H ", +" I J ; ; K L 6 6 M N O P E 6 6 6 Q Q M R S T U V W ", +" X Y ; ; ; ; Z ` .6 ..6 6 6 6 6 +.@.#.$.%.&.*.=.-.;. ", +" >.; ; ; ; ; ; = ,.'.).!.6 6 6 ~.{.6 6 6 E ].^.; ; /. ", +" (.; ; _.R h :.<.[.6 }.}.}.}.}.}.}.}.}.}.}.E |.1.4 2. ", +" 3.4.; 5.6.6 6 6 6 6 6 }.6 6 6 6 6 6 6 6 6 }.7.6 8.9. ", +" V @ 0.a.b.6 6 6 6 6 {.}.6 6 6 6 }.}.}.6 6 }.6 6 ", +" c.d.e.6 f.6 6 6 6 g.}.}.}.6 6 6 6 6 6 6 }.6 6 h. ", +" i.; ; j.k.k.l.m.k.6 6 }.6 6 6 6 6 n.6 6 6 }.6 6 o. ", +" p.; ; q.r.; ; ; s.6 6 }.6 6 }.}.}.6 6 }.}.}.6 6 t. ", +" u.; ; ; ; v.; ; w.6 6 }.6 6 6 6 6 6 6 6 6 }.6 6 6 x., ", +" y.; ; v.; : z.A.B.6 6 }.6 6 6 6 6 6 6 6 6 }.6 6 C.v.D.E. ", +" F.; ; ; G.H.I.6 6 6 6 }.}.}.}.}.}.}.}.}.}.}.6 6 J.; ; K.L. ", +" M.J ; : N.6 6 6 6 O.P.Q.6 R.6 6 6 6 6 6 6 6 6 6 S.T.; ; U.V. ", +" W.; ; X.6 E 6 Y.Z.`. +6 6 6 6 6 6 6 6 g.6 6 6 6 .+++; ; > V. ", +" @+; #+$+%+6 6 `.v.; &+*+6 6 6 6 6 6 6 6 =+-+6 6 6 ;+>+; ; ,+'+ ", +" V.)+! !+~+{+x ; ; ]+^+/+(+l _+6 6 6 :+<+[+}+6 6 6 |+1+2+; ; 3+@ ", +" 4+5+6+7+8+9+; 0+a+b+; T._+6 6 E c+; ; d+6 6 E 6 o e+; ; = f+ ", +" g+> ; ; ; ; ; ; h+i+; ; j+l.6 6 k+D ; ; l+m+6 6 6 n+o+; ; p+ ", +" > ; ; ; ; q+r+s+; ; t+u+6 6 v+w+; ; x+y+6 6 z+A+; B+3 ", +" C+D+= ; E+F+G+H+; ; I+J+6 6 k+K+; ; ; L+c+M+ ", +" N+4 O+ X ; ; ; P+Q+K+R+S+T+; ; ; v.U+V+ ", +" W+; ; ; ; ; X+Y+Z+; ; ; ; = `+ @ ", +" .@+@@@4 ; ; #@$@%@; ; ; s s+T ", +" &@ *@=@s+ ", +" ", +" ", +" "}; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SmoothPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SmoothPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SmoothPlugin/Makefile.in 2004-01-17 10:32:43.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SmoothPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -13,10 +13,7 @@ LFLAGS = LIBS = @FLTK_LIBS@ MOC = moc -UIC = - -TAR = tar -cf -GZIP = gzip -9f +UIC = INSTALL = @INSTALL@ @@ -99,13 +96,6 @@ moc: $(SRCMOC) -tmake: - tmake SmoothPlugin.pro - -dist: - $(TAR) SmoothPlugin.tar SmoothPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) SmoothPlugin.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SmoothPlugin/SmoothPlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SmoothPlugin/SmoothPlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SmoothPlugin/SmoothPlugin.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SmoothPlugin/SmoothPlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -79,6 +79,12 @@ this,m_AudioCH,m_HostInfo); } +void SmoothPlugin::Reset() +{ + ResetPorts(); + m_Value = 0; +} + void SmoothPlugin::Execute() { float Value; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SmoothPlugin/SmoothPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SmoothPlugin/SmoothPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SmoothPlugin/SmoothPluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SmoothPlugin/SmoothPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -18,6 +18,7 @@ #include "SmoothPluginGUI.h" #include +#include using namespace std; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SmoothPlugin/SmoothPlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SmoothPlugin/SmoothPlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SmoothPlugin/SmoothPlugin.h 2003-08-08 17:55:52.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SmoothPlugin/SmoothPlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -31,6 +31,7 @@ virtual PluginInfo& Initialise(const HostInfo *Host); virtual SpiralGUIType* CreateGUI(); virtual void Execute(); + virtual void Reset(); virtual void StreamOut(std::ostream &s); virtual void StreamIn(std::istream &s); diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SmoothPlugin/SmoothPlugin.pro spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SmoothPlugin/SmoothPlugin.pro --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SmoothPlugin/SmoothPlugin.pro 2002-07-28 23:18:15.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SmoothPlugin/SmoothPlugin.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -HEADERS = ../SpiralPlugin.h \ - ../SpiralPluginGUI.h \ - ../Widgets/Fl_Knob.H \ - ../Widgets/Fl_DragBar.H \ - ../../Sample.h \ - SmoothPlugin.h \ - SmoothPluginGUI.h - -SOURCES = ../SpiralPlugin.C \ - ../SpiralPluginGUI.C \ - ../Widgets/Fl_Knob.cxx \ - ../Widgets/Fl_DragBar.cxx \ - ../../Sample.C \ - SmoothPlugin.C \ - SmoothPluginGUI.C - -TARGET = SmoothPlugin.so diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/DelayGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/GUI/DelayGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/DelayGUI.C 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/GUI/DelayGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,95 @@ +/* SpiralLoops + * Copyleft (C) 2000 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "DelayGUI.h" + +static const int GUI_COLOUR = 154; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = FL_GRAY; + +DelayGUI::DelayGUI(Delay *o) +{ + m_delay=o; + if (!m_delay) cerr<<"WARNING: Delay not correctly set up"<type(1); + o->color(GUIBG2_COLOUR); + o->box(FL_UP_BOX); + o->labeltype(FL_ENGRAVED_LABEL); + o->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE); + o->user_data((void*)(this)); + + DelayA = new Fl_Knob(xoff+50, yoff+5, 40, 40, "Delay"); + DelayA->color(GUI_COLOUR); + DelayA->labelsize(10); + DelayA->maximum(1); + DelayA->step(0.01); + DelayA->value(0.5); + DelayA->callback((Fl_Callback*)cb_Delay); + + Feedback = new Fl_Knob(xoff+100, yoff+5, 40, 40, "Feedback"); + Feedback->color(GUI_COLOUR); + Feedback->labelsize(10); + Feedback->maximum(1.0); + Feedback->step(0.01); + Feedback->value(0.5); + Feedback->callback((Fl_Callback*)cb_Feedback); + + Bypass = new Fl_Button(xoff+5, yoff+25, 40, 20, "Bypass"); + Bypass->color(GUIBG2_COLOUR); + Bypass->labelsize(10); + Bypass->type(1); + Bypass->value(1); + Bypass->callback((Fl_Callback*)cb_Bypass); + + o->end(); + +} + +void DelayGUI::UpdateValues() +{ + DelayA->value(m_delay->GetDelay()); + Feedback->value(m_delay->GetFeedback()); + Bypass->value((int)m_delay->GetBypass()); +} + +//// Callbacks //// + +inline void DelayGUI::cb_Delay_i(Fl_Knob* o, void* v) +{ m_delay->SetDelay(o->value()); } +void DelayGUI::cb_Delay(Fl_Knob* o, void* v) +{ ((DelayGUI*)(o->parent()->user_data()))->cb_Delay_i(o,v); } + +inline void DelayGUI::cb_Feedback_i(Fl_Knob* o, void* v) +{ m_delay->SetFeedback(o->value()); } +void DelayGUI::cb_Feedback(Fl_Knob* o, void* v) +{ ((DelayGUI*)(o->parent()->user_data()))->cb_Feedback_i(o,v); } + +inline void DelayGUI::cb_Bypass_i(Fl_Button* o, void* v) +{ m_delay->SetBypass(o->value()); } +void DelayGUI::cb_Bypass(Fl_Button* o, void* v) +{ ((DelayGUI*)(o->parent()->user_data()))->cb_Bypass_i(o,v); } diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/DelayGUI.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/GUI/DelayGUI.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/DelayGUI.h 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/GUI/DelayGUI.h 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,61 @@ +/* SpiralLoops + * Copyleft (C) 2000 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include "../../Widgets/Fl_Knob.H" + +#include "GUIBase.h" +#include "../SpiralSound/Delay.h" + +#ifndef DELAYGUI +#define DELAYGUI + +class DelayGUI : public GUIBase +{ +public: + DelayGUI(Delay *o); + ~DelayGUI(); + + virtual void CreateGUI(int xoff, int yoff, char *name); + virtual void UpdateValues(); + Fl_Group* GetGroup() { return GUIDelayGroup; } + + Delay *m_delay; + +private: + + Fl_Group *GUIDelayGroup; + Fl_Knob *DelayA; + Fl_Knob *Feedback; + Fl_Button *Bypass; + + //// Callbacks //// + + inline void cb_Delay_i(Fl_Knob* o, void* v); + static void cb_Delay(Fl_Knob*, void*); + inline void cb_Feedback_i(Fl_Knob* o, void* v); + static void cb_Feedback(Fl_Knob* o, void* v); + inline void cb_Bypass_i(Fl_Button* o, void* v); + static void cb_Bypass(Fl_Button* o, void* v); + +}; + +#endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/FilterGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/GUI/FilterGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/FilterGUI.C 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/GUI/FilterGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,109 @@ +/* SpiralLoops + * Copyright (C) 2000 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "FilterGUI.h" + +static const int GUI_COLOUR = 154; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = FL_GRAY; + + +FilterGUI::FilterGUI(Filter *o) +{ + m_filter=o; + if (!m_filter) cerr<<"WARNING: Filter not correctly set up"<type(1); + o->box(FL_UP_BOX); + o->labeltype(FL_ENGRAVED_LABEL); + o->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE); + o->user_data((void*)(this)); + + Cutoff = new Fl_Slider(xoff+15, yoff+20, 20, 70, "Cutoff"); + Cutoff->type(4); + Cutoff->selection_color(GUI_COLOUR); + Cutoff->labelsize(10); + Cutoff->maximum(10000); + Cutoff->step(0.1); + Cutoff->value(1000); + Cutoff->callback((Fl_Callback*)cb_Cutoff); + + Resonance = new Fl_Knob(xoff+58, yoff+8, 45, 45, "Emphasis"); + Resonance->color(GUI_COLOUR); + Resonance->type(Fl_Knob::DOTLIN); + Resonance->labelsize(10); + Resonance->maximum(10); + Resonance->step(0.1); + Resonance->value(0); + Resonance->callback((Fl_Callback*)cb_Resonance); + + RevCutoff = new Fl_Button(xoff+57, yoff+72, 50, 15, "RvCMod"); + RevCutoff->type(1); + RevCutoff->down_box(FL_DOWN_BOX); + RevCutoff->labelsize(10); + RevCutoff->callback((Fl_Callback*)cb_RevCutoff); + + RevResonance = new Fl_Button(xoff+57, yoff+88, 50, 15, "RvRMod"); + RevResonance->type(1); + RevResonance->down_box(FL_DOWN_BOX); + RevResonance->labelsize(10); + RevResonance->callback((Fl_Callback*)cb_RevResonance); + + + o->end(); + +} + +void FilterGUI::UpdateValues() +{ + Cutoff->value(10000.0f-m_filter->GetCutoff()-10.0f); + Resonance->value(m_filter->GetResonance()-1.0f); + + RevCutoff->value(0); + RevResonance->value(0); + + if (m_filter->GetRevCutoffMod()) RevCutoff->value(1); + if (m_filter->GetRevResonanceMod()) RevResonance->value(1); +} + +//// Callbacks //// + +inline void FilterGUI::cb_Cutoff_i(Fl_Slider* o, void* v) +{ m_filter->SetCutoff((10000.0f-o->value())+10.0f); } +void FilterGUI::cb_Cutoff(Fl_Slider* o, void* v) +{ ((FilterGUI*)(o->parent()->user_data()))->cb_Cutoff_i(o,v); } + +inline void FilterGUI::cb_Resonance_i(Fl_Knob* o, void* v) +{ m_filter->SetResonance(o->value()+1.0f); } +void FilterGUI::cb_Resonance(Fl_Knob* o, void* v) +{ ((FilterGUI*)(o->parent()->user_data()))->cb_Resonance_i(o,v); } + +inline void FilterGUI::cb_RevCutoff_i(Fl_Button* o, void* v) +{ m_filter->SetRevCutoffMod(o->value()); } +void FilterGUI::cb_RevCutoff(Fl_Button* o, void* v) +{ ((FilterGUI*)(o->parent()->user_data()))->cb_RevCutoff_i(o,v); } + +inline void FilterGUI::cb_RevResonance_i(Fl_Button* o, void* v) +{ m_filter->SetRevResonanceMod(o->value()); } +void FilterGUI::cb_RevResonance(Fl_Button* o, void* v) +{ ((FilterGUI*)(o->parent()->user_data()))->cb_RevResonance_i(o,v); } + diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/FilterGUI.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/GUI/FilterGUI.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/FilterGUI.h 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/GUI/FilterGUI.h 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,62 @@ +/* SpiralLoops + * Copyright (C) 2000 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include "Widgets/Fl_Knob.H" +#include +#include + +#include "GUIBase.h" +#include "../SpiralSound/Filter.h" + +#ifndef FILTERGUI +#define FILTERGUI + +class FilterGUI : public GUIBase +{ +public: + FilterGUI(Filter *o); + + virtual void CreateGUI(int xoff, int yoff, char *name); + virtual void UpdateValues(); + + Filter *m_filter; + +private: + + Fl_Group *GUIFilterGroup; + Fl_Slider *Cutoff; + Fl_Knob *Resonance; + Fl_Button *RevCutoff; + Fl_Button *RevResonance; + + //// Callbacks //// + + inline void cb_Cutoff_i(Fl_Slider* o, void* v); + static void cb_Cutoff(Fl_Slider*, void*); + inline void cb_Resonance_i(Fl_Knob* o, void* v); + static void cb_Resonance(Fl_Knob* o, void* v); + inline void cb_RevCutoff_i(Fl_Button* o, void* v); + static void cb_RevCutoff(Fl_Button*, void*); + inline void cb_RevResonance_i(Fl_Button* o, void* v); + static void cb_RevResonance(Fl_Button* o, void* v); +}; + +#endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/GUIBase.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/GUI/GUIBase.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/GUIBase.C 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/GUI/GUIBase.C 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,27 @@ +/* SpiralLoops + * Copyleft (C) 2000 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "GUIBase.h" + +GUIBase::GUIBase() +{ +} + +GUIBase::~GUIBase() +{ +} diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/GUIBase.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/GUI/GUIBase.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/GUIBase.h 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/GUI/GUIBase.h 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,40 @@ +/* SpiralLoops + * Copyleft (C) 2000 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef GUIBASE +#define GUIBASE + +class GUIBase +{ + public: + + GUIBase(); + virtual ~GUIBase(); + + // todo: these should be pure virtual funcs, to force + // GUI's to instantiate them + virtual void CreateGUI(int xoff, int yoff, char *name) {} // =0; + virtual void UpdateValues() {} // =0; + + protected: + + private: + +}; + +#endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/LoopGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/GUI/LoopGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/LoopGUI.C 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/GUI/LoopGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,652 @@ +/* SpiralLoops + * Copyleft (C) 2000 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include + +#include "Widgets/Fl_Loop.h" +#include "LoopGUI.h" +#include "../Loop.h" +#include + +static const int EFFECT_ADDITION = 130; +static const int GUI_COLOUR = 154; +static const int GUIBG_COLOUR = FL_GRAY; +static const int GUIBG2_COLOUR = FL_GRAY; + +static const int MAX_TRIGGERS = 8; + +//static const int GUIBG_COLOUR = 144; +//static const int GUIBG2_COLOUR = 145; + +///////////////////////////////////////////////////////////////////////////// + +LoopGUI::LoopGUI(Loop *o) : +m_TriggerCount(0), +GUILoopGroup(NULL) +{ + m_loop=o; + m_LastAngle=0; + + if (!m_loop) cerr<<"WARNING: Loop not correctly set up"<box(FL_NO_BOX); + GUILoopGroup->color(GUIBG2_COLOUR); + GUILoopGroup->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE); + GUILoopGroup->user_data((void*)(this)); + GUILoopGroup->SetData(m_loop->GetLoopPtr()); + GUILoopGroup->SetLength(m_loop->GetLoopLength()); + GUILoopGroup->SetPos(m_loop->GetPosPtr()); + GUILoopGroup->callback((Fl_Callback*)cb_Loop); + GUILoopGroup->SetupCopyBufFuncs((Fl_Loop::cb_CopyBuf1*)cb_Cut, + (Fl_Loop::cb_CopyBuf1*)cb_Copy, + (Fl_Loop::cb_CopyBuf2*)cb_Paste, + (Fl_Loop::cb_CopyBuf2*)cb_PasteMix, + (Fl_Loop::cb_CopyBuf1*)cb_ZeroRange, + (Fl_Loop::cb_CopyBuf1*)cb_ReverseRange, + (Fl_Loop::cb_CopyBuf1*)cb_Halve, + (Fl_Loop::cb_CopyBuf1*)cb_Hold, + (Fl_Loop::cb_CopyBuf1*)cb_SelectAll, + (Fl_Loop::cb_CopyBuf1*)cb_NewTrigger, + (Fl_Loop::cb_CopyBuf1*)cb_Move); + + //GUILoopGroup->SetMainWin(m_loop->GetParent()->GetPluginWindow()); + + Volume = new Fl_Slider(60, y+100, 20, 70, "Volume"); + Volume->type(4); + Volume->color(GUIBG2_COLOUR); + Volume->selection_color(GUI_COLOUR); + Volume->labelsize(10); + Volume->maximum(1.0f); + Volume->step(0.001); + Volume->value(0); + Volume->callback((Fl_Callback*)cb_Volume); + GUILoopGroup->add(Volume); + + Cutoff = new Fl_Slider(220, y+100, 20, 70, "Cutoff"); + Cutoff->type(4); + Cutoff->color(GUIBG2_COLOUR); + Cutoff->selection_color(GUI_COLOUR); + Cutoff->labelsize(10); + Cutoff->maximum(100); + Cutoff->step(0.1); + Cutoff->value(0); + Cutoff->callback((Fl_Callback*)cb_Cutoff); + GUILoopGroup->add(Cutoff); + + Resonance = new Fl_Knob(160, y+140, 45, 45, "Emphasis"); + Resonance->color(GUI_COLOUR); + Resonance->type(Fl_Knob::DOTLIN); + Resonance->labelsize(10); + Resonance->maximum(10); + Resonance->step(0.1); + Resonance->value(0); + Resonance->callback((Fl_Callback*)cb_Resonance); + GUILoopGroup->add(Resonance); + + Balance = new Fl_Knob(95, y+140, 45, 45, "Balance"); + Balance->color(GUI_COLOUR); + Balance->type(Fl_Knob::DOTLIN); + Balance->labelsize(10); + Balance->maximum(2); + Balance->step(0.001); + Balance->value(1.0); + Balance->callback((Fl_Callback*)cb_Balance); + GUILoopGroup->add(Balance); + + Speed = new Fl_Knob(95, y+60, 45, 45, "Speed"); + Speed->color(GUI_COLOUR); + Speed->type(Fl_Knob::DOTLIN); + Speed->labelsize(10); + Speed->maximum(3); + Speed->step(0.0001); + Speed->value(1); + Speed->callback((Fl_Callback*)cb_Speed); + GUILoopGroup->add(Speed); + + Length = new Fl_Knob(160, y+60, 45, 45, "Length"); + Length->color(GUI_COLOUR); + Length->type(Fl_Knob::DOTLIN); + Length->labelsize(10); + Length->maximum(1); + Length->step(0.0001); + Length->value(1); + Length->callback((Fl_Callback*)cb_Length); + GUILoopGroup->add(Length); + + Record = new Fl_Button(85, y+200, 60, 14, "Record"); + Record->type(1); + Record->color(GUIBG2_COLOUR); + Record->down_box(FL_DOWN_BOX); + Record->labelsize(10); + Record->callback((Fl_Callback*)cb_Record); + GUILoopGroup->add(Record); + + Load = new Fl_Button(155, y+200, 60, 14, "Load"); + Load->color(GUIBG2_COLOUR); + Load->type(0); + Load->down_box(FL_DOWN_BOX); + Load->labelsize(10); + Load->callback((Fl_Callback*)cb_Load); + GUILoopGroup->add(Load); + + //Effects = new Fl_Button(130, y+200, 40, 14, "Effects"); + //Effects->color(GUIBG2_COLOUR); + //Effects->type(1); + //Effects->down_box(FL_DOWN_BOX); + //Effects->labelsize(10); + //Effects->callback((Fl_Callback*)cb_Effects); + + Double = new Fl_Button(85, y+218, 60, 14, "Double"); + Double->color(GUIBG2_COLOUR); + Double->type(0); + Double->down_box(FL_DOWN_BOX); + Double->labelsize(10); + Double->callback((Fl_Callback*)cb_Double); + GUILoopGroup->add(Double); + + //Match = new Fl_Button(130, y+218, 40, 14, "Match"); + //Match->color(GUIBG2_COLOUR); + //Match->type(0); + //Match->down_box(FL_DOWN_BOX); + //Match->labelsize(10); + //Match->callback((Fl_Callback*)cb_Match); + + Save = new Fl_Button(155, y+218, 60, 14, "Save"); + Save->color(GUIBG2_COLOUR); + Save->type(0); + Save->down_box(FL_DOWN_BOX); + Save->labelsize(10); + Save->callback((Fl_Callback*)cb_Save); + GUILoopGroup->add(Save); + + Play = new Fl_LED_Button(255, y+275, 40, 25, "Play"); + Play->color(GUIBG2_COLOUR); + Play->type(1); + Play->value(1); + Play->down_box(FL_DOWN_BOX); + Play->labelsize(10); + Play->callback((Fl_Callback*)cb_Play); + GUILoopGroup->add(Play); + + SpeedOutput = new Fl_Value_Output(93, y+120, 50, 15); + SpeedOutput->labelsize(10); + SpeedOutput->textsize(10); + GUILoopGroup->add(SpeedOutput); + + LengthOutput = new Fl_Value_Output(157, y+120, 50, 15); + LengthOutput->labelsize(10); + LengthOutput->textsize(10); + GUILoopGroup->add(LengthOutput); + + MagicOutput = new Fl_Value_Output(125, y+235, 50, 15); + MagicOutput->labelsize(10); + MagicOutput->textsize(10); + GUILoopGroup->add(MagicOutput); + + //Master = new Fl_LED_Button(2, y+5, 40, 25, "Master"); + //Master->type(1); + //Master->color(GUIBG2_COLOUR); + //Master->down_box(FL_DOWN_BOX); + //Master->labelsize(10); + //Master->callback((Fl_Callback*)cb_Master); + + Update = new Fl_LED_Button(2, y+275, 40, 25, "Update"); + Update->type(1); + Update->value(0); + Update->selection_color(3); + Update->down_box(FL_DOWN_BOX); + Update->labelsize(10); + Update->callback((Fl_Callback*)cb_Update); + GUILoopGroup->add(Update); + + WaveSize = new Fl_Knob(262, y+5, 30, 30, "WaveSize"); + WaveSize->color(GUI_COLOUR); + WaveSize->type(Fl_Knob::DOTLIN); + WaveSize->labelsize(8); + WaveSize->maximum(10.0); + WaveSize->step(0.01); + WaveSize->value(0.0); + WaveSize->callback((Fl_Callback*)cb_WaveSize); + GUILoopGroup->add(WaveSize); + + GUILoopGroup->show(); + GUILoopGroup->end(); + } +} + +void LoopGUI::SetMasterStatus(bool m) +{ + m_loop->SetMasterStatus(m); + Master->value(m); + GUILoopGroup->redraw(); +} + +void LoopGUI::CheckTriggers(float CurrentAngle, vector &LoopTriggers) +{ + for (vector::iterator i=m_TriggerVec.begin(); + i!=m_TriggerVec.end(); i++) + { + // Todo: Better detection needed + + if (CurrentAngle>(*i)->GetAngle() && + m_LastAngle<(*i)->GetAngle()) + { + if ((*i)->Completed() && (*i)->GetPass()!=0) + { + m_loop->SetPlaying(false); + Play->value(false); + } + + LoopTriggers.push_back((*i)->GetID()); + (*i)->IncCount(); + } + } + + m_LastAngle=CurrentAngle; +} + +void LoopGUI::SetSnapAngle(int Angle) +{ + m_SnapAngle = Angle; + + for (vector::iterator i=m_TriggerVec.begin(); + i!=m_TriggerVec.end(); i++) + { + (*i)->SetSnapAngle(Angle); + } + + GUILoopGroup->SetSnapAngle(Angle); + GUILoopGroup->redraw(); +} + + +void LoopGUI::SetSnap(bool s) +{ + for (vector::iterator i=m_TriggerVec.begin(); + i!=m_TriggerVec.end(); i++) + { + (*i)->SetSnap(s); + } + + GUILoopGroup->SetSnap(s); +} + +void LoopGUI::UpdateValues() +{ + Volume->value(1.0f-m_loop->GetVolume()); + Cutoff->value(100.0f-sqrt(m_loop->GetCutoff()-10.0f)); + Resonance->value(m_loop->GetResonance()-1.0f); + Balance->value(m_loop->GetBalance()); + Speed->value(m_loop->GetSpeed()); + Length->value(m_loop->GetLoopLength()/(float)m_loop->GetTotalLength()); + Effects->value(m_loop->GetEffects()); + Play->value(m_loop->IsPlaying()); + Master->value(m_loop->IsMaster()); +} + +void LoopGUI::UpdateDataPtr() +{ + GUILoopGroup->SetData(m_loop->GetLoopPtr()); + GUILoopGroup->SetLength(m_loop->GetLoopLength()); +} + + +//// Callbacks //// + +inline void LoopGUI::cb_Loop_i(Fl_Loop* o, void* v) +{ + o->hide(); + m_loop->DelMe(); +} +void LoopGUI::cb_Loop(Fl_Loop* o, void* v) +{ ((LoopGUI*)(o->user_data()))->cb_Loop_i(o,v); } + +inline void LoopGUI::cb_Volume_i(Fl_Slider* o, void* v) +{ + m_loop->SetVolume(1.0f-o->value()); +} +void LoopGUI::cb_Volume(Fl_Slider* o, void* v) +{ ((LoopGUI*)(o->parent()->user_data()))->cb_Volume_i(o,v); } + +inline void LoopGUI::cb_Cutoff_i(Fl_Slider* o, void* v) +{ + m_loop->FilterBypass(o->value()==0); + float value=100.0f-o->value(); + m_loop->SetCutoff((int)(value*value+10.0f)); +} +void LoopGUI::cb_Cutoff(Fl_Slider* o, void* v) +{ ((LoopGUI*)(o->parent()->user_data()))->cb_Cutoff_i(o,v); } + +inline void LoopGUI::cb_Balance_i(Fl_Knob* o, void* v) +{ + /*float rvalue=1+o->value()-1.0f; + float lvalue=2-o->value(); + + m_loop->SetLeftVol(lvalue/2.0f); + m_loop->SetRightVol(rvalue/2.0f);*/ + + m_loop->SetBalance(o->value()); + +} +void LoopGUI::cb_Balance(Fl_Knob* o, void* v) +{ ((LoopGUI*)(o->parent()->user_data()))->cb_Balance_i(o,v); } + +inline void LoopGUI::cb_Length_i(Fl_Knob* o, void* v) +{ + m_loop->SetLength((int)(o->value()*m_loop->GetTotalLength())); + GUILoopGroup->SetLength(m_loop->GetLoopLength()); + + //LengthOutput->value((float)m_loop->GetLoopLength()/(float)SpiralLoopsInfo::SAMPLERATE); + GUILoopGroup->redraw(); +} +void LoopGUI::cb_Length(Fl_Knob* o, void* v) +{ ((LoopGUI*)(o->parent()->user_data()))->cb_Length_i(o,v); } + +inline void LoopGUI::cb_Speed_i(Fl_Knob* o, void* v) +{ + m_loop->SetSpeed(o->value()); + SpeedOutput->value(o->value()); +} +void LoopGUI::cb_Speed(Fl_Knob* o, void* v) +{ ((LoopGUI*)(o->parent()->user_data()))->cb_Speed_i(o,v); } + +inline void LoopGUI::cb_Resonance_i(Fl_Knob* o, void* v) +{ + m_loop->SetResonance((int)(o->value()+1.0f)); +} +void LoopGUI::cb_Resonance(Fl_Knob* o, void* v) +{ ((LoopGUI*)(o->parent()->user_data()))->cb_Resonance_i(o,v); } + +inline void LoopGUI::cb_Record_i(Fl_Button* o, void* v) +{ + m_loop->Record(o->value()); + GUILoopGroup->SetData(m_loop->GetLoopPtr()); + GUILoopGroup->SetLength(m_loop->GetLoopLength()); + GUILoopGroup->redraw(); +} +void LoopGUI::cb_Record(Fl_Button* o, void* v) +{ ((LoopGUI*)(o->parent()->user_data()))->cb_Record_i(o,v); } + +inline void LoopGUI::cb_Load_i(Fl_Button* o, void* v) +{ + //GUILoopGroup->UnsetIdle(); + char *fn=fl_file_chooser("Pick a Wav file to load", "*.wav", NULL); + + if (fn && fn!="") + { + m_loop->LoadWav(fn); + } + + GUILoopGroup->SetData(m_loop->GetLoopPtr()); + GUILoopGroup->SetLength(m_loop->GetLoopLength()); + + //LengthOutput->value(m_loop->GetLoopLength()/(float)SpiralLoopsInfo::SAMPLERATE); + //GUILoopGroup->SetIdle(); + GUILoopGroup->redraw(); +} +void LoopGUI::cb_Load(Fl_Button* o, void* v) +{ ((LoopGUI*)(o->parent()->user_data()))->cb_Load_i(o,v); } + +inline void LoopGUI::cb_Play_i(Fl_LED_Button* o, void* v) +{ + m_loop->SetPlaying(o->value()); +} +void LoopGUI::cb_Play(Fl_LED_Button* o, void* v) +{ ((LoopGUI*)(o->parent()->user_data()))->cb_Play_i(o,v); } + +inline void LoopGUI::cb_Master_i(Fl_LED_Button* o, void* v) +{ +} +void LoopGUI::cb_Master(Fl_LED_Button* o, void* v) +{ ((LoopGUI*)(o->parent()->user_data()))->cb_Master_i(o,v); } + +inline void LoopGUI::cb_Effects_i(Fl_Button* o, void* v) +{ + Fl_Widget *p=GUILoopGroup->parent(); + + if (o->value()) + { + p->size(p->w(),p->h()+EFFECT_ADDITION); + } + else + { + p->size(p->w(),p->h()-EFFECT_ADDITION); + } + + m_loop->SetEffects(o->value()); +} +void LoopGUI::cb_Effects(Fl_Button* o, void* v) +{ ((LoopGUI*)(o->parent()->user_data()))->cb_Effects_i(o,v); } + +inline void LoopGUI::cb_Update_i(Fl_LED_Button* o, void* v) +{ + GUILoopGroup->SetUpdate(o->value()); +} +void LoopGUI::cb_Update(Fl_LED_Button* o, void* v) +{ ((LoopGUI*)(o->parent()->user_data()))->cb_Update_i(o,v); } + +inline void LoopGUI::cb_Double_i(Fl_Button* o, void* v) +{ + m_loop->Double(); + + GUILoopGroup->SetData(m_loop->GetLoopPtr()); + GUILoopGroup->SetLength(m_loop->GetLoopLength()); + GUILoopGroup->redraw(); + +} +void LoopGUI::cb_Double(Fl_Button* o, void* v) +{ ((LoopGUI*)(o->parent()->user_data()))->cb_Double_i(o,v); } + +inline void LoopGUI::cb_Match_i(Fl_Button* o, void* v) +{ +} +void LoopGUI::cb_Match(Fl_Button* o, void* v) +{ ((LoopGUI*)(o->parent()->user_data()))->cb_Match_i(o,v); } + +inline void LoopGUI::cb_Save_i(Fl_Button* o, void* v) +{ + char *fn=fl_file_chooser("Save loop as Wav file", "*.wav", NULL); + + if (fn && fn!="") + { + m_loop->SaveWav(fn); + } +} +void LoopGUI::cb_Save(Fl_Button* o, void* v) +{ ((LoopGUI*)(o->parent()->user_data()))->cb_Save_i(o,v); } + +inline void LoopGUI::cb_WaveSize_i(Fl_Knob* o, void* v) +{ + GUILoopGroup->SetWaveSize(1+o->value()); + GUILoopGroup->redraw(); +} +void LoopGUI::cb_WaveSize(Fl_Knob* o, void* v) +{ ((LoopGUI*)(o->parent()->user_data()))->cb_WaveSize_i(o,v); } + + +//////////////////////////////////////////////////////////////// + + +inline void LoopGUI::cb_Cut_i(Fl_Loop *o, int Start, int End) +{ + m_loop->Cut(Start,End); + GUILoopGroup->SetData(m_loop->GetLoopPtr()); + GUILoopGroup->SetLength(m_loop->GetLoopLength()); + GUILoopGroup->redraw(); +} +void LoopGUI::cb_Cut(Fl_Loop *o, int Start, int End) +{ ((LoopGUI*)(o->user_data()))->cb_Cut_i(o,Start,End); } + +void LoopGUI::cb_Copy_i(Fl_Loop *o, int Start, int End) +{ + m_loop->Copy(Start,End); + GUILoopGroup->SetData(m_loop->GetLoopPtr()); + GUILoopGroup->SetLength(m_loop->GetLoopLength()); + GUILoopGroup->redraw(); +} +void LoopGUI::cb_Copy(Fl_Loop *o, int Start, int End) +{ ((LoopGUI*)(o->user_data()))->cb_Copy_i(o,Start,End); } + +inline void LoopGUI::cb_Paste_i(Fl_Loop *o, int Start) +{ + m_loop->Paste(Start); + GUILoopGroup->SetData(m_loop->GetLoopPtr()); + GUILoopGroup->SetLength(m_loop->GetLoopLength()); + GUILoopGroup->redraw(); +} +void LoopGUI::cb_Paste(Fl_Loop *o, int Start) +{ ((LoopGUI*)(o->user_data()))->cb_Paste_i(o,Start); } + +inline void LoopGUI::cb_PasteMix_i(Fl_Loop *o, int Start) +{ + m_loop->PasteMix(Start); + GUILoopGroup->SetData(m_loop->GetLoopPtr()); + GUILoopGroup->SetLength(m_loop->GetLoopLength()); + GUILoopGroup->redraw(); +} +void LoopGUI::cb_PasteMix(Fl_Loop *o, int Start) +{ ((LoopGUI*)(o->user_data()))->cb_PasteMix_i(o,Start); } + + +inline void LoopGUI::cb_ZeroRange_i(Fl_Loop *o, int Start, int End) +{ + m_loop->ZeroRange(Start,End); + GUILoopGroup->SetData(m_loop->GetLoopPtr()); + GUILoopGroup->SetLength(m_loop->GetLoopLength()); + GUILoopGroup->redraw(); +} +void LoopGUI::cb_ZeroRange(Fl_Loop *o, int Start, int End) +{ ((LoopGUI*)(o->user_data()))->cb_ZeroRange_i(o,Start,End); } + +inline void LoopGUI::cb_ReverseRange_i(Fl_Loop *o, int Start, int End) +{ + m_loop->ReverseRange(Start,End); + GUILoopGroup->SetData(m_loop->GetLoopPtr()); + GUILoopGroup->SetLength(m_loop->GetLoopLength()); + GUILoopGroup->redraw(); +} +void LoopGUI::cb_ReverseRange(Fl_Loop *o, int Start, int End) +{ ((LoopGUI*)(o->user_data()))->cb_ReverseRange_i(o,Start,End); } + +inline void LoopGUI::cb_Halve_i(Fl_Loop *o, int Start, int End) +{ + m_loop->Halve(); + GUILoopGroup->SetData(m_loop->GetLoopPtr()); + GUILoopGroup->SetLength(m_loop->GetLoopLength()); + GUILoopGroup->redraw(); +} +void LoopGUI::cb_Halve(Fl_Loop *o, int Start, int End) +{ ((LoopGUI*)(o->user_data()))->cb_Halve_i(o,Start,End); } + +inline void LoopGUI::cb_Hold_i(Fl_Loop *o, int Start, int End) +{ + m_loop->Hold(); + GUILoopGroup->SetData(m_loop->GetLoopPtr()); + GUILoopGroup->SetLength(m_loop->GetLoopLength()); + GUILoopGroup->redraw(); +} +void LoopGUI::cb_Hold(Fl_Loop *o, int Start, int End) +{ ((LoopGUI*)(o->user_data()))->cb_Hold_i(o,Start,End); } + +inline void LoopGUI::cb_SelectAll_i(Fl_Loop *o, int Start, int End) +{ + m_loop->SelectAll(); + GUILoopGroup->SetData(m_loop->GetLoopPtr()); + GUILoopGroup->SetLength(m_loop->GetLoopLength()); + GUILoopGroup->redraw(); +} +void LoopGUI::cb_SelectAll(Fl_Loop *o, int Start, int End) +{ ((LoopGUI*)(o->user_data()))->cb_SelectAll_i(o,Start,End); } + +inline void LoopGUI::cb_NewTrigger_i(Fl_Loop *o, int Start, int End) +{ + if (m_TriggerCount>=8) return; + + Fl_Trigger *NewTrigger = new Fl_Trigger(0, 0, 20, 20); + NewTrigger->SetCentreX(150); + NewTrigger->SetCentreY(170); + NewTrigger->SetCentreRadius(125); + NewTrigger->SetID(m_TriggerCount); + + GUILoopGroup->add(NewTrigger); + m_TriggerVec.push_back(NewTrigger); + GUILoopGroup->redraw(); + GUILoopGroup->parent()->redraw(); + + m_TriggerCount++; +} +void LoopGUI::cb_NewTrigger(Fl_Loop *o, int Start, int End) +{ ((LoopGUI*)(o->user_data()))->cb_NewTrigger_i(o,Start,End); } + +inline void LoopGUI::cb_Move_i(Fl_Loop *o, int Start, int End) +{ + m_loop->Move(Start); + GUILoopGroup->SetData(m_loop->GetLoopPtr()); + GUILoopGroup->SetLength(m_loop->GetLoopLength()); + GUILoopGroup->redraw(); +} +void LoopGUI::cb_Move(Fl_Loop *o, int Start, int End) +{ ((LoopGUI*)(o->user_data()))->cb_Move_i(o,Start,End); } + +///////////////////////////////////////////////////// + +istream &operator>>(istream &s, LoopGUI &o) +{ + int x,y,w,h; + s>>x>>y>>w>>h; + //o.GUILoopGroup->resize(x,y,w,h); + + int Num; + s>>Num; + + for (int n=0; n>*NewTrigger; + o.GUILoopGroup->add(NewTrigger); + o.m_TriggerVec.push_back(NewTrigger); + } + + return s; +} + +ostream &operator<<(ostream &s, LoopGUI &o) +{ + s<GetX()<<" "<GetY()<<" "<< + o.GUILoopGroup->GetW()<<" "<GetH()<<" "; + + s<::iterator i=o.m_TriggerVec.begin(); + i!=o.m_TriggerVec.end(); i++) + { + s<<**i; + } + + return s; +} diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/LoopGUI.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/GUI/LoopGUI.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/LoopGUI.h 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/GUI/LoopGUI.h 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,162 @@ +/* SpiralLoops + * Copyleft (C) 2000 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include "Widgets/Fl_Knob.H" +#include "Widgets/Fl_Loop.h" +#include "Widgets/Fl_LED_Button.H" +#include "Widgets/Fl_Trigger.h" + +#include "GUIBase.h" +#include "../SpiralSound/Filter.h" +#include "../SpiralSound/Delay.h" +#include "../SpiralSound/Reverb.h" +#include + +#ifndef LOOPGUI +#define LOOPGUI + +class Loop; + +class LoopGUI : public GUIBase +{ +public: + LoopGUI(Loop *o); + ~LoopGUI(); + + virtual void CreateGUI(char *name=""); + virtual void UpdateValues(); + + int GetPos(); + void SetMasterStatus(bool m); + void RefreshWave() {} + void CheckTriggers(float CurrentAngle, vector &LoopTriggers); + void StopUpdate(bool s) {GUILoopGroup->StopUpdate(s);} + void Trigger() {Play->value(true);} + void UpdateDataPtr(); + void SetSnap(bool s); + void SetSnapAngle(int Angle); + void UpdatePos() { GUILoopGroup->DrawPosMarker(); } + + Fl_Group *GetGUI() { return GUILoopGroup; } + +private: + Loop *m_loop; + + float m_LastAngle; + int m_SnapAngle; + int m_TriggerCount; + + Fl_Loop *GUILoopGroup; + Fl_Group *InnerGroup; + Fl_Slider *Cutoff; + Fl_Slider *Volume; + Fl_Knob *Balance; + Fl_Knob *Length; + Fl_Knob *Speed; + Fl_Knob *Resonance; + Fl_Value_Output *SpeedOutput; + Fl_Value_Output *LengthOutput; + Fl_Value_Output *MagicOutput; + Fl_Knob *WaveSize; + + Fl_Button *Record; + Fl_Button *Load; + Fl_LED_Button *Play; + Fl_LED_Button *Master; + Fl_LED_Button *Update; + Fl_Button *Effects; + Fl_Button *Double; + Fl_Button *Match; + Fl_Button *Save; + + vector m_TriggerVec; + + //// Callbacks //// + inline void cb_Loop_i(Fl_Loop* o, void* v); + static void cb_Loop(Fl_Loop* o, void* v); + inline void cb_Volume_i(Fl_Slider* o, void* v); + static void cb_Volume(Fl_Slider* o, void* v); + inline void cb_Cutoff_i(Fl_Slider* o, void* v); + static void cb_Cutoff(Fl_Slider* o, void* v); + inline void cb_Balance_i(Fl_Knob* o, void* v); + static void cb_Balance(Fl_Knob* o, void* v); + inline void cb_Length_i(Fl_Knob* o, void* v); + static void cb_Length(Fl_Knob* o, void* v); + inline void cb_Speed_i(Fl_Knob* o, void* v); + static void cb_Speed(Fl_Knob* o, void* v); + inline void cb_Resonance_i(Fl_Knob* o, void* v); + static void cb_Resonance(Fl_Knob* o, void* v); + inline void cb_Record_i(Fl_Button* o, void* v); + static void cb_Record(Fl_Button* o, void* v); + inline void cb_Load_i(Fl_Button* o, void* v); + static void cb_Load(Fl_Button* o, void* v); + inline void cb_Play_i(Fl_LED_Button* o, void* v); + static void cb_Play(Fl_LED_Button* o, void* v); + inline void cb_Master_i(Fl_LED_Button* o, void* v); + static void cb_Master(Fl_LED_Button* o, void* v); + inline void cb_Effects_i(Fl_Button* o, void* v); + static void cb_Effects(Fl_Button* o, void* v); + inline void cb_Update_i(Fl_LED_Button* o, void* v); + static void cb_Update(Fl_LED_Button* o, void* v); + inline void cb_Double_i(Fl_Button* o, void* v); + static void cb_Double(Fl_Button* o, void* v); + inline void cb_Match_i(Fl_Button* o, void* v); + static void cb_Match(Fl_Button* o, void* v); + inline void cb_Save_i(Fl_Button* o, void* v); + static void cb_Save(Fl_Button* o, void* v); + inline void cb_WaveSize_i(Fl_Knob* o, void* v); + static void cb_WaveSize(Fl_Knob* o, void* v); + + inline void cb_Cut_i(Fl_Loop *o, int Start, int End); + static void cb_Cut(Fl_Loop *o, int Start, int End); + inline void cb_Copy_i(Fl_Loop *o, int Start, int End); + static void cb_Copy(Fl_Loop *o, int Start, int End); + inline void cb_Paste_i(Fl_Loop *o, int Start); + static void cb_Paste(Fl_Loop *o, int Start); + inline void cb_PasteMix_i(Fl_Loop *o, int Start); + static void cb_PasteMix(Fl_Loop *o, int Start); + inline void cb_ZeroRange_i(Fl_Loop *o, int Start, int End); + static void cb_ZeroRange(Fl_Loop *o, int Start, int End); + inline void cb_ReverseRange_i(Fl_Loop *o, int Start, int End); + static void cb_ReverseRange(Fl_Loop *o, int Start, int End); + inline void cb_Halve_i(Fl_Loop *o, int Start, int End); + static void cb_Halve(Fl_Loop *o, int Start, int End); + inline void cb_Hold_i(Fl_Loop *o, int Start, int End); + static void cb_Hold(Fl_Loop *o, int Start, int End); + inline void cb_SelectAll_i(Fl_Loop *o, int Start, int End); + static void cb_SelectAll(Fl_Loop *o, int Start, int End); + inline void cb_NewTrigger_i(Fl_Loop *o, int Start, int End); + static void cb_NewTrigger(Fl_Loop *o, int Start, int End); + inline void cb_Move_i(Fl_Loop *o, int Start, int End); + static void cb_Move(Fl_Loop *o, int Start, int End); + + friend istream &operator>>(istream &s, LoopGUI &o); + friend ostream &operator<<(ostream &s, LoopGUI &o); +}; + +istream &operator>>(istream &s, LoopGUI &o); +ostream &operator<<(ostream &s, LoopGUI &o); + +#endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/MixerGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/GUI/MixerGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/MixerGUI.C 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/GUI/MixerGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,107 @@ +/* SpiralSynth + * Copyright (C) 2000 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "MixerGUI.h" + +MixerGUI::MixerGUI(Mixer *o) +{ + m_mix=o; + if (!m_mix) cerr<<"WARNING: Mixer not correctly set up"<type(1); + o->box(FL_UP_BOX); + o->labeltype(FL_ENGRAVED_LABEL); + o->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE); + o->user_data((void*)(this)); + + Balance = new Fl_Knob(xoff+55, yoff+35, 40, 40, "Amount"); + Balance->color(SynthInfo::GUI_COLOUR); + Balance->type(Fl_Knob::LINELIN); + Balance->labelsize(10); + Balance->maximum(0.002); + Balance->step(0.00001); + Balance->value(0.001); + Balance->callback((Fl_Callback*)cb_Balance); + + Add = new Fl_Check_Button(xoff, yoff+15, 55, 30, "Add"); + Add->type(102); + Add->down_box(FL_DIAMOND_DOWN_BOX); + Add->selection_color(SynthInfo::GUI_COLOUR); + Add->set(); + Add->callback((Fl_Callback*)cb_Add); + + XMod = new Fl_Check_Button(xoff, yoff+40, 55, 30, "XM"); + XMod->type(102); + XMod->down_box(FL_DIAMOND_DOWN_BOX); + XMod->selection_color(SynthInfo::GUI_COLOUR); + XMod->callback((Fl_Callback*)cb_XMod); + + Ring = new Fl_Check_Button(xoff, yoff+65, 55, 30, "Ring"); + Ring->type(102); + Ring->down_box(FL_DIAMOND_DOWN_BOX); + Ring->selection_color(SynthInfo::GUI_COLOUR); + Ring->callback((Fl_Callback*)cb_Ring); + + o->end(); + +} + +void MixerGUI::UpdateValues() +{ + Balance->value(m_mix->GetAmount()); + + Add->value(0); + XMod->value(0); + Ring->value(0); + + switch(m_mix->GetType()) + { + case Mixer::ADD: Add->value(1); break; + case Mixer::XMOD: XMod->value(1); break; + case Mixer::RING: Ring->value(1); break; + case Mixer::NONE: break; + } + +} + +//// Callbacks //// + +inline void MixerGUI::cb_Balance_i(Fl_Knob* o, void* v) +{ m_mix->SetAmount(o->value()); } +void MixerGUI::cb_Balance(Fl_Knob* o, void* v) +{ ((MixerGUI*)(o->parent()->user_data()))->cb_Balance_i(o,v); } + +inline void MixerGUI::cb_Add_i(Fl_Check_Button* o, void* v) +{ m_mix->SetType(Mixer::ADD); } +void MixerGUI::cb_Add(Fl_Check_Button* o, void* v) +{ ((MixerGUI*)(o->parent()->user_data()))->cb_Add_i(o,v); } + +inline void MixerGUI::cb_XMod_i(Fl_Check_Button* o, void* v) +{ m_mix->SetType(Mixer::XMOD); } +void MixerGUI::cb_XMod(Fl_Check_Button* o, void* v) +{ ((MixerGUI*)(o->parent()->user_data()))->cb_XMod_i(o,v); } + +inline void MixerGUI::cb_Ring_i(Fl_Check_Button* o, void* v) +{ m_mix->SetType(Mixer::RING); } +void MixerGUI::cb_Ring(Fl_Check_Button* o, void* v) +{ ((MixerGUI*)(o->parent()->user_data()))->cb_Ring_i(o,v); } + diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/MixerGUI.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/GUI/MixerGUI.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/MixerGUI.h 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/GUI/MixerGUI.h 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,69 @@ +/* SpiralSynth + * Copyright (C) 2000 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include "Widgets/Fl_Knob.H" + +#include "GUIBase.h" + +#ifndef MIXGUI +#define MIXGUI + +class MixerGUI : public GUIBase +{ +public: + MixerGUI(Mixer *o); + + virtual void CreateGUI(int xoff=0, int yoff=0, char *name=""); + virtual void UpdateValues(); + + Mixer *m_mix; + +private: + + Fl_Group *GUIMixGroup; + Fl_Check_Button *Add; + Fl_Check_Button *XMod; + Fl_Check_Button *Ring; + + Fl_Knob *Balance; + + //// Callbacks //// + + inline void cb_Balance_i(Fl_Knob* o, void* v); + static void cb_Balance(Fl_Knob*, void*); + inline void cb_XModAmount_i(Fl_Knob* o, void* v); + static void cb_XModAmount(Fl_Knob* o, void* v); + inline void cb_Add_i(Fl_Check_Button* o, void* v); + static void cb_Add(Fl_Check_Button*, void*); + inline void cb_Mult_i(Fl_Check_Button* o, void* v); + static void cb_Mult(Fl_Check_Button*, void*); + inline void cb_Sub_i(Fl_Check_Button* o, void* v); + static void cb_Sub(Fl_Check_Button* o, void* v); + inline void cb_XMod_i(Fl_Check_Button* o, void* v); + static void cb_XMod(Fl_Check_Button* o, void* v); + inline void cb_Ring_i(Fl_Check_Button* o, void* v); + static void cb_Ring(Fl_Check_Button* o, void* v); + + +}; + +#endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/ReverbGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/GUI/ReverbGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/ReverbGUI.C 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/GUI/ReverbGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,109 @@ +/* SpiralLoops + * Copyleft (C) 2000 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "ReverbGUI.h" + +static const int GUI_COLOUR = 154; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = FL_GRAY; + +ReverbGUI::ReverbGUI(Reverb *o) +{ + m_reverb=o; + if (!m_reverb) cerr<<"WARNING: Reverb not correctly set up"<type(1); + o->color(GUIBG2_COLOUR); + o->box(FL_UP_BOX); + o->labeltype(FL_ENGRAVED_LABEL); + o->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE); + o->user_data((void*)(this)); + + Time = new Fl_Knob(xoff+50, yoff+5, 40, 40, "Time"); + Time->color(GUI_COLOUR); + Time->labelsize(10); + Time->maximum(0.25); + Time->step(0.01); + Time->value(0.0); + Time->callback((Fl_Callback*)cb_Time); + + FeedBack = new Fl_Knob(xoff+100, yoff+5, 40, 40, "FeedBack"); + FeedBack->color(GUI_COLOUR); + FeedBack->labelsize(10); + FeedBack->maximum(1); + FeedBack->step(0.01); + FeedBack->value(0.01); + FeedBack->callback((Fl_Callback*)cb_Feedback); + + Randomness = new Fl_Knob(xoff+150, yoff+5, 40, 40, "Random"); + Randomness->color(GUI_COLOUR); + Randomness->labelsize(10); + Randomness->maximum(0.01); + Randomness->step(0.00001); + Randomness->value(0.002); + Randomness->callback((Fl_Callback*)cb_Randomness); + + Bypass = new Fl_Button(xoff+5, yoff+25, 40, 20, "Bypass"); + Bypass->color(GUIBG2_COLOUR); + Bypass->labelsize(10); + Bypass->type(1); + Bypass->value(1); + Bypass->callback((Fl_Callback*)cb_Bypass); + + o->end(); + +} + +void ReverbGUI::UpdateValues() +{ + Time->value(m_reverb->GetTime()); + FeedBack->value(m_reverb->GetFeedback()); + Randomness->value(m_reverb->GetRandomness()); + Bypass->value(m_reverb->IsBypassed()); +} + +//// Callbacks //// + +inline void ReverbGUI::cb_Time_i(Fl_Knob* o, void* v) +{ m_reverb->SetTime(o->value()); } +void ReverbGUI::cb_Time(Fl_Knob* o, void* v) +{ ((ReverbGUI*)(o->parent()->user_data()))->cb_Time_i(o,v); } + +inline void ReverbGUI::cb_Feedback_i(Fl_Knob* o, void* v) +{ m_reverb->SetFeedback(o->value()); } +void ReverbGUI::cb_Feedback(Fl_Knob* o, void* v) +{ ((ReverbGUI*)(o->parent()->user_data()))->cb_Feedback_i(o,v); } + +inline void ReverbGUI::cb_Randomness_i(Fl_Knob* o, void* v) +{ m_reverb->SetRandomness(o->value()); } +void ReverbGUI::cb_Randomness(Fl_Knob* o, void* v) +{ ((ReverbGUI*)(o->parent()->user_data()))->cb_Randomness_i(o,v); } + +inline void ReverbGUI::cb_Bypass_i(Fl_Button* o, void* v) +{ m_reverb->SetBypass(o->value()); } +void ReverbGUI::cb_Bypass(Fl_Button* o, void* v) +{ ((ReverbGUI*)(o->parent()->user_data()))->cb_Bypass_i(o,v); } diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/ReverbGUI.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/GUI/ReverbGUI.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/ReverbGUI.h 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/GUI/ReverbGUI.h 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,63 @@ +/* SpiralLoops + * Copyleft (C) 2000 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include "Widgets/Fl_Knob.H" + +#include "GUIBase.h" +#include "../SpiralSound/Reverb.h" + +#ifndef REVERBGUI +#define REVERBGUI + +class ReverbGUI : public GUIBase +{ +public: + ReverbGUI(Reverb *o); + ~ReverbGUI(); + + virtual void CreateGUI(int xoff, int yoff, char *name); + virtual void UpdateValues(); + Fl_Group* GetGroup() { return GUIReverbGroup; } + + Reverb *m_reverb; + +private: + + Fl_Group *GUIReverbGroup; + Fl_Knob *FeedBack; + Fl_Knob *Time; + Fl_Knob *Randomness; + Fl_Button *Bypass; + + //// Callbacks //// + + inline void cb_Time_i(Fl_Knob* o, void* v); + static void cb_Time(Fl_Knob*, void*); + inline void cb_Feedback_i(Fl_Knob* o, void* v); + static void cb_Feedback(Fl_Knob*, void*); + inline void cb_Randomness_i(Fl_Knob* o, void* v); + static void cb_Randomness(Fl_Knob*, void*); + inline void cb_Bypass_i(Fl_Button* o, void* v); + static void cb_Bypass(Fl_Button* o, void* v); +}; + +#endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_Knob.cxx spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_Knob.cxx --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_Knob.cxx 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_Knob.cxx 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,268 @@ +// generated by Fast Light User Interface Designer (fluid) version 2.00 + +#include "Fl_Knob.H" +#include +#include +#include + +Fl_Knob::Fl_Knob(int xx,int yy,int ww,int hh,const char *l): Fl_Valuator(xx,yy,ww,hh,l) { + a1 = 35; + a2 = 325; + _type = DOTLIN; + _percent = 0.3; + _scaleticks = 10; +} + +Fl_Knob::~Fl_Knob() { +} + +void Fl_Knob::draw() { + int ox,oy,ww,hh,side; +float sa,ca,a_r; +unsigned char rr,gg,bb; + + ox = x(); + oy = y(); + ww = w(); + hh = h(); + draw_label(); + fl_clip(ox,oy,ww,hh); + if (ww > hh) + { + side = hh; + ox = ox + (ww - side) / 2; + } + else + { + side = ww; + oy = oy + (hh - side) / 2; + } + side = w() > h () ? hh:ww; + int dam = damage(); + if (dam & FL_DAMAGE_ALL) + { + int col = parent()->color(); + fl_color(col); + fl_rectf(ox,oy,side,side); + Fl::get_color((Fl_Color)col,rr,gg,bb); + shadow(-60,rr,gg,bb); + fl_pie(ox+9,oy+9,side-12,side-12,0,360); + if (_type!=NONE) draw_scale(ox,oy,side); + col = color(); + Fl::get_color((Fl_Color)col,rr,gg,bb); + shadow(15,rr,gg,bb); + fl_pie(ox+6,oy+6,side-12,side-12,40,80); + shadow(30,rr,gg,bb); + fl_pie(ox+6,oy+6,side-12,side-12,80,220); + shadow(-15,rr,gg,bb); + fl_pie(ox+6,oy+6,side-12,side-12,220,260); + shadow(-30,rr,gg,bb); + fl_pie(ox+6,oy+6,side-12,side-12,260,400); + fl_color(FL_BLACK); + fl_arc(ox+6,oy+6,side-11,side-11,0,360); + fl_color(col); + fl_pie(ox+10,oy+10,side-20,side-20,0,360); + } + else + { + fl_color(color()); + fl_pie(ox+10,oy+10,side-20,side-20,0,360); + } + Fl::get_color((Fl_Color)color(),rr,gg,bb); + shadow(10,rr,gg,bb); + fl_pie(ox+10,oy+10,side-20,side-20,110,150); + fl_pie(ox+10,oy+10,side-20,side-20,290,330); + shadow(17,rr,gg,bb); + fl_pie(ox+10,oy+10,side-20,side-20,120,140); + fl_pie(ox+10,oy+10,side-20,side-20,300,320); + shadow(25,rr,gg,bb); + fl_pie(ox+10,oy+10,side-20,side-20,127,133); + fl_pie(ox+10,oy+10,side-20,side-20,307,313); + draw_cursor(ox,oy,side); + fl_pop_clip(); +} + +int Fl_Knob::handle(int event) { + int ox,oy,ww,hh; + + ox = x() + 10; oy = y() + 10; + ww = w() - 20; + hh = h()-20; + switch (event) + { + case FL_PUSH: + handle_push(); + case FL_DRAG: + { + int mx = Fl::event_x()-ox-ww/2; + int my = Fl::event_y()-oy-hh/2; + if (!mx && !my) return 1; + double angle = 270-atan2((float)-my, (float)mx)*180/M_PI; + double oldangle = (a2-a1)*(value()-minimum())/(maximum()-minimum()) + a1; + while (angle < oldangle-180) angle += 360; + while (angle > oldangle+180) angle -= 360; + double val; + if ((a1= a1)) + { + val = minimum(); + } + else + if ((a1= a2) : (angle <= a2)) + { + val = maximum(); + } + else + { + val = minimum() + (maximum()-minimum())*(angle-a1)/(a2-a1); + } + handle_drag(clamp(round(val))); + } + return 1; + case FL_RELEASE: + handle_release(); + return 1; + default: + return 0; + } + return 0; +} + +void Fl_Knob::type(int ty) { + _type = ty; +} + +void Fl_Knob::shadow(const int offs,const uchar r,uchar g,uchar b) { + int rr,gg,bb; + + rr = r + offs; + rr = rr > 255 ? 255:rr; + rr = rr < 0 ? 0:rr; + gg = g + offs; + gg = gg > 255 ? 255:gg; + gg = gg < 0 ? 0:gg; + bb = b + offs; + bb = bb > 255 ? 255:bb; + bb = bb < 0 ? 0:bb; + fl_color((uchar)rr,(uchar)gg,(uchar)bb); +} + +void Fl_Knob::draw_scale(const int ox,const int oy,const int side) { + float x1,y1,x2,y2,rds,cx,cy,ca,sa; + + rds = side / 2; + cx = ox + side / 2; + cy = oy + side / 2; + if (!(_type & DOTLOG_3)) + { + if (_scaleticks == 0) return; + double a_step = (10.0*3.14159/6.0) / _scaleticks; + double a_orig = -(3.14159/3.0); + for (int a = 0; a <= _scaleticks; a++) + { + double na = a_orig + a * a_step; + ca = cos(na); + sa = sin(na); + x1 = cx + rds * ca; + y1 = cy - rds * sa; + x2 = cx + (rds-6) * ca; + y2 = cy - (rds-6) * sa; + fl_color(FL_BLACK); + fl_line(x1,y1,x2,y2); + fl_color(FL_WHITE); + if (sa*ca >=0) + fl_line(x1+1,y1+1,x2+1,y2+1); + else + fl_line(x1+1,y1-1,x2+1,y2-1); + } + } + else + { + int nb_dec = (_type & DOTLOG_3); + for (int k = 0; k < nb_dec; k++) + { + double a_step = (10.0*3.14159/6.0) / nb_dec; + double a_orig = -(3.14159/3.0) + k * a_step; + for (int a = (k) ? 2:1; a <= 10; ) + { + double na = a_orig + log10((double)a) * a_step; + ca = cos(na); + sa = sin(na); + x1 = cx - rds * ca; + y1 = cy - rds * sa; + x2 = cx - (rds-6) * ca; + y2 = cy - (rds-6) * sa; + fl_color(FL_BLACK); + fl_line(x1,y1,x2,y2); + fl_color(FL_WHITE); + if (sa*ca <0) + fl_line(x1+1,y1+1,x2+1,y2+1); + else + fl_line(x1+1,y1-1,x2+1,y2-1); + if ((a == 1) || (nb_dec == 1)) + a += 1; + else + a += 2; + } + } + } +} + +void Fl_Knob::draw_cursor(const int ox,const int oy,const int side) { + float rds,cur,cx,cy; +double angle; + + rds = (side - 20) / 2.0; + cur = _percent * rds / 2; + cx = ox + side / 2; + cy = oy + side / 2; + angle = (a2-a1)*(value()-minimum())/(maximum()-minimum()) + a1; + fl_push_matrix(); + fl_scale(1,1); + fl_translate(cx,cy); + fl_rotate(-angle); + fl_translate(0,rds-cur-2.0); + if (_type 1.0) _percent = 1.0; + if (visible()) damage(FL_DAMAGE_CHILD); +} + +void Fl_Knob::scaleticks(const int tck) { + _scaleticks = tck; + if (_scaleticks < 0) _scaleticks = 0; + if (_scaleticks > 31) _scaleticks = 31; + if (visible()) damage(FL_DAMAGE_ALL); +} diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_Knob.fld spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_Knob.fld --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_Knob.fld 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_Knob.fld 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,280 @@ +# data file for the Fltk User Interface Designer (fluid) +version 2.00 +header_name {.H} +code_name {.cxx} +gridx 5 +gridy 5 +snap 3 +decl {\#include } {public +} + +decl {\#include } {} + +decl {\#include } {} + +class Fl_Knob {open : {public Fl_Valuator} +} { + decl {enum Fl_Knobtype {DOTLIN=0,DOTLOG_1,DOTLOG_2,DOTLOG_3,LINELIN,LINELOG_1,LINELOG_2,LINELOG_3};} {public + } + decl {int _type;} {} + decl {float _percent;} {} + decl {int _scaleticks;} {} + decl {short a1,a2;} {} + Function {Fl_Knob(int xx,int yy,int ww,int hh,const char *l=0): Fl_Valuator(xx,yy,ww,hh,l)} {} { + code {a1 = 35; + a2 = 325; + _type = DOTLIN; + _percent = 0.3; + _scaleticks = 10;} {} + } + Function {~Fl_Knob()} {} {} + Function {draw()} {open private + } { + code {int ox,oy,ww,hh,side; +float sa,ca,a_r; +unsigned char rr,gg,bb; + + ox = x(); + oy = y(); + ww = w(); + hh = h(); + draw_label(); + fl_clip(ox,oy,ww,hh); + if (ww > hh) + { + side = hh; + ox = ox + (ww - side) / 2; + } + else + { + side = ww; + oy = oy + (hh - side) / 2; + } + side = w() > h () ? hh:ww; + int dam = damage(); + if (dam & FL_DAMAGE_ALL) + { + int col = parent()->color(); + fl_color(col); + fl_rectf(ox,oy,side,side); + Fl::get_color((Fl_Color)col,rr,gg,bb); + shadow(-60,rr,gg,bb); + fl_pie(ox+9,oy+9,side-12,side-12,0,360); + draw_scale(ox,oy,side); + col = color(); + Fl::get_color((Fl_Color)col,rr,gg,bb); + shadow(15,rr,gg,bb); + fl_pie(ox+6,oy+6,side-12,side-12,40,80); + shadow(30,rr,gg,bb); + fl_pie(ox+6,oy+6,side-12,side-12,80,220); + shadow(-15,rr,gg,bb); + fl_pie(ox+6,oy+6,side-12,side-12,220,260); + shadow(-30,rr,gg,bb); + fl_pie(ox+6,oy+6,side-12,side-12,260,400); + fl_color(FL_BLACK); + fl_arc(ox+6,oy+6,side-11,side-11,0,360); + fl_color(col); + fl_pie(ox+10,oy+10,side-20,side-20,0,360); + } + else + { + fl_color(color()); + fl_pie(ox+10,oy+10,side-20,side-20,0,360); + } + Fl::get_color((Fl_Color)color(),rr,gg,bb); + shadow(10,rr,gg,bb); + fl_pie(ox+10,oy+10,side-20,side-20,110,150); + fl_pie(ox+10,oy+10,side-20,side-20,290,330); + shadow(17,rr,gg,bb); + fl_pie(ox+10,oy+10,side-20,side-20,120,140); + fl_pie(ox+10,oy+10,side-20,side-20,300,320); + shadow(25,rr,gg,bb); + fl_pie(ox+10,oy+10,side-20,side-20,127,133); + fl_pie(ox+10,oy+10,side-20,side-20,307,313); + draw_cursor(ox,oy,side); + fl_pop_clip();} {selected + } + } + Function {handle(int event)} {private return_type int + } { + code {int ox,oy,ww,hh; + + ox = x() + 10; oy = y() + 10; + ww = w() - 20; + hh = h()-20; + switch (event) + { + case FL_PUSH: + handle_push(); + case FL_DRAG: + { + int mx = Fl::event_x()-ox-ww/2; + int my = Fl::event_y()-oy-hh/2; + if (!mx && !my) return 1; + double angle = 270-atan2((float)-my, (float)mx)*180/M_PI; + double oldangle = (a2-a1)*(value()-minimum())/(maximum()-minimum()) + a1; + while (angle < oldangle-180) angle += 360; + while (angle > oldangle+180) angle -= 360; + double val; + if ((a1= a1)) + { + val = minimum(); + } + else + if ((a1= a2) : (angle <= a2)) + { + val = maximum(); + } + else + { + val = minimum() + (maximum()-minimum())*(angle-a1)/(a2-a1); + } + handle_drag(clamp(round(val))); + } + return 1; + case FL_RELEASE: + handle_release(); + return 1; + default: + return 0; + } + return 0;} {} + } + Function {type(int ty)} {} { + code {_type = ty;} {} + } + Function {shadow(const int offs,const uchar r,uchar g,uchar b)} {private + } { + code {int rr,gg,bb; + + rr = r + offs; + rr = rr > 255 ? 255:rr; + rr = rr < 0 ? 0:rr; + gg = g + offs; + gg = gg > 255 ? 255:gg; + gg = gg < 0 ? 0:gg; + bb = b + offs; + bb = bb > 255 ? 255:bb; + bb = bb < 0 ? 0:bb; + fl_color((uchar)rr,(uchar)gg,(uchar)bb);} {} + } + Function {draw_scale(const int ox,const int oy,const int side)} {private + } { + code {float x1,y1,x2,y2,rds,cx,cy,ca,sa; + + rds = side / 2; + cx = ox + side / 2; + cy = oy + side / 2; + if (!(_type & DOTLOG_3)) + { + if (_scaleticks == 0) return; + double a_step = (10.0*3.14159/6.0) / _scaleticks; + double a_orig = -(3.14159/3.0); + for (int a = 0; a <= _scaleticks; a++) + { + double na = a_orig + a * a_step; + ca = cos(na); + sa = sin(na); + x1 = cx + rds * ca; + y1 = cy - rds * sa; + x2 = cx + (rds-6) * ca; + y2 = cy - (rds-6) * sa; + fl_color(FL_BLACK); + fl_line(x1,y1,x2,y2); + fl_color(FL_WHITE); + if (sa*ca >=0) + fl_line(x1+1,y1+1,x2+1,y2+1); + else + fl_line(x1+1,y1-1,x2+1,y2-1); + } + } + else + { + int nb_dec = (_type & DOTLOG_3); + for (int k = 0; k < nb_dec; k++) + { + double a_step = (10.0*3.14159/6.0) / nb_dec; + double a_orig = -(3.14159/3.0) + k * a_step; + for (int a = (k) ? 2:1; a <= 10; ) + { + double na = a_orig + log10((double)a) * a_step; + ca = cos(na); + sa = sin(na); + x1 = cx - rds * ca; + y1 = cy - rds * sa; + x2 = cx - (rds-6) * ca; + y2 = cy - (rds-6) * sa; + fl_color(FL_BLACK); + fl_line(x1,y1,x2,y2); + fl_color(FL_WHITE); + if (sa*ca <0) + fl_line(x1+1,y1+1,x2+1,y2+1); + else + fl_line(x1+1,y1-1,x2+1,y2-1); + if ((a == 1) || (nb_dec == 1)) + a += 1; + else + a += 2; + } + } + }} {} + } + Function {draw_cursor(const int ox,const int oy,const int side)} {private + } { + code {float rds,cur,cx,cy; +double angle; + + rds = (side - 20) / 2.0; + cur = _percent * rds / 2; + cx = ox + side / 2; + cy = oy + side / 2; + angle = (a2-a1)*(value()-minimum())/(maximum()-minimum()) + a1; + fl_push_matrix(); + fl_scale(1,1); + fl_translate(cx,cy); + fl_rotate(-angle); + fl_translate(0,rds-cur-2.0); + if (_type 1.0) _percent = 1.0; + if (visible()) damage(FL_DAMAGE_CHILD);} {} + } + Function {scaleticks(const int tck)} {} { + code {_scaleticks = tck; + if (_scaleticks < 0) _scaleticks = 0; + if (_scaleticks > 31) _scaleticks = 31; + if (visible()) damage(FL_DAMAGE_ALL);} {} + } +} diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_Knob.H spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_Knob.H --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_Knob.H 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_Knob.H 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,33 @@ +// generated by Fast Light User Interface Designer (fluid) version 2.00 + +#ifndef Fl_Knob_H +#define Fl_Knob_H +#include +#include +#include + +class Fl_Knob : public Fl_Valuator { +public: + enum Fl_Knobtype {DOTLIN=0,DOTLOG_1,DOTLOG_2,DOTLOG_3,LINELIN,LINELOG_1,LINELOG_2,LINELOG_3,NONE}; +private: + int _type; + float _percent; + int _scaleticks; + short a1,a2; +public: + Fl_Knob(int xx,int yy,int ww,int hh,const char *l=0); + ~Fl_Knob(); +private: + void draw(); + int handle(int event); +public: + void type(int ty); +private: + void shadow(const int offs,const uchar r,uchar g,uchar b); + void draw_scale(const int ox,const int oy,const int side); + void draw_cursor(const int ox,const int oy,const int side); +public: + void cursor(const int pc); + void scaleticks(const int tck); +}; +#endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_LED_Button.cxx spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_LED_Button.cxx --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_LED_Button.cxx 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_LED_Button.cxx 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,63 @@ +// generated by Fast Light User Interface Designer (fluid) version 2.00 + +#include "Fl_LED_Button.H" +#include + +Fl_LED_Button::Fl_LED_Button(int x, int y, int w, int h, const char* l):Fl_Light_Button(x,y,w,h,l) { + box(FL_NO_BOX); + down_box(FL_ROUND_DOWN_BOX); + selection_color(FL_RED); +} + +Fl_LED_Button::~Fl_LED_Button() { +} + +void Fl_LED_Button::draw() { + uchar r,g,b; + + //if (box()) draw_box(this==Fl::pushed() ? down(box()) : box(), color()); + Fl_Color col = value() ? selection_color() : color(); + Fl::get_color((Fl_Color)selection_color(),r,g,b); + int d = h()/6; + int W = w()color(),r,g,b); + modulate(-90,r,g,b); + fl_pie(x1-1,y1-1,ww+2,hh+2,0,360); + Fl::get_color((Fl_Color)selection_color(),r,g,b); + if (value()) modulate(-90,r,g,b); else modulate(-210,r,g,b); + fl_pie(x1,y1,ww,hh,0,360); + if (value()) modulate(-60,r,g,b); else modulate(-190,r,g,b); + fl_pie(x1+1,y1+1,ww-2,hh-2,0,360); + if (value()) modulate(-20,r,g,b); else modulate(-150,r,g,b); + fl_pie(x1+1,y1+1,ww-3,hh-3,0,360); + if (value()) modulate(0,r,g,b); else modulate(-130,r,g,b); + fl_pie(x1+3,y1+3,ww-5,hh-5,0,360); + if (value()) modulate(160,r,g,b); else modulate(-30,r,g,b); + fl_arc(x1+3,y1+3,ww-5,hh-5,250,350); + if (value()) modulate(250,r,g,b); else modulate(100,r,g,b); + fl_pie((int)(x1+ww/2-(0.3*ww)/2),(int)(y1+ww/2-(0.3*ww)/2), + (int)((0.45*ww)/2),(int)((0.45*ww)/2),0,360); + fl_color(FL_BLACK); + fl_arc(x1,y1,ww+1,hh+1,0,360); + draw_label(x()+W-d, y(), w()-W+d, h());//,labelcolor()); +} + +void Fl_LED_Button::modulate(const int offs,const uchar r,uchar g,uchar b) { + int rr,gg,bb; + + rr = r + offs; + rr = rr > 255 ? 255:rr; + rr = rr < 0 ? 0:rr; + gg = g + offs; + gg = gg > 255 ? 255:gg; + gg = gg < 0 ? 0:gg; + bb = b + offs; + bb = bb > 255 ? 255:bb; + bb = bb < 0 ? 0:bb; + fl_color((uchar)rr,(uchar)gg,(uchar)bb); +} diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_LED_Button.fld spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_LED_Button.fld --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_LED_Button.fld 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_LED_Button.fld 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,74 @@ +# data file for the Fltk User Interface Designer (fluid) +version 2.00 +header_name {.H} +code_name {.cxx} +gridx 5 +gridy 5 +snap 3 +decl {\#include } {} + +decl {\#include } {public +} + +class Fl_LED_Button {open : {public Fl_Light_Button} +} { + Function {Fl_LED_Button(int x, int y, int w, int h, const char* l=0):Fl_Light_Button(x,y,w,h,l)} {open + } { + code {box(FL_NO_BOX); + down_box(FL_ROUND_DOWN_BOX); + selection_color(FL_RED);} {} + } + Function {~Fl_LED_Button()} {open + } {} + Function {draw()} {open private + } { + code {uchar r,g,b; + + if (box()) draw_box(this==Fl::pushed() ? down(box()) : box(), color()); + Fl_Color col = value() ? selection_color() : color(); + Fl::get_color((Fl_Color)selection_color(),r,g,b); + int d = h()/6; + int W = w()color(),r,g,b); + modulate(-90,r,g,b); + fl_pie(x1-1,y1-1,ww+2,hh+2,0,360); + Fl::get_color((Fl_Color)selection_color(),r,g,b); + if (value()) modulate(-90,r,g,b); else modulate(-210,r,g,b); + fl_pie(x1,y1,ww,hh,0,360); + if (value()) modulate(-60,r,g,b); else modulate(-190,r,g,b); + fl_pie(x1+1,y1+1,ww-2,hh-2,0,360); + if (value()) modulate(-20,r,g,b); else modulate(-150,r,g,b); + fl_pie(x1+1,y1+1,ww-3,hh-3,0,360); + if (value()) modulate(0,r,g,b); else modulate(-130,r,g,b); + fl_pie(x1+3,y1+3,ww-5,hh-5,0,360); + if (value()) modulate(160,r,g,b); else modulate(-30,r,g,b); + fl_arc(x1+3,y1+3,ww-5,hh-5,250,350); + if (value()) modulate(250,r,g,b); else modulate(100,r,g,b); + fl_pie((int)(x1+ww/2-(0.3*ww)/2),(int)(y1+ww/2-(0.3*ww)/2), + (int)((0.45*ww)/2),(int)((0.45*ww)/2),0,360); + fl_color(FL_BLACK); + fl_arc(x1,y1,ww+1,hh+1,0,360); + draw_label(x()+W-d, y(), w()-W+d, h(),labelcolor());} {selected + } + } + Function {modulate(const int offs,const uchar r,uchar g,uchar b)} {open private + } { + code {int rr,gg,bb; + + rr = r + offs; + rr = rr > 255 ? 255:rr; + rr = rr < 0 ? 0:rr; + gg = g + offs; + gg = gg > 255 ? 255:gg; + gg = gg < 0 ? 0:gg; + bb = b + offs; + bb = bb > 255 ? 255:bb; + bb = bb < 0 ? 0:bb; + fl_color((uchar)rr,(uchar)gg,(uchar)bb);} {} + } +} diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_LED_Button.H spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_LED_Button.H --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_LED_Button.H 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_LED_Button.H 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,17 @@ +// generated by Fast Light User Interface Designer (fluid) version 2.00 + +#ifndef Fl_LED_Button_H +#define Fl_LED_Button_H +#include +#include +#include + +class Fl_LED_Button : public Fl_Light_Button { +public: + Fl_LED_Button(int x, int y, int w, int h, const char* l=0); + ~Fl_LED_Button(); +private: + void draw(); + void modulate(const int offs,const uchar r,uchar g,uchar b); +}; +#endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_Loop.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_Loop.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_Loop.C 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_Loop.C 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,410 @@ +/* LoopWidget + * Copyleft (C) 2000 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "Fl_Loop.h" +#include +#include +#include +#include + +///////////////////////////////////////////////////////////////////////////// + +static const int REZ = 1000; +static const float RADCONV = 0.017453292; +static const int INDW = 3; // indicator width +static const int UPDATECYCLES = 4; + +static const int POSMARKER_MAX = 50; + +Fl_Loop::Fl_Loop(int x, int y, int w, int h, const char* label) : +Fl_Group(x,y,w,h,label), +m_data(NULL), +m_MainWin(NULL), +m_Length(1000), +m_InnerRad((int)(w/2*0.75f)), +m_OuterRad((int)(w/2*0.95f)), +m_BorderRad(w/2), +m_IndSX(0), +m_IndSY(0), +m_IndEX(0), +m_IndEY(0), +m_StartAngle(0), +m_EndAngle(1), +m_MoveAngle(0.0f), +m_RangeStart(0), +m_RangeEnd(0), +m_Angle(0), +m_Pos(NULL), +m_Update(false), +m_StopUpdate(false), +m_WaveSize(1.0f), +m_Move(0), +m_LastMove(0), +m_Snap(false), +m_SnapDegrees(45), +m_PosMarkerCount(0) +{ + m_MidX=(w/2)+x; + m_MidY=(h/2)+y-20; +} + +void Fl_Loop::SetupCopyBufFuncs(cb_CopyBuf1 *Cut, + cb_CopyBuf1 *Copy, + cb_CopyBuf2 *Paste, + cb_CopyBuf2 *PasteMix, + cb_CopyBuf1 *ZeroRange, + cb_CopyBuf1 *ReverseRange, + cb_CopyBuf1 *Halve, + cb_CopyBuf1 *Hold, + cb_CopyBuf1 *SelectAll, + cb_CopyBuf1 *NewTrigger, + cb_CopyBuf1 *Move) + +{ + cb_Cut = Cut; + cb_Copy = Copy; + cb_Paste = Paste; + cb_PasteMix = PasteMix; + cb_ZeroRange = ZeroRange; + cb_ReverseRange = ReverseRange; + cb_Halve = Halve; + cb_Hold = Hold; + cb_SelectAll = SelectAll; + cb_NewTrigger = NewTrigger; + cb_Move = Move; +} + + + +void Fl_Loop::SetLength(const int Len) +{ + m_Length=Len; + + // recalc start and end points + m_RangeStart=(int)(m_StartAngle*(m_Length/360.0f)); + while (m_RangeStart < 0) m_RangeStart += m_Length; + while (m_RangeStart > m_Length) m_RangeStart -= m_Length; + + m_RangeEnd=(int)(m_EndAngle*(m_Length/360.0f)); + while (m_RangeEnd < 0) m_RangeEnd += m_Length; + while (m_RangeEnd > m_Length) m_RangeEnd -= m_Length; +} + +void Fl_Loop::DrawWav() +{ + int Thickness=(m_OuterRad-m_InnerRad)/2; + int n=0,X=0,Y=0,ox=0,oy=0, c=0, skip=0; + bool FirstTime=true; + float Angle=0; + float Sample=0; + float SampleAngle=360.0f/(float)(REZ); + + skip=m_Length/REZ; + if (skip<1) skip=1; + + fl_color(100,155,100); + + while(m_Length>0 && n1) Sample=1; + if (Sample<-1) Sample=-1; + } + + Angle=c*SampleAngle; + + ox=X; + oy=Y; + + float pos=Sample*Thickness+m_InnerRad+Thickness; + + X=(int)(m_MidX+x()+sin(Angle*RADCONV)*pos); + Y=(int)(m_MidY+y()+cos(Angle*RADCONV)*pos); + + if (Angle>m_StartAngle && Anglevisible() || !parent()->visible()) return; + window()->make_current(); + + if (m_Pos) + { + float Angle=(*m_Pos/m_Length)*360.0; + fl_line_style(FL_SOLID, 3, NULL); +#if !__APPLE__ + XSetFunction(fl_display,fl_gc,GXxor); +#endif + fl_line(m_IndSX,m_IndSY,m_IndEX,m_IndEY); + + fl_color(FL_BLUE); + + m_IndSX=(int)(m_MidX+x()+sin(Angle*RADCONV)*m_InnerRad); + m_IndSY=(int)(m_MidY+y()+cos(Angle*RADCONV)*m_InnerRad); + m_IndEX=(int)(m_MidX+x()+sin(Angle*RADCONV)*m_OuterRad); + m_IndEY=(int)(m_MidY+y()+cos(Angle*RADCONV)*m_OuterRad); + + + fl_line(m_IndSX,m_IndSY,m_IndEX,m_IndEY); + fl_line_style(FL_SOLID, 1, NULL); +#if !__APPLE__ + XSetFunction(fl_display,fl_gc,GXcopy); +#endif + } + + if (m_PosMarkerCount>POSMARKER_MAX) + { + redraw(); + m_PosMarkerCount=0; + } + + m_PosMarkerCount++; + + //Last->make_current(); +} + +void Fl_Loop::DrawWidgets() +{ + Fl_Group::draw(); +} + +void Fl_Loop::DrawEveryThing() +{ + if (damage() & (FL_DAMAGE_EXPOSE|FL_DAMAGE_ALL)) + { + if (m_PosMarkerCount>POSMARKER_MAX) + { + m_PosMarkerCount=0; + } + + fl_color(color()); + fl_rectf(x(),y(),w(),h()); + + m_InnerRad-=5; + m_OuterRad+=5; + fl_color(20,60,20); + fl_pie(m_MidX+x()-m_OuterRad, m_MidY+y()-m_OuterRad, m_OuterRad*2, m_OuterRad*2, 0, 360); + fl_color(color()); + fl_pie(m_MidX+x()-m_InnerRad, m_MidY+y()-m_InnerRad, m_InnerRad*2, m_InnerRad*2, 0, 360); + m_OuterRad-=5; + m_InnerRad+=5; + + DrawWav(); + } + + DrawWidgets(); +} + +void Fl_Loop::draw() +{ + DrawEveryThing(); +} + +int Fl_Loop::handle(int event) +{ + static int LastButtonPushed=0; + + // call base + if (!Fl_Group::handle(event)) + { + switch (event) + { + case FL_PUSH: + LastButtonPushed=Fl::event_button(); + // fall through + case FL_DRAG: + { + int mx = Fl::event_x()-(m_MidX+x()); + int my = Fl::event_y()-(m_MidY+y()); + if (!mx && !my) break; + + double angle = 90+atan2((float)-my, (float)mx)*180/M_PI; + while (angle < m_Angle-180) angle += 360; + while (angle > m_Angle+180) angle -= 360; + + while (angle < 0) angle += 360; + while (angle > 360) angle -= 360; + + m_Angle=angle; + + // snap + if (m_Snap) + { + m_Angle-=(int)m_Angle%m_SnapDegrees; + } + + if (LastButtonPushed==2) + { + if (m_Pos) + { + *m_Pos=m_Angle*(m_Length/360.0f); + + while (*m_Pos < 0) *m_Pos += m_Length; + while (*m_Pos > m_Length) *m_Pos -= m_Length; + } + } + else if (LastButtonPushed==1) + { + switch (event) + { + case FL_PUSH: + { + m_StartAngle=m_Angle; + m_EndAngle=m_Angle; + redraw(); + } + break; + + case FL_DRAG: + { + if (m_Angle>m_StartAngle) + { + m_EndAngle=m_Angle; + } + else + { + m_StartAngle=m_Angle; + } + redraw(); + } + break; + } + + // convert angle to sample data + m_RangeStart=(int)(m_StartAngle*(m_Length/360.0f)); + while (m_RangeStart < 0) m_RangeStart += m_Length; + while (m_RangeStart > m_Length) m_RangeStart -= m_Length; + + m_RangeEnd=(int)(m_EndAngle*(m_Length/360.0f)); + while (m_RangeEnd < 0) m_RangeEnd += m_Length; + while (m_RangeEnd > m_Length) m_RangeEnd -= m_Length; + + }else if (LastButtonPushed==3) + { + switch (event) + { + case FL_PUSH: + { + m_MoveAngle=m_Angle; + + // reset the last + // convert angle to sample data + m_LastMove=(int)(m_MoveAngle*(m_Length/360.0f)); + while (m_LastMove < 0) m_LastMove += m_Length; + while (m_LastMove > m_Length) m_Move -= m_Length; + } + break; + + case FL_DRAG: + { + m_MoveAngle=m_Angle; + redraw(); + } + break; + } + + // convert angle to sample data + m_Move=(int)(m_MoveAngle*(m_Length/360.0f)); + while (m_Move < 0) m_Move += m_Length; + while (m_Move > m_Length) m_Move -= m_Length; + + // do the move + cb_Move(this,m_LastMove-m_Move,0); + + m_LastMove=m_Move; + } + } + break; + + case FL_RELEASE: + break; + + case FL_KEYBOARD: + case FL_SHORTCUT: + { + if (Fl::event_key(FL_Control_L) || Fl::event_key(FL_Control_R)) + { + if (Fl::event_key('c')) cb_Copy(this,m_RangeStart,m_RangeEnd); + if (Fl::event_key('v')) cb_Paste(this,m_RangeStart); + if (Fl::event_key('x')) cb_Cut(this,m_RangeStart,m_RangeEnd); + if (Fl::event_key('b')) cb_PasteMix(this,m_RangeStart); + if (Fl::event_key('z')) cb_ZeroRange(this,m_RangeStart,m_RangeEnd); + if (Fl::event_key('r')) cb_ReverseRange(this,m_RangeStart,m_RangeEnd); + if (Fl::event_key('h')) cb_Halve(this,0,0); + if (Fl::event_key('s')) cb_Hold(this,0,0); + if (Fl::event_key('a')) + { + m_StartAngle=0.0f; + m_RangeStart=0; + m_EndAngle=360.0f; + m_RangeEnd=m_Length; + redraw(); + } + if (Fl::event_key('t')) cb_NewTrigger(this,0,0); + // move? + } + } + break; + + default: + return 0; + } + + } + return 1; +} diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_Loop.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_Loop.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_Loop.h 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_Loop.h 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,115 @@ +/* SpiralLoops + * Copyleft (C) 2000 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include + +#ifndef LOOPWIDGET +#define LOOPWIDGET + +class Fl_Loop : public Fl_Group +{ +public: + Fl_Loop(int x, int y, int w, int h, const char* label=0); + + virtual void draw(); + virtual int handle(int event); + + void SetData(float const *set) {m_data=set;} + void SetLength(const int Len); + void SetPos(float *p) {m_Pos=p;} + void SetUpdate(bool p) {m_Update=p;} + void StopUpdate(bool p) {m_StopUpdate=p;} + void SetWaveSize(float s) {m_WaveSize=s;} + void SetMainWin(Fl_Window *s) {m_MainWin=s;} + void SetIdle(); + void UnsetIdle(); + void DrawWav(); + void DrawWidgets(); + void DrawEveryThing(); + void DrawPosMarker(); + void SetSnap(bool s) {m_Snap=s;} + void SetSnapAngle(int s) {m_SnapDegrees=s;} + + typedef void (cb_CopyBuf1)(Fl_Loop *, int, int); + typedef void (cb_CopyBuf2)(Fl_Loop *, int); + + void SetupCopyBufFuncs(cb_CopyBuf1 *Cut, + cb_CopyBuf1 *Copy, + cb_CopyBuf2 *Paste, + cb_CopyBuf2 *PasteMix, + cb_CopyBuf1 *cb_ZeroRange, + cb_CopyBuf1 *cb_ReverseRange, + cb_CopyBuf1 *cb_Halve, + cb_CopyBuf1 *cb_Hold, + cb_CopyBuf1 *cb_SelectAll, + cb_CopyBuf1 *cb_NewTrigger, + cb_CopyBuf1 *cb_Move); + + int GetX() {return x();} + int GetY() {return y();} + int GetW() {return w();} + int GetH() {return h();} + +private: + + float const *m_data; + + Fl_Window *m_MainWin; + + int m_Length; + int m_InnerRad; + int m_OuterRad; + int m_BorderRad; + int m_IndSX,m_IndSY,m_IndEX,m_IndEY; + int m_MidX,m_MidY; + + float m_StartAngle; + float m_EndAngle; + float m_MoveAngle; + int m_RangeStart; + int m_RangeEnd; + float m_Angle; + float *m_Pos; + bool m_Update; + bool m_StopUpdate; + float m_WaveSize; + int m_Move; + int m_LastMove; + bool m_Snap; + int m_SnapDegrees; + int m_PosMarkerCount; + + static void cb_Idle(void* o); + + cb_CopyBuf1 *cb_Cut; + cb_CopyBuf1 *cb_Copy; + cb_CopyBuf2 *cb_Paste; + cb_CopyBuf2 *cb_PasteMix; + cb_CopyBuf1 *cb_ZeroRange; + cb_CopyBuf1 *cb_ReverseRange; + cb_CopyBuf1 *cb_Halve; + cb_CopyBuf1 *cb_Hold; + cb_CopyBuf1 *cb_SelectAll; + cb_CopyBuf1 *cb_NewTrigger; + cb_CopyBuf1 *cb_Move; + +}; + +#endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_Trigger.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_Trigger.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_Trigger.C 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_Trigger.C 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,202 @@ +/* TriggerWidget + * Copyleft (C) 2000 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "Fl_Trigger.h" +#include +#include +#include +#include +#include "Fl_Loop.h" + +///////////////////////////////////////////////////////////////////////////// + +static const float RADCONV = 0.017453292; + +Fl_Trigger::Fl_Trigger(int x, int y, int w, int h, const char* label) : +Fl_Widget(x,y,w,h,label), +m_ID(0), +m_CentreX(0), +m_CentreY(0), +m_CentreRadius(0), +m_Dragging(false), +m_Loop(0), +m_Passes(0), +m_Count(0), +m_Angle(0), +m_MaxLoops(10), +m_MaxPasses(10), +m_Snap(false), +m_SnapDegrees(45) +{ +} + +void Fl_Trigger::draw() +{ + x((int)((sin(m_Angle*RADCONV)*m_CentreRadius)+m_CentreX-w()/2)); + y((int)((cos(m_Angle*RADCONV)*m_CentreRadius)+m_CentreY-h()/2)); + + fl_font(fl_font(),8); + + fl_color(255,255,255); + fl_arc(x(), y(), w(), h(), 0, 360); + + int cx=x()+w()/2; + int cy=y()+h()/2; + + char text[32]; + //sprintf(text,"%d",m_Loop); + //fl_draw(text, cx-2, cy-h()+5); + + //sprintf(text,"%d",m_Passes); + //fl_draw(text, cx+w()-5, cy+3); + + sprintf(text,"%d",m_ID); + fl_draw(text, cx, cy); + + //char t[32]; + //sprintf(t,"%d",m_Count); + //fl_draw(t, cx-2, cy-h()+5); +} + +int Fl_Trigger::handle(int event) +{ + static int LastButtonPushed=0; + + // call base + if (!Fl_Widget::handle(event)) + { + int ww,hh; + + ww = w(); + hh = h(); + + int mx = Fl::event_x(); + int my = Fl::event_y(); + + switch (event) + { + case FL_PUSH: + LastButtonPushed=Fl::event_button(); + + if (LastButtonPushed==1) + { + if (sqrt((float)(mx-x()*my-y()))7) + { + m_ID=0; + } + redraw(); + Fl_Loop *p=(Fl_Loop*)parent(); + p->DrawEveryThing(); + p->redraw(); + } + + if (LastButtonPushed==3) + { + /*m_Passes++; + if (m_Passes>m_MaxPasses) + { + m_Passes=0; + } + redraw(); + Fl_Loop *p=(Fl_Loop*)parent(); + p->DrawEveryThing(); + p->redraw();*/ + } + + // fall through + + case FL_DRAG: + { + if (LastButtonPushed==2) + { + + } + else if (LastButtonPushed==1) + { + if (m_Dragging) + { + int px = mx-m_CentreX; + int py = my-m_CentreY; + + double angle = 90+atan2((float)-py, (float)px)*180/M_PI; + while (angle < m_Angle-180) angle += 360; + while (angle > m_Angle+180) angle -= 360; + + while (angle < 0) angle += 360; + while (angle > 360) angle -= 360; + + m_Angle=angle; + + // snap + if (m_Snap) + { + m_Angle-=(int)m_Angle%m_SnapDegrees; + } + + redraw(); + } + } + else if (LastButtonPushed==3) + { + + } + } + break; + + case FL_RELEASE: + { + m_Dragging=false; + Fl_Loop *p=(Fl_Loop*)parent(); + p->DrawEveryThing(); + p->redraw(); + } + break; + + default: + return 0; + } + + } + return 1; +} + +istream &operator>>(istream &s, Fl_Trigger &o) +{ + s>>o.m_CentreX>>o.m_CentreY>>o.m_CentreRadius>>o.m_Dragging>>o.m_ID>>o.m_Passes>> + o.m_Count>>o.m_Angle>>o.m_MaxLoops>>o.m_MaxPasses; + + return s; +} + +ostream &operator<<(ostream &s, Fl_Trigger &o) +{ + s< + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + + +#include +#include +#include + +#ifndef TRIGGERWIDGET +#define TRIGGERWIDGET + +using namespace std; + +class Fl_Trigger : public Fl_Widget +{ +public: + Fl_Trigger(int x, int y, int w, int h, const char* label=0); + + virtual void draw(); + virtual int handle(int event); + + void SetID(int s) {m_ID=s;} + int GetID() { return m_ID;} + void SetCentreX(int s) {m_CentreX=s;} + void SetCentreY(int s) {m_CentreY=s;} + void SetCentreRadius(int s) {m_CentreRadius=s;} + void IncCount() + { + m_Count++; if (m_Count>m_Passes) m_Count=0; + } + bool Completed() {return (m_Count==m_Passes); } + + float GetAngle() {return m_Angle;} + int GetLoop() {return m_Loop;} + int GetPass() {return m_Passes;} + void SetSnap(bool s) {m_Snap=s;} + void SetSnapAngle(int s) {m_SnapDegrees=s;} + +private: + + int m_ID; + int m_CentreX; + int m_CentreY; + int m_CentreRadius; + + bool m_Dragging; + int m_Loop; + int m_Passes; + int m_Count; + + float m_Angle; + + int m_MaxLoops; + int m_MaxPasses; + + bool m_Snap; + int m_SnapDegrees; + + friend istream &operator>>(istream &s, Fl_Trigger &o); + friend ostream &operator<<(ostream &s, Fl_Trigger &o); +}; + +istream &operator>>(istream &s, Fl_Trigger &o); +ostream &operator<<(ostream &s, Fl_Trigger &o); + +#endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/Makefile.in 2004-01-17 10:32:43.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -15,9 +15,6 @@ MOC = moc UIC = -TAR = tar -cf -GZIP = gzip -9f - INSTALL = @INSTALL@ ###### Autoconf variables @@ -47,7 +44,8 @@ ../../RiffWav.h \ Fl_Loop.h \ Fl_Trigger.h \ - ../Widgets/Fl_Knob.H \ + ../GUI/WaveChooser.h \ + ../Widgets/Fl_Knob.H \ ../Widgets/Fl_LED_Button.H \ ../../../GUI/Widgets/SpiralGUI.H SOURCES = SpiralLoopPlugin.C \ @@ -59,6 +57,7 @@ ../../RiffWav.C \ Fl_Loop.C \ Fl_Trigger.C \ + ../GUI/WaveChooser.C \ ../Widgets/Fl_Knob.cxx \ ../Widgets/Fl_LED_Button.cxx \ ../../../GUI/Widgets/SpiralGUI.C @@ -71,6 +70,7 @@ ../../RiffWav.o \ Fl_Loop.o \ Fl_Trigger.o \ + ../GUI/WaveChooser.o \ ../Widgets/Fl_Knob.o \ ../Widgets/Fl_LED_Button.o \ ../../../GUI/Widgets/SpiralGUI.o @@ -110,13 +110,6 @@ moc: $(SRCMOC) -tmake: - tmake SpiralLoopPlugin.pro - -dist: - $(TAR) SpiralLoopPlugin.tar SpiralLoopPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) SpiralLoopPlugin.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core @@ -163,6 +156,9 @@ Fl_Trigger.h \ Fl_Loop.h +../GUI/WaveChooser.o: ../GUI/WaveChooser.C \ + ../GUI/WaveChooser.h + SpiralLoopPlugin.o: SpiralLoopPlugin.C \ SpiralLoopPlugin.h \ ../SpiralPlugin.h \ diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/SpiralLoopPlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/SpiralLoopPlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/SpiralLoopPlugin.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/SpiralLoopPlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -122,6 +122,14 @@ this,m_AudioCH,m_HostInfo); } +void SpiralLoopPlugin::Reset() +{ + ResetPorts(); + m_TickOutput=-m_TickOutput; + m_TickTime=m_StoreBuffer.GetLength()/m_TicksPerLoop; + m_TickCurrent=0; +} + void SpiralLoopPlugin::Execute() { if (InputExists(0)) SetRecordingSource(GetInput(0)->GetBuffer()); diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/SpiralLoopPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/SpiralLoopPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/SpiralLoopPluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/SpiralLoopPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -18,7 +18,9 @@ #include "SpiralLoopPluginGUI.h" #include -#include +#include +#include +#include "../GUI/WaveChooser.h" using namespace std; @@ -347,8 +349,7 @@ inline void SpiralLoopPluginGUI::cb_Load_i(Fl_Button* o, void* v) { - char *fn=fl_file_chooser("Load a sample", "{*.wav,*.WAV}", NULL); - + char *fn=WaveFileName (); if (fn && fn!='\0') { strcpy(m_TextBuf,fn); @@ -366,13 +367,12 @@ inline void SpiralLoopPluginGUI::cb_Save_i(Fl_Button* o, void* v) { char *fn=fl_file_chooser("Load a sample", "{*.wav,*.WAV}", NULL); - if (fn && fn!='\0') { strcpy(m_TextBuf,fn); m_GUICH->SetData("Name",m_TextBuf); m_GUICH->SetCommand(SpiralLoopPlugin::SAVE); - } + } } void SpiralLoopPluginGUI::cb_Save(Fl_Button* o, void* v) { ((SpiralLoopPluginGUI*)(o->parent()->parent()))->cb_Save_i(o,v); } diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/SpiralLoopPlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/SpiralLoopPlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/SpiralLoopPlugin.h 2003-08-08 17:55:52.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/SpiralLoopPlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -55,6 +55,8 @@ virtual PluginInfo &Initialise(const HostInfo *Host); virtual SpiralGUIType *CreateGUI(); virtual void Execute(); + virtual void Reset(); + virtual void ExecuteCommands(); virtual void StreamOut(std::ostream &s); virtual void StreamIn(std::istream &s); diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/SpiralLoopPlugin.pro spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/SpiralLoopPlugin.pro --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/SpiralLoopPlugin.pro 2002-07-28 23:18:17.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/SpiralLoopPlugin.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,45 +0,0 @@ -HEADERS = ../SpiralPlugin.h \ - ../SpiralPluginGUI.h \ - ../Widgets/Fl_Knob.H \ - ../Widgets/Fl_DragBar.H \ - ../../Sample.h \ - ../../RiffWav.h \ - SpiralSound/Delay.h \ - SpiralSound/Filter.h \ - SpiralSound/Reverb.h \ - SpiralSound/iir_filter.h \ - GUI/DelayGUI.h \ - GUI/FilterGUI.h \ - GUI/GUIBase.h \ - GUI/LoopGUI.h \ - GUI/ReverbGUI.h \ - GUI/Widgets/Fl_LED_Button.H \ - GUI/Widgets/Fl_Loop.h \ - GUI/Widgets/Fl_Trigger.h \ - Loop.h \ - SpiralLoopPlugin.h \ - SpiralLoopPluginGUI.h - -SOURCES = ../SpiralPlugin.C \ - ../SpiralPluginGUI.C \ - ../Widgets/Fl_Knob.cxx \ - ../Widgets/Fl_DragBar.cxx \ - ../../Sample.C \ - ../../RiffWav.C \ - SpiralSound/Delay.C \ - SpiralSound/Filter.C \ - SpiralSound/Reverb.C \ - SpiralSound/iir_filter.C \ - GUI/DelayGUI.C \ - GUI/FilterGUI.C \ - GUI/GUIBase.C \ - GUI/LoopGUI.C \ - GUI/ReverbGUI.C \ - GUI/Widgets/Fl_LED_Button.cxx \ - GUI/Widgets/Fl_Loop.C \ - GUI/Widgets/Fl_Trigger.C \ - Loop.C \ - SpiralLoopPlugin.C \ - SpiralLoopPluginGUI.C - -TARGET = SpiralLoopPlugin.so diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/SpiralSound/Delay.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/SpiralSound/Delay.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/SpiralSound/Delay.C 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/SpiralSound/Delay.C 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,93 @@ +/* SpiralSynth + * Copyleft (C) 2000 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +// Stereo module + +#include "Delay.h" +#include "../../../Sample.h" + +static const int DELAYBUFFERSIZE=44100; + +Delay::Delay() : +m_LeftBuffer(DELAYBUFFERSIZE), +m_RightBuffer(DELAYBUFFERSIZE), +m_LeftWrite(0), +m_RightWrite(0), +m_LeftDelay(0.5), +m_RightDelay(0.5), +m_Feedback(0.5), +m_Channels(1), +m_Bypass(true) +{ +} + +Delay::~Delay() +{ +} + +void Delay::GetOutput(Sample &data) +{ + if (m_Bypass) return; + + int n=0; + long RLength=static_cast(m_RightDelay*(DELAYBUFFERSIZE-1)); + long LLength=static_cast(m_LeftDelay*(DELAYBUFFERSIZE-1)); + long temp=0; + + while (nLLength) m_LeftWrite=0; + m_RightWrite++; + if (m_RightWrite>RLength) m_RightWrite=0; + } +} + +void Delay::Randomise() +{ + //m_RightDelay=RandFloat(); + //m_LeftDelay=m_RightDelay; + //m_Feedback=RandFloat(); +} + + +istream &operator>>(istream &s, Delay &o) +{ + s>>o.m_LeftDelay>>o.m_Feedback>>o.m_Bypass; + return s; +} + +ostream &operator<<(ostream &s, Delay &o) +{ + s< + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +// Stereo module, different delay times for left and right, due to reverb +// functionality. + +#include + +#ifndef DELAY +#define DELAY + +class Delay +{ +public: + Delay(); + ~Delay(); + + void SetDelay(float s) {m_LeftDelay=s; m_RightDelay=s;} + void SetRightDelay(float s) {m_RightDelay=s;} + void SetLeftDelay(float s) {m_LeftDelay=s;} + void SetNumChannels(int s) {m_Channels=s;} + void SetFeedback(float s) {m_Feedback=s;} + void SetBypass(bool s) {m_Bypass=s;} + float GetDelay() {return GetLeftDelay();} + float GetLeftDelay() {return m_LeftDelay;} + float GetRightDelay() {return m_RightDelay;} + float GetFeedback() {return m_Feedback;} + float GetBypass() {return m_Bypass;} + void GetOutput(Sample &data); + void Randomise(); + +private: + + Sample m_LeftBuffer; + Sample m_RightBuffer; + long m_LeftWrite; + long m_RightWrite; + float m_LeftDelay; + float m_RightDelay; + float m_Feedback; + int m_Channels; + bool m_Bypass; + + friend istream &operator>>(istream &s, Delay &o); + friend ostream &operator<<(ostream &s, Delay &o); +}; + +istream &operator>>(istream &s, Delay &o); +ostream &operator<<(ostream &s, Delay &o); + +#endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/SpiralSound/Filter.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/SpiralSound/Filter.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/SpiralSound/Filter.C 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/SpiralSound/Filter.C 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,174 @@ +/* SpiralSynth + * Copyleft (C) 2000 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "Filter.h" +#include "../../../Sample.h" + +static const float MAX_RES = 10; +static const float MIN_RES = 1; +static const float MAX_CUTOFF = 3000; +static const float MIN_CUTOFF = 500; + +Filter::Filter() : +fs(44100), // Sampling frequency +fc(-1), // Filter cutoff +Q(1), // Resonance +m_LastFC(0), +m_LastQ(1), +k(1.0), // Set overall filter gain +m_RevCutoffMod(false), +m_RevResonanceMod(false), +m_FilterBypass(true), +m_CutoffModBuf(NULL), +m_ResonanceModBuf(NULL) +{ + SetupCoeffs(); + + + iir = new FILTER[1]; + + for (int n=0; n<1; n++) + { + iir[n].length = FILTER_SECTIONS; + iir[n].coef = (float *) calloc(4 * iir[n].length + 1 , sizeof(float)); + + if (!iir[n].coef) + { + printf("Unable to allocate coef array, exiting\n"); + exit(1); + } + } +} + +Filter::~Filter() +{ + delete[] iir; +} + +void Filter::SetupCoeffs() +{ + ProtoCoef[0].a0 = 1.0; + ProtoCoef[0].a1 = 0; + ProtoCoef[0].a2 = 0; + ProtoCoef[0].b0 = 1.0; + ProtoCoef[0].b1 = 0.765367; + ProtoCoef[0].b2 = 1.0; + + ProtoCoef[1].a0 = 1.0; + ProtoCoef[1].a1 = 0; + ProtoCoef[1].a2 = 0; + ProtoCoef[1].b0 = 1.0; + ProtoCoef[1].b1 = 1.847759; + ProtoCoef[1].b2 = 1.0; +} + +void Filter::GetOutput(int V, Sample &data) +{ + float Cutoff; + float Resonance; + + if (m_FilterBypass || fc<0) return; + + for (int n=0; nMAX_RES) Resonance=MAX_RES; + if (Cutoff>MAX_CUTOFF) Cutoff=MAX_CUTOFF; + if (Resonance0.5f); + //m_RevResonanceMod=(RandFloat()>0.5f); +} + +istream &operator>>(istream &s, Filter &o) +{ + s>>o.fc>>o.Q>>o.m_RevCutoffMod>>o.m_RevResonanceMod; + return s; +} + +ostream &operator<<(ostream &s, Filter &o) +{ + s< + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include "../../../NoteTable.h" +#include "iir_filter.h" + +#ifndef _FILTER +#define _FILTER + + +class Filter +{ +public: + Filter(); + ~Filter(); + + void GetOutput(int V, Sample &data); + void Reset(); + void SetupCoeffs(); + + void SetCutoff(double s) {fc=s;} + void SetResonance(double s) {Q=s;} + void SetRevCutoffMod(bool s) {m_RevCutoffMod=s;} + void SetRevResonanceMod(bool s) {m_RevResonanceMod=s;} + void FilterBypass(bool s) {m_FilterBypass=s;} + double GetCutoff() {return fc;} + double GetResonance() {return Q;} + bool GetRevCutoffMod() {return m_RevCutoffMod;} + bool GetRevResonanceMod() {return m_RevResonanceMod;} + + void ModulateCutoff(Sample *data); + void ModulateResonance(Sample *data); + void Randomise(); + +private: + + // Voice specifics + FILTER *iir; + + // Voice independant + float *coef; + double fs, fc; // Sampling frequency, cutoff frequency + double Q; // Resonance > 1.0 < 1000 + double m_LastFC; + double m_LastQ; + unsigned nInd; + double a0, a1, a2, b0, b1, b2; + double k; // overall gain factor + bool m_RevCutoffMod; + bool m_RevResonanceMod; + bool m_FilterBypass; + + Sample *m_CutoffModBuf; + Sample *m_ResonanceModBuf; + + friend istream &operator>>(istream &s, Filter &o); + friend ostream &operator<<(ostream &s, Filter &o); +}; + +istream &operator>>(istream &s, Filter &o); +ostream &operator<<(ostream &s, Filter &o); + +#endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/SpiralSound/iir_filter.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/SpiralSound/iir_filter.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/SpiralSound/iir_filter.C 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/SpiralSound/iir_filter.C 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,128 @@ +/* SpiralSynth + * Copyleft (C) 2000 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* +Resonant low pass filter source code. +This code was originally written by baltrax@hotmail.com + +See +for the full version with explanatory comments, and the maths! +*/ + +#include "iir_filter.h" + +BIQUAD ProtoCoef[FILTER_SECTIONS]; + +float iir_filter(float input,FILTER *iir) + { + unsigned int i; + float *hist1_ptr,*hist2_ptr,*coef_ptr; + float output,new_hist,history1,history2; + +/* allocate history array if different size than last call */ + + if(!iir->history) { + iir->history = (float *) calloc(2*iir->length,sizeof(float)); + if(!iir->history) { + printf("\nUnable to allocate history array in iir_filter\n"); + exit(1); + } + } + + coef_ptr = iir->coef; /* coefficient pointer */ + + hist1_ptr = iir->history; /* first history */ + hist2_ptr = hist1_ptr + 1; /* next history */ + + /* 1st number of coefficients array is overall input scale factor, + * or filter gain */ + output = input * (*coef_ptr++); + + for (i = 0 ; i < iir->length; i++) + { + history1 = *hist1_ptr; /* history values */ + history2 = *hist2_ptr; + + output = output - history1 * (*coef_ptr++); + new_hist = output - history2 * (*coef_ptr++); /* poles */ + + output = new_hist + history1 * (*coef_ptr++); + output = output + history2 * (*coef_ptr++); /* zeros */ + + *hist2_ptr++ = *hist1_ptr; + *hist1_ptr++ = new_hist; + hist1_ptr++; + hist2_ptr++; + } + + return(output); +} + +void prewarp( + double *a0, double *a1, double *a2, + double fc, double fs) +{ + double wp, pi; + + pi = 4.0 * atan(1.0); + wp = 2.0 * fs * tan(pi * fc / fs); + + *a2 = (*a2) / (wp * wp); + *a1 = (*a1) / wp; +} + +void bilinear( + double a0, double a1, double a2, /* numerator coefficients */ + double b0, double b1, double b2, /* denominator coefficients */ + double *k, /* overall gain factor */ + double fs, /* sampling rate */ + float *coef /* pointer to 4 iir coefficients */ +) +{ + double ad, bd; + + /* alpha (Numerator in s-domain) */ + ad = 4. * a2 * fs * fs + 2. * a1 * fs + a0; + /* beta (Denominator in s-domain) */ + bd = 4. * b2 * fs * fs + 2. * b1* fs + b0; + + /* update gain constant for this section */ + *k *= ad/bd; + + /* Denominator */ + *coef++ = (2. * b0 - 8. * b2 * fs * fs) / bd; /* beta1 */ + *coef++ = (4. * b2 * fs * fs - 2. * b1 * fs + b0) / bd; /* beta2 */ + /* Nominator */ + *coef++ = (2. * a0 - 8. * a2 * fs * fs) / ad; /* alpha1 */ + *coef = (4. * a2 * fs * fs - 2. * a1 * fs + a0) / ad; /* alpha2 */ +} + +void szxform( + double *a0, double *a1, double *a2, /* numerator coefficients */ + double *b0, double *b1, double *b2, /* denominator coefficients */ + double fc, /* Filter cutoff frequency */ + double fs, /* sampling rate */ + double *k, /* overall gain factor */ + float *coef) /* pointer to 4 iir coefficients */ +{ + /* Calculate a1 and a2 and overwrite the original values */ + prewarp(a0, a1, a2, fc, fs); + prewarp(b0, b1, b2, fc, fs); + bilinear(*a0, *a1, *a2, *b0, *b1, *b2, k, fs, coef); +} + diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/SpiralSound/iir_filter.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/SpiralSound/iir_filter.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/SpiralSound/iir_filter.h 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/SpiralSound/iir_filter.h 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,75 @@ +/* SpiralSynth + * Copyleft (C) 2000 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* +Resonant low pass filter source code. +This code was originally written by baltrax@hotmail.com + +See +for the full version with explanatory comments, and the maths! +*/ + + +#include +#include +#include + + +#ifndef _IIR_FILTER +#define _IIR_FILTER + +/* FILTER INFORMATION STRUCTURE FOR FILTER ROUTINES */ + +class FILTER{ + public: + FILTER() {history=coef=NULL;} + unsigned int length; /* size of filter */ + float *history; /* pointer to history in filter */ + float *coef; /* pointer to coefficients of filter */ +}; + +#define FILTER_SECTIONS 2 /* 2 filter sections for 24 db/oct filter */ + +typedef struct { + double a0, a1, a2; /* numerator coefficients */ + double b0, b1, b2; /* denominator coefficients */ +} BIQUAD; + +extern BIQUAD ProtoCoef[FILTER_SECTIONS]; /* Filter prototype coefficients, + 1 for each filter section */ + +float iir_filter(float input,FILTER *iir); + +void szxform( + double *a0, double *a1, double *a2, /* numerator coefficients */ + double *b0, double *b1, double *b2, /* denominator coefficients */ + double fc, /* Filter cutoff frequency */ + double fs, /* sampling rate */ + double *k, /* overall gain factor */ + float *coef); /* pointer to 4 iir coefficients */ + +void prewarp(double *a0, double *a1, double *a2, double fc, double fs); + +void bilinear( + double a0, double a1, double a2, /* numerator coefficients */ + double b0, double b1, double b2, /* denominator coefficients */ + double *k, /* overall gain factor */ + double fs, /* sampling rate */ + float *coef); + +#endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/SpiralSound/Reverb.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/SpiralSound/Reverb.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralLoopPlugin/SpiralSound/Reverb.C 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralLoopPlugin/SpiralSound/Reverb.C 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,115 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +// Stereo module + +#include "Reverb.h" + +static const int NUM_DELAYS = 5; +static const float MAX_DELAYTIME = 0.2; +static const float MIN_DELAYTIME = 0.02; + +float RandFloat(float min, float max) +{ + return min+(rand()%1000/1000.0*(max-min)); +} + +Reverb::Reverb() : +m_Time(0), +m_Feedback(0.2), +m_Randomness(0.01), +m_Bypass(true) +{ + // set up the delay vec + for (int i=0; iSetLeftDelay(RandFloat(MIN_DELAYTIME,MAX_DELAYTIME)); + pDelay->SetRightDelay(RandFloat(MIN_DELAYTIME,MAX_DELAYTIME)); + pDelay->SetBypass(false); + m_DelayVec.push_back(pDelay); + } +} + +Reverb::~Reverb() +{ + for (vector::iterator i=m_DelayVec.begin(); + i!=m_DelayVec.end(); i++) + { + delete *i; + } + + m_DelayVec.clear(); +} + +void Reverb::SetTime(float s) +{ + m_Time=s; + float t=0; + int count=0; + for (vector::iterator i=m_DelayVec.begin(); + i!=m_DelayVec.end(); i++) + { + t=count/(float)NUM_DELAYS; + (*i)->SetLeftDelay(t*m_Time+RandFloat(-m_Randomness,m_Randomness)); + (*i)->SetRightDelay(t*m_Time+RandFloat(-m_Randomness,m_Randomness)); + count++; + } +} + +void Reverb::SetFeedback(float s) +{ + m_Feedback=s; + for (vector::iterator i=m_DelayVec.begin(); + i!=m_DelayVec.end(); i++) + { + (*i)->SetFeedback(s); + } +} + +void Reverb::SetNumChannels(int s) +{ + for (vector::iterator i=m_DelayVec.begin(); + i!=m_DelayVec.end(); i++) + { + (*i)->SetNumChannels(s); + } +} + +void Reverb::GetOutput(Sample &data) +{ + if (m_Time==0 || m_Bypass) return; + + for (vector::iterator i=m_DelayVec.begin(); + i!=m_DelayVec.end(); i++) + { + (*i)->GetOutput(data); + } +} + +istream &operator>>(istream &s, Reverb &o) +{ + s>>o.m_Time>>o.m_Feedback>>o.m_Randomness>>o.m_Bypass; + return s; +} + +ostream &operator<<(ostream &s, Reverb &o) +{ + s< + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include +#include "Delay.h" +#include + +#ifndef REVERB +#define REVERB + +class Reverb +{ +public: + Reverb(); + ~Reverb(); + + void SetTime(float s); + void SetRandomness(float s) {m_Randomness=s; SetTime(m_Time);} + void SetFeedback(float s); + void SetNumChannels(int s); + void SetBypass(bool s) {m_Bypass=s;} + float GetTime() {return m_Time;} + float GetFeedback() {return m_Feedback;} + float GetRandomness() {return m_Randomness;} + bool IsBypassed() {return m_Bypass;} + void GetOutput(Sample &data); + void Randomise(); + +private: + + float m_Time; + float m_Feedback; + float m_Randomness; + bool m_Bypass; + + vector m_DelayVec; + + friend istream &operator>>(istream &s, Reverb &o); + friend ostream &operator<<(ostream &s, Reverb &o); +}; + +istream &operator>>(istream &s, Reverb &o); +ostream &operator<<(ostream &s, Reverb &o); + +#endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralPlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralPlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralPlugin.C 2004-02-11 18:30:45.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralPlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -50,6 +50,20 @@ return true; } +void SpiralPlugin::ResetPorts() +{ + for (int n=0; nClear(); + m_Output[n]->Allocate(m_HostInfo->BUFSIZE); + } +} + +void SpiralPlugin::Reset() +{ + ResetPorts(); +} + PluginInfo &SpiralPlugin::Initialise(const HostInfo *Host) { m_HostInfo=Host; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralPluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -20,6 +20,7 @@ #include "SpiralPlugin.h" #include "../SpiralInfo.h" #include +#include #include #include #include diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralPlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralPlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SpiralPlugin.h 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SpiralPlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include "../Sample.h" @@ -47,12 +48,15 @@ struct HostInfo { int BUFSIZE; + int SAMPLERATE; + + /* obsolete - REMOVE SOON */ int FRAGSIZE; int FRAGCOUNT; - int SAMPLERATE; std::string OUTPUTFILE; std::string MIDIFILE; int POLY; + unsigned GUI_COLOUR; unsigned SCOPE_BG_COLOUR; unsigned SCOPE_FG_COLOUR; @@ -61,6 +65,8 @@ unsigned SCOPE_MRK_COLOUR; unsigned GUICOL_Device; unsigned GUIDEVICE_Box; + + bool PAUSED; }; ///////////////////////////////////////////////////////////////////// @@ -78,6 +84,7 @@ // execute the audio virtual void Execute()=0; virtual bool Kill(); + virtual void Reset(); // run the commands from the GUI virtual void ExecuteCommands() {} @@ -91,7 +98,7 @@ // stuff here gets saved in filename_files directory // you must return true if this feature is used. virtual bool SaveExternalFiles(const std::string &Dir) { return false; } - virtual void LoadExternalFiles(const std::string &Dir) {} + virtual void LoadExternalFiles(const std::string &Dir, int withID=-1) {} const HostInfo* GetHostInfo() { return m_HostInfo; } bool GetOutput(unsigned int n, Sample **s); @@ -101,7 +108,7 @@ void UpdatePluginInfoWithHost(); void SetInPortType(PluginInfo &pinfo, int port, Sample::SampleType type); - void SetOutPortType(PluginInfo &pinfo, int port, Sample::SampleType type); + void SetOutPortType(PluginInfo &pinfo, int port, Sample::SampleType type); // Callbacks to main engine. Should only called by plugin hosts. void SetUpdateInfoCallback(int ID, void(*s)(int, void *)); @@ -114,8 +121,9 @@ bool IsTerminal() { return m_IsTerminal; } bool IsDead() { return m_IsDead; } - ChannelHandler *GetChannelHandler() { return m_AudioCH; } - + ChannelHandler *GetChannelHandler() { return m_AudioCH; } + + virtual bool IsAudioDriver() { return false; } protected: ChannelHandler *m_AudioCH; @@ -146,6 +154,8 @@ void RemoveInput(); void RemoveAllInputs(); + void ResetPorts(); + // the ID number assigned to us by ssm int GetID() { return m_HostID; } @@ -175,4 +185,37 @@ int m_HostID; }; +class AudioDriver : public SpiralPlugin +{ +public: + /* if this is an ALWAYS process then ProcessAudio must + always be called regardless whether it has something to + process or not, so it is run along side GUI commands, + ala ExecuteCommands, and is run even if paused. + + If its MANUAL we are the ones doing the pushing of data + so we don't have to worry about it if we aren't hooked up, + and we do have to worry about synchronization with other + plugins, so ProcessAudio should be run along side of + regular audio updates, ala Execute. This is eg. for + a File Output driver. + + NEVER means we never need to run ProcessAudio, eg, + a dummy audio driver. + */ + enum AudioProcessType { ALWAYS, MANUAL, NEVER }; + + virtual bool IsAudioDriver() { return true; } + + virtual void ProcessAudio()=0; + + virtual AudioProcessType ProcessType() { return NEVER; } + + // Callbacks to main engine. Should only called by plugin hosts. + void SetChangeBufferAndSampleRateCallback(void(*s)(long unsigned int, long unsigned int, void *)) { ChangeBufferAndSampleRate = s; } ; + +protected: + void (*ChangeBufferAndSampleRate)(long unsigned int BufferSize, long unsigned int SampleRate, void *); +}; + #endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SplitSwitchPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SplitSwitchPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SplitSwitchPlugin/Makefile.in 2004-01-17 10:32:43.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SplitSwitchPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -13,10 +13,7 @@ LFLAGS = LIBS = @FLTK_LIBS@ MOC = moc -UIC = - -TAR = tar -cf -GZIP = gzip -9f +UIC = INSTALL = @INSTALL@ @@ -96,13 +93,6 @@ moc: $(SRCMOC) -tmake: - tmake SplitSwitchPlugin.pro - -dist: - $(TAR) SplitSwitchPlugin.tar SplitSwitchPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) SplitSwitchPlugin.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SplitSwitchPlugin/SplitSwitchPlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SplitSwitchPlugin/SplitSwitchPlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SplitSwitchPlugin/SplitSwitchPlugin.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SplitSwitchPlugin/SplitSwitchPlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -104,6 +104,15 @@ UpdatePluginInfoWithHost (); } +void SplitSwitchPlugin::Reset() +{ + ResetPorts(); + m_Triggered=false; + m_GUIArgs.Chans = 2; + m_GUIArgs.Switch = 1; + m_GUIArgs.Echo = 1; +} + void SplitSwitchPlugin::Execute() { int n; int NumChans = m_PluginInfo.NumOutputs - 1; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SplitSwitchPlugin/SplitSwitchPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SplitSwitchPlugin/SplitSwitchPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SplitSwitchPlugin/SplitSwitchPluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SplitSwitchPlugin/SplitSwitchPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -18,6 +18,7 @@ #include "SplitSwitchPluginGUI.h" #include +#include using namespace std; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SplitSwitchPlugin/SplitSwitchPlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SplitSwitchPlugin/SplitSwitchPlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SplitSwitchPlugin/SplitSwitchPlugin.h 2003-10-09 18:46:14.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SplitSwitchPlugin/SplitSwitchPlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -29,6 +29,7 @@ virtual PluginInfo& Initialise (const HostInfo *Host); virtual SpiralGUIType* CreateGUI (); virtual void Execute (); + virtual void Reset(); virtual void ExecuteCommands (); virtual void StreamOut (std::ostream &s); virtual void StreamIn (std::istream &s); diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SplitterPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SplitterPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SplitterPlugin/Makefile.in 2004-01-17 10:32:43.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SplitterPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -13,10 +13,7 @@ LFLAGS = LIBS = @FLTK_LIBS@ MOC = moc -UIC = - -TAR = tar -cf -GZIP = gzip -9f +UIC = INSTALL = @INSTALL@ @@ -96,13 +93,6 @@ moc: $(SRCMOC) -tmake: - tmake SplitterPlugin.pro - -dist: - $(TAR) SplitterPlugin.tar SplitterPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) SplitterPlugin.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SplitterPlugin/SplitterPlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SplitterPlugin/SplitterPlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SplitterPlugin/SplitterPlugin.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SplitterPlugin/SplitterPlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -15,6 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include +#include +#include + #include "SplitterPlugin.h" #include "SplitterPluginGUI.h" #include @@ -49,45 +53,144 @@ SplitterPlugin::SplitterPlugin() { m_PluginInfo.Name="Splitter"; - m_PluginInfo.Width=220; - m_PluginInfo.Height=125; - m_PluginInfo.NumInputs=1; - m_PluginInfo.NumOutputs=4; - m_PluginInfo.PortTips.push_back("Input"); - m_PluginInfo.PortTips.push_back("Out one"); - m_PluginInfo.PortTips.push_back("Out two"); - m_PluginInfo.PortTips.push_back("Out three"); - m_PluginInfo.PortTips.push_back("Out four"); + m_PluginInfo.Width=80; + m_PluginInfo.Height=40; + + m_Version = 2; + m_GUIArgs.ChannelCount = 4; + CreatePorts (); + + m_AudioCH->Register ("ChannelCount", &m_GUIArgs.ChannelCount); } SplitterPlugin::~SplitterPlugin() { } +void SplitterPlugin::CreatePorts (int n, bool AddPorts) +{ + int c; + char t[256]; + + m_PluginInfo.NumInputs = 1; + m_PluginInfo.PortTips.push_back ("Input"); + + m_PluginInfo.NumOutputs = n; + for (c=1; c<=n; c++) { + sprintf (t, "Out %d", c); + m_PluginInfo.PortTips.push_back (t); + } + + if (AddPorts) { + for (int c=0; cZero(); - GetOutputBuf(3)->Zero(); - GetOutputBuf(2)->Zero(); - GetOutputBuf(1)->Zero(); - + for (int i=0; iZero(); + } + if (InputExists(0)) { - GetOutputBuf(0)->Mix(*GetInput(0),0); - GetOutputBuf(1)->Mix(*GetInput(0),0); - GetOutputBuf(2)->Mix(*GetInput(0),0); - GetOutputBuf(3)->Mix(*GetInput(0),0); + for (int i=0; iMix(*GetInput(0),0); + } } } +void SplitterPlugin::ExecuteCommands () +{ + if (m_AudioCH->IsCommandWaiting ()) + { + switch (m_AudioCH->GetCommand()) { + case SETCHANNELCOUNT : + { + UpdatePluginInfoWithHost(); + + RemoveAllInputs (); + RemoveAllOutputs (); + m_PluginInfo.NumInputs = 0; + m_PluginInfo.NumOutputs = 0; + m_PluginInfo.PortTips.clear (); + + CreatePorts (m_GUIArgs.ChannelCount, true); + UpdatePluginInfoWithHost (); + } + break; + } + } +} + +void SplitterPlugin::StreamOut (ostream &s) +{ + s << m_Version << " " << GetChannelCount() << " "; +} + +void SplitterPlugin::StreamIn (istream &s) +{ + char Test; + int Version, Channels; + + s.seekg (2, ios::cur );//skip to next line + Test = s.peek();//peek first char + s.seekg (-2, ios::cur );//jump back to prior line + + if ( (Test >= '0') && (Test <= '9') ) + { + s >> Version; + } + else + { + //No Version, so use Version 1 + Version = 1; + } + + switch (Version) + { + case 2: + { + s >> Channels; + SetChannelCount (Channels); + } + break; + + case 1: + { + //use original fixed defaults + SetChannelCount (4); + } + break; + } +} diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SplitterPlugin/SplitterPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SplitterPlugin/SplitterPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SplitterPlugin/SplitterPluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SplitterPlugin/SplitterPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -18,6 +18,7 @@ #include "SplitterPluginGUI.h" #include +#include using namespace std; @@ -26,18 +27,50 @@ SplitterPluginGUI::SplitterPluginGUI(int w, int h,SplitterPlugin *o,ChannelHandler *ch,const HostInfo *Info) : SpiralPluginGUI(w,h,o,ch) { + m_Channels = new Fl_Counter (15, 20, 50, 15, "Channels"); + m_Channels->labelsize (8); + m_Channels->textsize (8); + m_Channels->type (FL_SIMPLE_COUNTER); + m_Channels->box (FL_PLASTIC_UP_BOX); + m_Channels->color (Info->GUI_COLOUR); + m_Channels->selection_color (Info->GUI_COLOUR); + m_Channels->step (1); + m_Channels->value (4); + m_Channels->callback ((Fl_Callback*) cb_Channels, this); + add (m_Channels); + end(); } +void SplitterPluginGUI::Update() +{ +} void SplitterPluginGUI::UpdateValues(SpiralPlugin *o) { + SplitterPlugin* Plugin = (SplitterPlugin*)o; + m_Channels->value (Plugin->GetChannelCount()); } -const string SplitterPluginGUI::GetHelpText(const string &loc){ - return string("") - + "The simplest plugin - the splitter simply takes the input,\n" - + "and duplicates it into it's outputs. Simple, but difficult\n" - + "to do without.\n"; +inline void SplitterPluginGUI::cb_Channels_i (Fl_Counter* o) +{ + if (o->value() < 2) + { + o->value(2); + } + else { + m_GUICH->Set ("ChannelCount", int (o->value ())); + m_GUICH->SetCommand (SplitterPlugin::SETCHANNELCOUNT); + m_GUICH->Wait (); + Resize (w(), h()); + } +} + +const string SplitterPluginGUI::GetHelpText(const string &loc) +{ + return string("") + + "The simplest plugin - the splitter simply takes the input,\n" + + "and duplicates it into it's outputs. Simple, but difficult\n" + + "to do without.\n"; } diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SplitterPlugin/SplitterPluginGUI.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SplitterPlugin/SplitterPluginGUI.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SplitterPlugin/SplitterPluginGUI.h 2003-08-08 17:55:52.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SplitterPlugin/SplitterPluginGUI.h 2012-05-31 04:13:57.000000000 +0000 @@ -17,6 +17,7 @@ */ #include +#include #include "SplitterPlugin.h" #include "../SpiralPluginGUI.h" @@ -29,13 +30,16 @@ SplitterPluginGUI(int w, int h, SplitterPlugin *o, ChannelHandler *ch, const HostInfo *Info); virtual void UpdateValues(SpiralPlugin *o); + virtual void Update (); protected: - const std::string GetHelpText(const std::string &loc); + const std::string GetHelpText(const std::string &loc); private: + Fl_Counter *m_Channels; - //// Callbacks //// + inline void cb_Channels_i (Fl_Counter* o); + static void cb_Channels(Fl_Counter* o, SplitterPluginGUI* v) {v->cb_Channels_i(o);} }; #endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SplitterPlugin/SplitterPlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SplitterPlugin/SplitterPlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SplitterPlugin/SplitterPlugin.h 2003-08-08 17:55:52.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SplitterPlugin/SplitterPlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -29,12 +29,27 @@ virtual ~SplitterPlugin(); virtual PluginInfo& Initialise(const HostInfo *Host); - virtual SpiralGUIType* CreateGUI(); + virtual SpiralGUIType* CreateGUI (); + virtual void Execute(); - virtual void StreamOut(std::ostream &s) {} - virtual void StreamIn(std::istream &s) {} + virtual void ExecuteCommands(); + + virtual void StreamOut(std::ostream &s); + virtual void StreamIn(std::istream &s); + int GetChannelCount (void) { return m_GUIArgs.ChannelCount; } + void SetChannelCount (int count); + + enum GUICommands { NONE, SETCHANNELCOUNT }; + struct GUIArgs { + int ChannelCount; + }; private: + GUIArgs m_GUIArgs; + + int m_Version; + + void CreatePorts (int n = 4, bool AddPorts = false); }; #endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SplitterPlugin/SplitterPlugin.pro spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SplitterPlugin/SplitterPlugin.pro --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SplitterPlugin/SplitterPlugin.pro 2002-07-28 23:18:15.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SplitterPlugin/SplitterPlugin.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -HEADERS = ../SpiralPlugin.h \ - ../SpiralPluginGUI.h \ - ../Widgets/Fl_Knob.H \ - ../Widgets/Fl_DragBar.H \ - ../../Sample.h \ - SplitterPlugin.h \ - SplitterPluginGUI.h - -SOURCES = ../SpiralPlugin.C \ - ../SpiralPluginGUI.C \ - ../Widgets/Fl_Knob.cxx \ - ../Widgets/Fl_DragBar.cxx \ - ../../Sample.C \ - SplitterPlugin.C \ - SplitterPluginGUI.C - -TARGET = SplitterPlugin.so diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/StereoMixerPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/StereoMixerPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/StereoMixerPlugin/Makefile.in 2004-01-17 10:32:43.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/StereoMixerPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -13,10 +13,7 @@ LFLAGS = LIBS = @FLTK_LIBS@ MOC = moc -UIC = - -TAR = tar -cf -GZIP = gzip -9f +UIC = INSTALL = @INSTALL@ @@ -99,15 +96,6 @@ moc: $(SRCMOC) -tmake: Makefile - -Makefile: StereoMixerPlugin.pro - tmake StereoMixerPlugin.pro -o Makefile - -dist: - $(TAR) StereoMixerPlugin.tar StereoMixerPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) StereoMixerPlugin.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/StereoMixerPlugin/StereoMixerPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/StereoMixerPlugin/StereoMixerPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/StereoMixerPlugin/StereoMixerPluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/StereoMixerPlugin/StereoMixerPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -18,6 +18,7 @@ #include "StereoMixerPluginGUI.h" #include +#include using namespace std; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/StereoMixerPlugin/StereoMixerPlugin.pro spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/StereoMixerPlugin/StereoMixerPlugin.pro --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/StereoMixerPlugin/StereoMixerPlugin.pro 2002-07-28 23:18:16.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/StereoMixerPlugin/StereoMixerPlugin.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -HEADERS = ../SpiralPlugin.h \ - ../SpiralPluginGUI.h \ - ../Widgets/Fl_Knob.H \ - ../Widgets/Fl_DragBar.H \ - ../../Sample.h \ - StereoMixerPlugin.h \ - StereoMixerPluginGUI.h - -SOURCES = ../SpiralPlugin.C \ - ../SpiralPluginGUI.C \ - ../Widgets/Fl_Knob.cxx \ - ../Widgets/Fl_DragBar.cxx \ - ../../Sample.C \ - StereoMixerPlugin.C \ - StereoMixerPluginGUI.C - -TARGET = StereoMixerPlugin.so diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/StreamPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/StreamPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/StreamPlugin/Makefile.in 2004-01-17 10:32:43.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/StreamPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -13,10 +13,7 @@ LFLAGS = LIBS = @FLTK_LIBS@ @SFLIBS@ MOC = moc -UIC = - -TAR = tar -cf -GZIP = gzip -9f +UIC = INSTALL = @INSTALL@ @@ -47,6 +44,7 @@ ../../RiffWav.h \ ../Widgets/Fl_Knob.H \ ../Widgets/Fl_SevenSeg.H \ + ../GUI/WaveChooser.h \ ../../../GUI/Widgets/SpiralGUI.H SOURCES = StreamPlugin.C \ StreamPluginGUI.C \ @@ -57,6 +55,7 @@ ../../RiffWav.C \ ../Widgets/Fl_Knob.cxx \ ../Widgets/Fl_SevenSeg.cxx \ + ../GUI/WaveChooser.C \ ../../../GUI/Widgets/SpiralGUI.C OBJECTS = StreamPlugin.o \ StreamPluginGUI.o \ @@ -67,6 +66,7 @@ ../../RiffWav.o \ ../Widgets/Fl_Knob.o \ ../Widgets/Fl_SevenSeg.o \ + ../GUI/WaveChooser.o \ ../../../GUI/Widgets/SpiralGUI.o INTERFACES = UICDECLS = @@ -104,13 +104,6 @@ moc: $(SRCMOC) -tmake: - tmake StreamPlugin.pro - -dist: - $(TAR) StreamPlugin.tar StreamPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) StreamPlugin.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core @@ -137,6 +130,9 @@ ../../ChannelHandler.h \ ../../../GUI/Widgets/SpiralGUI.H +../GUI/WaveChooser.o: ../GUI/WaveChooser.C \ + ../GUI/WaveChooser.h + ../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ ../Widgets/Fl_Knob.H diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/StreamPlugin/StreamPlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/StreamPlugin/StreamPlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/StreamPlugin/StreamPlugin.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/StreamPlugin/StreamPlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -21,38 +21,27 @@ #include "SpiralIcon.xpm" #include "../../NoteTable.h" #include - #include "../../RiffWav.h" using namespace std; -static const float TRIG_THRESH = 0.1; -static const float BUFSECONDS = 1.0f; - extern "C" { -SpiralPlugin* SpiralPlugin_CreateInstance() -{ - return new StreamPlugin; -} -char** SpiralPlugin_GetIcon() -{ - return SpiralIcon_xpm; -} +SpiralPlugin* SpiralPlugin_CreateInstance() { return new StreamPlugin; } -int SpiralPlugin_GetID() -{ - return 0x0119; -} +char** SpiralPlugin_GetIcon() { return SpiralIcon_xpm; } + +int SpiralPlugin_GetID() { return 0x0119; } + +string SpiralPlugin_GetGroupName() { return "Delay/Sampling"; } -string SpiralPlugin_GetGroupName() -{ - return "Delay/Sampling"; -} } /////////////////////////////////////////////////////// +static const float TRIG_THRESH = 0.1; +static const float BUFSECONDS = 1.0f; + StreamPlugin::StreamPlugin() : m_SampleRate (44100), m_SampleSize (256), @@ -65,22 +54,27 @@ { m_PluginInfo.Name = "Stream"; m_PluginInfo.Width = 245; - m_PluginInfo.Height = 165; + m_PluginInfo.Height = 160; m_PluginInfo.NumInputs = 3; - m_PluginInfo.NumOutputs = 3; + m_PluginInfo.NumOutputs = 5; m_PluginInfo.PortTips.push_back ("Pitch CV"); m_PluginInfo.PortTips.push_back ("Play Trigger"); m_PluginInfo.PortTips.push_back ("Stop Trigger"); m_PluginInfo.PortTips.push_back ("Left Out"); m_PluginInfo.PortTips.push_back ("Right Out"); m_PluginInfo.PortTips.push_back ("Finish Trigger"); + m_PluginInfo.PortTips.push_back ("Playing Trigger"); + m_PluginInfo.PortTips.push_back ("Position CV"); m_GUIArgs.Volume = 1.0f; m_GUIArgs.PitchMod = 1.0f; m_GUIArgs.PlayOut = false; + strcpy (m_GUIArgs.FileName, ""); m_AudioCH->Register ("Volume", &m_GUIArgs.Volume); m_AudioCH->Register ("Pitch", &m_GUIArgs.PitchMod, ChannelHandler::INPUT); m_AudioCH->RegisterData ("FileName", ChannelHandler::INPUT, &m_GUIArgs.FileName, sizeof (m_GUIArgs.FileName)); + m_AudioCH->RegisterData ("EchoFileName", ChannelHandler::OUTPUT, + &m_GUIArgs.FileName, sizeof (m_GUIArgs.FileName)); m_AudioCH->Register ("Time", &m_GUIArgs.Time); m_AudioCH->Register ("TimeOut", &m_GUIArgs.TimeOut, ChannelHandler::OUTPUT); m_AudioCH->Register ("MaxTime", &m_GUIArgs.MaxTime, ChannelHandler::OUTPUT); @@ -101,6 +95,16 @@ return new StreamPluginGUI(m_PluginInfo.Width, m_PluginInfo.Height, this, m_AudioCH, m_HostInfo); } +void StreamPlugin::Reset() +{ + ResetPorts(); + m_StreamPos = 0; + m_GlobalPos = 0; + m_SamplePos = -1; + m_Pos = 0; +} + + void StreamPlugin::Execute() { if (m_File.IsOpen()) { for (int n=0; nBUFSIZE; n++) { @@ -114,7 +118,7 @@ m_StreamPos = 0; } - if (m_Pos<0) { + if (m_Pos<0) { m_Pos = m_SampleSize - 1; m_StreamPos -= m_SampleSize; FinTrig = m_StreamPos < 0; @@ -127,7 +131,7 @@ if ((m_File.GetSize() - m_StreamPos) < 256) m_SampleSize = m_File.GetSize() - m_StreamPos; else - m_SampleSize = 256; + m_SampleSize = 256; m_File.LoadChunk (m_SampleSize, m_SampleL, m_SampleR); } @@ -144,22 +148,29 @@ if ((m_File.GetSize() - m_StreamPos) < 256) m_SampleSize = m_File.GetSize() - m_StreamPos; else - m_SampleSize = 256; + m_SampleSize = 256; m_File.LoadChunk (m_SampleSize, m_SampleL, m_SampleR); } - + // finished trigger if (FinTrig) SetOutput (2, n, 1); else SetOutput (2, n, 0); if (m_Mode==PLAYM) { + // left and right outputs SetOutput (0, n, m_SampleL[m_Pos] * m_GUIArgs.Volume); SetOutput (1, n, m_SampleR[m_Pos] * m_GUIArgs.Volume); + // play trigger + SetOutput (3, n, 1); m_Pos += m_GUIArgs.PitchMod + CVPitch; m_GlobalPos += m_GUIArgs.PitchMod + CVPitch; + float plop = m_GlobalPos / (float)m_File.GetSize(); + SetOutput (4, n, plop); } else { SetOutput (0, n, 0); SetOutput (1, n, 0); + SetOutput (3, n, 0); + SetOutput (4, n, 0); } } m_GUIArgs.TimeOut = m_GlobalPos / (float)m_SampleRate; @@ -206,7 +217,7 @@ if (m_File.GetSize() < 256) m_SampleSize = m_File.GetSize(); else - m_SampleSize = 256; + m_SampleSize = 256; m_SampleL.Allocate (m_SampleSize); m_SampleR.Allocate (m_SampleSize); diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/StreamPlugin/StreamPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/StreamPlugin/StreamPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/StreamPlugin/StreamPluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/StreamPlugin/StreamPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -18,7 +18,8 @@ #include "StreamPluginGUI.h" #include -#include +#include +#include "../GUI/WaveChooser.h" using namespace std; @@ -29,17 +30,19 @@ m_Playing (false), m_PitchValue (1.0f) { + strcpy (m_TextBuf, ""); // 7 seg displays for (int dis=0; dis<6; dis++) { - m_Display[dis] = new Fl_SevenSeg (5 + 28*dis, 20, 28, 60); + m_Display[dis] = new Fl_SevenSeg (5 + 28*dis, 15, 28, 38); m_Display[dis] -> bar_width (4); m_Display[dis] -> color (Info->SCOPE_FG_COLOUR); m_Display[dis] -> color2 (Info->SCOPE_BG_COLOUR); if (dis > 0 && dis % 2 == 0) m_Display[dis] -> dp (colon); add (m_Display[dis]); } + UpdateTime (0.0); // volume control - m_Volume = new Fl_Knob (180, 15, 50, 50, "Volume"); + m_Volume = new Fl_Knob (180, 10, 50, 50, "Volume"); m_Volume->color (Info->GUI_COLOUR); m_Volume->type (Fl_Knob::LINELIN); m_Volume->labelsize (10); @@ -48,8 +51,15 @@ m_Volume->value (1); m_Volume->callback ((Fl_Callback*)cb_Volume); add (m_Volume); + // filename display + m_FileName = new Fl_Input (5, 55, 170, 20, ""); + m_FileName->type (FL_NORMAL_OUTPUT); + m_FileName->textsize (8); + m_FileName->box (FL_PLASTIC_UP_BOX); + m_FileName->value ("Nothing Loaded"); + m_FileName->tooltip (m_TextBuf); // pitch indicator - m_Pitch = new Fl_Slider (5, 85, 235, 20, ""); + m_Pitch = new Fl_Slider (5, 78, 235, 20, ""); m_Pitch->type (FL_HORIZONTAL); m_Pitch->labelsize (10); m_Pitch->labelcolor (Info->GUI_COLOUR); @@ -61,7 +71,7 @@ m_Pitch->callback ((Fl_Callback*)cb_Pitch); add (m_Pitch); // position indicator - m_Pos = new Fl_Slider (5, 108, 235, 20, ""); + m_Pos = new Fl_Slider (5, 100, 235, 20, ""); m_Pos->type (FL_HORIZONTAL); m_Pos->box (FL_PLASTIC_DOWN_BOX); m_Pos->labelcolor (Info->GUI_COLOUR); @@ -70,7 +80,7 @@ m_Pos->callback ((Fl_Callback*)cb_Pos); add (m_Pos); // load btn - m_Load = new Fl_Button (2, 130, 30, 30, "Load"); + m_Load = new Fl_Button (2, 124, 30, 30, "Load"); m_Load->labelsize (9); m_Load->box (FL_PLASTIC_UP_BOX); m_Load->color (Info->GUI_COLOUR); @@ -78,7 +88,7 @@ m_Load->callback ((Fl_Callback*)cb_Load); add (m_Load); // reset btn - m_ToStart = new Fl_Button (32, 130, 30, 30, "@|<"); + m_ToStart = new Fl_Button (32, 124, 30, 30, "@|<"); m_ToStart->labelsize (10); m_ToStart->labeltype (FL_SYMBOL_LABEL); m_ToStart->box (FL_PLASTIC_UP_BOX); @@ -87,7 +97,7 @@ m_ToStart->callback ((Fl_Callback*)cb_ToStart); add (m_ToStart); // play btn - m_Play = new Fl_Button (62, 130, 30, 30, "@>"); + m_Play = new Fl_Button (62, 124, 30, 30, "@>"); m_Play->labelsize (10); m_Play->labeltype (FL_SYMBOL_LABEL); m_Play->box (FL_PLASTIC_UP_BOX); @@ -96,7 +106,7 @@ m_Play->callback ((Fl_Callback*)cb_Play); add (m_Play); // normal speed btn - m_Reset = new Fl_Button (92, 130, 30, 30, "Reset"); + m_Reset = new Fl_Button (92, 124, 30, 30, "Reset"); m_Reset->labelsize (9); m_Reset->box (FL_PLASTIC_UP_BOX); m_Reset->color (Info->GUI_COLOUR); @@ -104,7 +114,7 @@ m_Reset->callback ((Fl_Callback*)cb_Reset); add (m_Reset); // Reverse Button - m_Rev = new Fl_Button (122, 130, 30, 30, "@<-"); + m_Rev = new Fl_Button (122, 124, 30, 30, "@<-"); m_Rev->labelsize (10); m_Rev->labeltype (FL_SYMBOL_LABEL); m_Rev->box (FL_PLASTIC_UP_BOX); @@ -113,7 +123,7 @@ m_Rev->callback ((Fl_Callback*)cb_Rev); add (m_Rev); // 1/2 speed btn - m_Div = new Fl_Button (152, 130, 30, 30, "/2"); + m_Div = new Fl_Button (152, 124, 30, 30, "/2"); m_Div->labelsize (9); m_Div->box (FL_PLASTIC_UP_BOX); m_Div->color (Info->GUI_COLOUR); @@ -121,7 +131,7 @@ m_Div->callback ((Fl_Callback*)cb_Div); add (m_Div); // dbl speed btn - m_Dbl = new Fl_Button (182, 130, 30, 30, "X2"); + m_Dbl = new Fl_Button (182, 124, 30, 30, "X2"); m_Dbl->labelsize (9); m_Dbl->box (FL_PLASTIC_UP_BOX); m_Dbl->color (Info->GUI_COLOUR); @@ -129,7 +139,7 @@ m_Dbl->callback ((Fl_Callback*)cb_Dbl); add (m_Dbl); // nudge btn - m_Nudge = new Fl_Repeat_Button (212, 130, 30, 30, "Nudge"); + m_Nudge = new Fl_Repeat_Button (212, 124, 30, 30, "Nudge"); m_Nudge->labelsize (9); m_Nudge->box (FL_PLASTIC_UP_BOX); m_Nudge->color (Info->GUI_COLOUR); @@ -140,14 +150,10 @@ UpdatePitch (true, false, false); } -StreamPluginGUI::~StreamPluginGUI () { +StreamPluginGUI::~StreamPluginGUI() { } -// Update signalled from plugin - -void StreamPluginGUI::Update() { - float t=m_GUICH->GetFloat ("TimeOut"); - m_Pos->value (t); +void StreamPluginGUI::UpdateTime (float t) { m_Display[5]->value ((int)(t*100) % 10); m_Display[4]->value ((int)(t*10) % 10); m_Display[3]->value ((int)t % 10); @@ -155,8 +161,27 @@ m_Display[1]->value ((int)(t/60) % 10); m_Display[0]->value ((int)(t/600) % 10); redraw(); +} + +// Update signalled from plugin + +void StreamPluginGUI::Update() { + float t=m_GUICH->GetFloat ("TimeOut"); + if (t != m_Pos->value()) { + m_Pos->value (t); + UpdateTime(t); + } SetMaxTime (m_GUICH->GetFloat ("MaxTime")); if (m_Playing != m_GUICH->GetBool ("Playing")) UpdatePlayStatus (); + m_GUICH->GetData ("EchoFileName", (void*)m_TextBuf); + if (*m_TextBuf == 0) { + m_FileName->value ("Nothing Loaded"); + m_FileName->position (0); + } + else { + m_FileName->value (m_TextBuf); + m_FileName->position (strlen (m_TextBuf)-1); + } } // Update GUI on load @@ -165,6 +190,7 @@ StreamPlugin *Plugin = (StreamPlugin*)o; m_Volume->value (Plugin->GetVolume()); m_PitchValue = Plugin->GetPitch(); + UpdateTime (0.0); UpdatePitch (true, true, false); } @@ -218,7 +244,7 @@ // load inline void StreamPluginGUI::cb_Load_i (Fl_Button* o, void* v) { - char *fn=fl_file_chooser("Load a sample", "{*.wav,*.WAV}", NULL); + char *fn=WaveFileName (); if (fn && fn!='\0') { strcpy (m_TextBuf, fn); m_GUICH->SetData ("FileName", (void*)m_TextBuf); @@ -327,9 +353,13 @@ + "If you want to mix whole tracks and add effects etc, then this is the\n" + "way to do it. The StreamPlugin loads a wav in bit by bit, so it doesn't\n" + "use much memory. The track can be pitched for mixing.\n" - + "Operates pretty much like a media player such as XMMS (only wav\n" - + "format though).\n\n" - + "Connect the finish trigger to the stop trigger to play the wav only\nonce.\n\n" + + "Operates pretty much like a media player such as XMMS.\n\n" + + "Connect the finish trigger to the stop trigger to play the wav only\n" + + "once.\n\n" + + "The playing trigger is 'on' whilst the wave is actually playing\n" + + "and 'off' when it's not.\n\n" + + "The Position CV outputs 0 when not playing or at the start of the\n" + + "wave, and slowly increments up to 1 as the wave plays.\n\n" + "Note: Not realtime safe, if you're using JACK, use a client such as\n" + "alsaplayer."; } diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/StreamPlugin/StreamPluginGUI.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/StreamPlugin/StreamPluginGUI.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/StreamPlugin/StreamPluginGUI.h 2003-08-08 17:55:52.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/StreamPlugin/StreamPluginGUI.h 2012-05-31 04:13:57.000000000 +0000 @@ -21,6 +21,7 @@ #include #include +#include #include #include #include "StreamPlugin.h" @@ -43,9 +44,11 @@ void SetMaxTime (float t) { m_Pos->maximum(t); } void UpdatePitch (bool UpdateIt = true, bool DrawIt = true, bool SendIt = true); void UpdatePlayStatus (void); + void UpdateTime (float t); // Widgets Fl_SevenSeg *m_Display[6]; Fl_Knob *m_Volume; + Fl_Input *m_FileName; Fl_Slider *m_Pitch, *m_Pos; Fl_Button *m_Load, *m_ToStart, *m_Play, *m_Reset, *m_Rev, *m_Div, *m_Dbl; Fl_Repeat_Button* m_Nudge; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/StreamPlugin/StreamPlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/StreamPlugin/StreamPlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/StreamPlugin/StreamPlugin.h 2003-12-12 03:16:16.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/StreamPlugin/StreamPlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -16,13 +16,13 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef StreamPLUGIN +#define StreamPLUGIN + #include "../SpiralPlugin.h" #include "../../RiffWav.h" #include -#ifndef StreamPLUGIN -#define StreamPLUGIN - class StreamPlugin : public SpiralPlugin { public: StreamPlugin(); @@ -30,6 +30,8 @@ virtual PluginInfo &Initialise (const HostInfo *Host); virtual SpiralGUIType *CreateGUI(); virtual void Execute(); + virtual void Reset(); + virtual void ExecuteCommands(); virtual void StreamOut (std::ostream &s); virtual void StreamIn (std::istream &s); @@ -45,13 +47,9 @@ float m_GlobalPos, m_Pitch, m_SamplePos, m_Pos; enum Mode { PLAYM, STOPM } m_Mode; struct GUIArgs { - float Volume; - float PitchMod; - char FileName[256]; - float Time; - float TimeOut; - bool PlayOut; - float MaxTime; + float Volume, PitchMod, Time, TimeOut, MaxTime; + char FileName[256]; + bool PlayOut; } m_GUIArgs; float GetLength (void); // Commands diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/StreamPlugin/StreamPlugin.pro spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/StreamPlugin/StreamPlugin.pro --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/StreamPlugin/StreamPlugin.pro 2002-07-28 23:18:17.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/StreamPlugin/StreamPlugin.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -HEADERS = ../SpiralPlugin.h \ - ../SpiralPluginGUI.h \ - ../Widgets/Fl_Knob.H \ - ../Widgets/Fl_DragBar.H \ - ../Widgets/Fl_SevenSeg.H \ - ../../Sample.h \ - ../../RiffWav.h \ - StreamPlugin.h \ - StreamPluginGUI.h - -SOURCES = ../SpiralPlugin.C \ - ../SpiralPluginGUI.C \ - ../Widgets/Fl_Knob.cxx \ - ../Widgets/Fl_DragBar.cxx \ - ../Widgets/Fl_SevenSeg.cxx \ - ../../Sample.C \ - ../../RiffWav.C \ - StreamPlugin.C \ - StreamPluginGUI.C - -TARGET = StreamPlugin.so diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SVFilterPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SVFilterPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SVFilterPlugin/Makefile.in 2004-01-17 10:32:43.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SVFilterPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -13,10 +13,7 @@ LFLAGS = LIBS = @FLTK_LIBS@ MOC = moc -UIC = - -TAR = tar -cf -GZIP = gzip -9f +UIC = INSTALL = @INSTALL@ @@ -99,13 +96,6 @@ moc: $(SRCMOC) -tmake: - tmake SVFilterPlugin.pro - -dist: - $(TAR) SVFilterPlugin.tar SVFilterPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) SVFilterPlugin.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SVFilterPlugin/SVFilterPlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SVFilterPlugin/SVFilterPlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SVFilterPlugin/SVFilterPlugin.C 2003-11-13 01:16:57.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SVFilterPlugin/SVFilterPlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -100,6 +100,13 @@ this,m_AudioCH,m_HostInfo); } +void SVFilterPlugin::Reset() +{ + ResetPorts(); + fs = m_HostInfo->SAMPLERATE; + Clear(); +} + void SVFilterPlugin::Execute() { float in; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SVFilterPlugin/SVFilterPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SVFilterPlugin/SVFilterPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SVFilterPlugin/SVFilterPluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SVFilterPlugin/SVFilterPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -18,6 +18,7 @@ #include "SVFilterPluginGUI.h" #include +#include using namespace std; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SVFilterPlugin/SVFilterPlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SVFilterPlugin/SVFilterPlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SVFilterPlugin/SVFilterPlugin.h 2003-08-08 17:55:51.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SVFilterPlugin/SVFilterPlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -34,6 +34,8 @@ virtual PluginInfo &Initialise(const HostInfo *Host); virtual SpiralGUIType *CreateGUI(); virtual void Execute(); + virtual void Reset(); + virtual void StreamOut(std::ostream &s); virtual void StreamIn(std::istream &s); diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SVFilterPlugin/SVFilterPlugin.pro spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SVFilterPlugin/SVFilterPlugin.pro --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SVFilterPlugin/SVFilterPlugin.pro 2002-07-28 23:18:15.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SVFilterPlugin/SVFilterPlugin.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -HEADERS = ../SpiralPlugin.h \ - ../SpiralPluginGUI.h \ - ../Widgets/Fl_Knob.H \ - ../Widgets/Fl_DragBar.H \ - ../../Sample.h \ - SVFilterPlugin.h \ - SVFilterPluginGUI.h - -SOURCES = ../SpiralPlugin.C \ - ../SpiralPluginGUI.C \ - ../Widgets/Fl_Knob.cxx \ - ../Widgets/Fl_DragBar.cxx \ - ../../Sample.C \ - SVFilterPlugin.C \ - SVFilterPluginGUI.C - -TARGET = SVFilterPlugin.so diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SwitchPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SwitchPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SwitchPlugin/Makefile.in 2004-01-17 10:32:43.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SwitchPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -13,10 +13,7 @@ LFLAGS = LIBS = @FLTK_LIBS@ MOC = moc -UIC = - -TAR = tar -cf -GZIP = gzip -9f +UIC = INSTALL = @INSTALL@ diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SwitchPlugin/SwitchPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SwitchPlugin/SwitchPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/SwitchPlugin/SwitchPluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/SwitchPlugin/SwitchPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -18,6 +18,7 @@ #include "SwitchPluginGUI.h" #include +#include using namespace std; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/TranslatePlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/TranslatePlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/TranslatePlugin/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/TranslatePlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,140 @@ +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ @FLTK_CFLAGS@ +CXXFLAGS= @CXXFLAGS@ @FLTK_CXXFLAGS@ +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = @FLTK_LIBS@ +MOC = moc +UIC = + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = TranslatePlugin.h \ + TranslatePluginGUI.h \ + ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../../ChannelHandler.h \ + ../../Sample.h \ + ../../../GUI/Widgets/SpiralGUI.H +SOURCES = TranslatePlugin.C \ + TranslatePluginGUI.C \ + ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../../ChannelHandler.C \ + ../../Sample.C \ + ../../../GUI/Widgets/SpiralGUI.C +OBJECTS = TranslatePlugin.o \ + TranslatePluginGUI.o \ + ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../../ChannelHandler.o \ + ../../Sample.o \ + ../../../GUI/Widgets/SpiralGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = TranslatePlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../ChannelHandler.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../SpiralPlugin.h \ + ../../ChannelHandler.h \ + ../../../GUI/Widgets/SpiralGUI.H + +../../../GUI/Widgets/SpiralGUI.o: ../../../GUI/Widgets/SpiralGUI.C \ + ../../../GUI/Widgets/SpiralGUI.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h + +TranslatePlugin.o: TranslatePlugin.C \ + TranslatePlugin.h \ + TranslatePluginGUI.h \ + ../../NoteTable.h \ + ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + SpiralIcon.xpm + +TranslatePluginGUI.o: TranslatePluginGUI.C \ + TranslatePlugin.h \ + TranslatePluginGUI.h \ + ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../../../GUI/Widgets/SpiralGUI.H + +../../ChannelHandler.o: ../../ChannelHandler.C \ + ../../ChannelHandler.h diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/TranslatePlugin/SpiralIcon.xpm spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/TranslatePlugin/SpiralIcon.xpm --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/TranslatePlugin/SpiralIcon.xpm 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/TranslatePlugin/SpiralIcon.xpm 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,321 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"36 36 282 2", +" c None", +". c #8B889B", +"+ c #9C99AA", +"@ c #ADAAB9", +"# c #837F94", +"$ c #7D7990", +"% c #9995A7", +"& c #67627C", +"* c #CDCBD4", +"= c #FCFCFC", +"- c #D1D0D8", +"; c #FFFFFF", +"> c #F1F1F3", +", c #848095", +"' c #2A2248", +") c #CFCED6", +"! c #68637D", +"~ c #ABA8B6", +"{ c #D5D3DB", +"] c #9490A2", +"^ c #C4C4C4", +"/ c #1D1C1D", +"( c #313134", +"_ c #EEEFEE", +": c #FBFBFB", +"< c #EFEFEF", +"[ c #7B768D", +"} c #464060", +"| c #DEDEE1", +"1 c #CBCACC", +"2 c #EEEEF1", +"3 c #79758C", +"4 c #FBFBFC", +"5 c #A2A2A2", +"6 c #000000", +"7 c #F5F6F5", +"8 c #747474", +"9 c #2A2A2B", +"0 c #403958", +"a c #7D788F", +"b c #C0BEC8", +"c c #BCBAC6", +"d c #BCBAC5", +"e c #625C79", +"f c #2B2932", +"g c #191919", +"h c #CCCCCC", +"i c #807B91", +"j c #3B3556", +"k c #F2F2F4", +"l c #929292", +"m c #0E0E0E", +"n c #BFBFBF", +"o c #111111", +"p c #100E15", +"q c #868689", +"r c #FEFDFE", +"s c #D9D7DE", +"t c #9C98AA", +"u c #FDFCFD", +"v c #DDDDDD", +"w c #575755", +"x c #5E5E5E", +"y c #C4C2CD", +"z c #423C5C", +"A c #F0F0F2", +"B c #939393", +"C c #555555", +"D c #4A4A4A", +"E c #010101", +"F c #282828", +"G c #C2C2C2", +"H c #DBDAE0", +"I c #615C78", +"J c #F6F6F7", +"K c #DADADA", +"L c #545454", +"M c #0F0F0F", +"N c #B8B8B8", +"O c #48445C", +"P c #2B2B2C", +"Q c #181900", +"R c #D3D3D3", +"S c #C1BEC9", +"T c #474060", +"U c #31294D", +"V c #716C85", +"W c #65607A", +"X c #625D78", +"Y c #D5D4DB", +"Z c #F7F7F7", +"` c #8B8B8B", +" . c #161616", +".. c #0C0C0C", +"+. c #111300", +"@. c #151600", +"#. c #050500", +"$. c #191A00", +"%. c #393643", +"&. c #47415F", +"*. c #9692A4", +"=. c #D9D8DE", +"-. c #F7F7F8", +";. c #918DA0", +">. c #B8B5C1", +",. c #D1D1D1", +"'. c #252525", +"). c #0A0B00", +"!. c #101000", +"~. c #070800", +"{. c #727175", +"]. c #FEFEFF", +"^. c #9D99AA", +"/. c #DBD9E0", +"(. c #E9E9E9", +"_. c #CBCBCB", +":. c #E0E0E0", +"<. c #6C6C6C", +"[. c #0B0B00", +"}. c #515151", +"|. c #A6A6A7", +"1. c #827E93", +"2. c #615C77", +"3. c #EAEAED", +"4. c #DFDFE1", +"5. c #060700", +"6. c #060600", +"7. c #FFFF00", +"8. c #1E1D24", +"9. c #9894A7", +"0. c #B1AEBB", +"a. c #69686F", +"b. c #000001", +"c. c #101100", +"d. c #615C76", +"e. c #5F5A75", +"f. c #413E4D", +"g. c #020203", +"h. c #050600", +"i. c #1A1A1C", +"j. c #C3C1CB", +"k. c #9D9D9D", +"l. c #202020", +"m. c #383838", +"n. c #4C4C4C", +"o. c #C9C7D0", +"p. c #F1F1F1", +"q. c #F8F8F8", +"r. c #232323", +"s. c #050408", +"t. c #AEACB9", +"u. c #FEFEFE", +"v. c #1D1D1D", +"w. c #B7B5C1", +"x. c #9390A2", +"y. c #BBBBBB", +"z. c #414141", +"A. c #030303", +"B. c #28272A", +"C. c #F4F4F6", +"D. c #605B76", +"E. c #736E86", +"F. c #D8D8D8", +"G. c #727272", +"H. c #101010", +"I. c #848486", +"J. c #CCCBD3", +"K. c #747087", +"L. c #6D6881", +"M. c #1C1C1C", +"N. c #242424", +"O. c #656566", +"P. c #F6F6F6", +"Q. c #E8E6EA", +"R. c #706B84", +"S. c #E3E1E6", +"T. c #474746", +"U. c #151515", +"V. c #C8C8C8", +"W. c #AEAEAE", +"X. c #080808", +"Y. c #373639", +"Z. c #FDFCFE", +"`. c #ABA8B7", +" + c #F1F0F3", +".+ c #6D6980", +"++ c #0A090E", +"@+ c #95929E", +"#+ c #0A0810", +"$+ c #0D0D0D", +"%+ c #050505", +"&+ c #5B5A5C", +"*+ c #F7F6F7", +"=+ c #F4F3F5", +"-+ c #908C9F", +";+ c #C8C6D0", +">+ c #837E96", +",+ c #86868A", +"'+ c #070608", +")+ c #ECEBEE", +"!+ c #5B5571", +"~+ c #646078", +"{+ c #AFAFB0", +"]+ c #454545", +"^+ c #363636", +"/+ c #7A7A7A", +"(+ c #C8C8C9", +"_+ c #212025", +":+ c #060607", +"<+ c #969699", +"[+ c #FAFAFA", +"}+ c #F8F8F9", +"|+ c #A29EAF", +"1+ c #F7F6F8", +"2+ c #F0F0F1", +"3+ c #B8B7B9", +"4+ c #E4E4E4", +"5+ c #FDFDFD", +"6+ c #A5A2B2", +"7+ c #3B3456", +"8+ c #A8A5B4", +"9+ c #525252", +"0+ c #848387", +"a+ c #CDCDCD", +"b+ c #8D899C", +"c+ c #494262", +"d+ c #68627C", +"e+ c #40395A", +"f+ c #ECECEC", +"g+ c #020202", +"h+ c #B4B5B5", +"i+ c #0B0B0B", +"j+ c #313232", +"k+ c #E3E3E3", +"l+ c #B1AEBC", +"m+ c #BDBBC6", +"n+ c #3C3556", +"o+ c #898599", +"p+ c #EDEDED", +"q+ c #39393A", +"r+ c #040404", +"s+ c #333333", +"t+ c #F5F5F5", +"u+ c #2B2B2B", +"v+ c #2D2A3D", +"w+ c #B6B4C1", +"x+ c #F5F5F6", +"y+ c #605A76", +"z+ c #DAD8DF", +"A+ c #F5F4F6", +"B+ c #615B76", +"C+ c #524D6A", +"D+ c #E4E3E8", +"E+ c #D5D5D5", +"F+ c #1B1B1B", +"G+ c #303030", +"H+ c #AAABAB", +"I+ c #585464", +"J+ c #B0AEBB", +"K+ c #A29FAF", +"L+ c #E9E8E9", +"M+ c #787779", +"N+ c #0F0E15", +"O+ c #2D2D2E", +"P+ c #595959", +"Q+ c #FAFAFB", +"R+ c #807B92", +"S+ c #B0ADBB", +"T+ c #E8E7EB", +"U+ c #3A3258", +"V+ c #E6E5EA", +"W+ c #DFDEE3", +"X+ c #443E5E", +"Y+ c #BAB8C4", +"Z+ c #C1BFCA", +"`+ c #E0E0E5", +" @ c #D0CED6", +".@ c #362F52", +"+@ c #CECCD5", +"@@ c #413A5B", +"#@ c #6A657F", +"$@ c #9793A6", +" ", +" ", +" ", +" . + @ # $ % ", +" & * = * - ; > , ' ; ; ; ) ! ", +" ~ ; ; { ] ; ^ / ( _ ; : < [ ", +" } | 1 2 3 4 5 6 6 7 : 8 9 0 a b ", +" c : d e f g h i j k l 6 m ; n o 6 p q r s ", +" t u ; v w 6 6 x y z A B 6 C ; D E 6 F G ; H ", +" I J ; ; K L 6 6 M N O P E 6 6 6 Q Q M R S T U V W ", +" X Y ; ; ; ; Z ` .6 ..6 6 6 6 6 +.@.#.$.%.&.*.=.-.;. ", +" >.; ; ; ; ; ; = ,.'.6 ).!.~.6 6 6 6 6 6 E {.].; ; ^. ", +" /.; ; (.R h _.:.<.6 [.~.6 6 6 6 6 6 6 6 6 E }.|.4 1. ", +" 2.3.; 4...6 6 6 6 6 5.6.7.7.7.7.7.7.7.7.6 7.6 6 8.9. ", +" V @ 0.a.b.6 6 6 6 6 c.6 7.6 6 6 6 6 6 7.6 6 7.6 ", +" d.e.f.6 g.6 6 6 6 h.6 7.6 6 6 6 6 6 7.6 6 6 7.i. ", +" j.; ; k.l.l.m.n.7.7.7.7.7.6 6 6 6 6 6 7.7.7.7.7.7. ", +" o.; ; p.q.; ; ; r.6 6 6 7.6 6 6 6 6 6 7.6 6 6 7.s. ", +" t.; ; ; ; u.; ; v.6 6 6 7.6 6 6 6 6 6 7.6 6 7.6 6 w., ", +" x.; ; u.; : y.z.A.6 6 6 7.7.7.7.7.7.7.7.6 7.6 6 B.u.C.D. ", +" E.; ; ; F.G.H.6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 I.; ; J.K. ", +" L.J ; : M.6 6 6 6 N...6 6 6 6 6 6 6 6 6 6 6 6 6 O.P.; ; Q.R. ", +" S.; ; T.6 E 6 U.V.W.X.6 6 6 6 6 6 6 6 6 6 6 6 6 Y.Z.; ; > R. ", +" `.; +.+++6 6 W.u.; @+#+6 6 6 6 6 6 6 6 $+%+6 6 6 &+*+; ; =+-+ ", +" R.;+! >+,+'+x ; ; )+!+~+{+l ]+6 6 6 ^+/+(+_+6 6 6 :+<+[+; ; }+@ ", +" |+1+2+3+4+5+; 6+7+8+; P.]+6 6 E 9+; ; 0+6 6 E 6 o a+; ; = b+ ", +" c+> ; ; ; ; ; ; d+e+; ; f+m.6 6 g+D ; ; h+i+6 6 6 j+k+; ; l+ ", +" > ; ; ; ; m+n+o+; ; p+q+6 6 r+s+; ; t+u+6 6 v+w+; x+3 ", +" y+z+= ; A+B+C+D+; ; E+F+6 6 g+G+; ; ; H+9+I+ ", +" J+4 K+ X ; ; ; L+M+G+N+O+P+; ; ; u.Q+R+ ", +" S+; ; ; ; ; T+U+V+; ; ; ; = W+X+ ", +" Y+Z+`+4 ; ; @.@+@; ; ; s o+T ", +" @@ #@$@o+ ", +" ", +" ", +" "}; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/TranslatePlugin/TranslatePlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/TranslatePlugin/TranslatePlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/TranslatePlugin/TranslatePlugin.C 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/TranslatePlugin/TranslatePlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,148 @@ +/* SpiralSound + * Copyleft (C) 2003 Andy Preston + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "TranslatePlugin.h" +#include "TranslatePluginGUI.h" +#include "SpiralIcon.xpm" +#include "../../NoteTable.h" + +using namespace std; + +extern "C" { + +SpiralPlugin* SpiralPlugin_CreateInstance () { return new TranslatePlugin; } + +char** SpiralPlugin_GetIcon () { return SpiralIcon_xpm; } + +int SpiralPlugin_GetID () { return 121; } + +string SpiralPlugin_GetGroupName() { return "Control"; } + +} + +/////////////////////////////////////////////////////// + +float TranslatePass::Translate (float i) { + return i; +} + +float TranslateNoteToFreq::Translate (float i) { + return (i + 1.0f) * (MAX_FREQ / 2); +} + +float TranslateFreqToNote::Translate (float i) { + return (i / MAX_FREQ * 2) - 1.0f; +} + +float TranslateNoteToVolt::Translate (float i) { + float Freq = (i + 1.0f) * (MAX_FREQ / 2); + float Dif, MinDif = 30000; + int Match=0; + for (int c=0; c<131; c++) { + Dif = fabs (NoteTable[c] - Freq); + if (Dif > MinDif) break; + MinDif = Dif; + Match = c; + } + return (float)Match; +} + +float TranslateVoltToNote::Translate (float i) { + return (NoteTable[int (i)] / MAX_FREQ * 2) - 1.0f; +} + +/////////////////////////////////////////////////////// + +TranslatePlugin::TranslatePlugin () : +m_Method (tr_Pass), +m_Translator (NULL) +{ + m_PluginInfo.Name = "Translate"; + m_PluginInfo.Width = 150; + m_PluginInfo.Height = 60; + m_PluginInfo.NumInputs = 1; + m_PluginInfo.NumOutputs = 1; + m_PluginInfo.PortTips.push_back ("Input"); + m_PluginInfo.PortTips.push_back ("Output"); + m_AudioCH->Register ("Method", &m_Method); + SetUpTranslatorClass (); +} + +TranslatePlugin::~TranslatePlugin () { + if (m_Translator) delete m_Translator; +} + +PluginInfo &TranslatePlugin::Initialise (const HostInfo *Host) { + return SpiralPlugin::Initialise (Host); +} + +SpiralGUIType *TranslatePlugin::CreateGUI() { + return new TranslatePluginGUI (m_PluginInfo.Width, m_PluginInfo.Height, this, m_AudioCH, m_HostInfo); +} + +void TranslatePlugin::SetUpTranslatorClass (void) { + if (m_Translator) { + delete m_Translator; + m_Translator = NULL; + } + switch (m_Method) { + case tr_Pass: + m_Translator = new TranslatePass; + break; + case tr_NoteToFreq: + m_Translator = new TranslateNoteToFreq; + break; + case tr_FreqToNote: + m_Translator = new TranslateFreqToNote; + break; + case tr_NoteToVolt: + m_Translator = new TranslateNoteToVolt; + break; + case tr_VoltToNote: + m_Translator = new TranslateVoltToNote; + break; + } +} + +void TranslatePlugin::ExecuteCommands () { + if (m_AudioCH->IsCommandWaiting ()) { + switch (m_AudioCH->GetCommand()) { + case SETMETHOD: + SetUpTranslatorClass (); + break; + } + } +} + +void TranslatePlugin::Execute () { + for (int n=0; nBUFSIZE; n++) { + SetOutput (0, n, m_Translator->Translate (GetInput (0, n))); + } +} + +void TranslatePlugin::StreamOut (ostream &s) { + s << m_Version << endl; + s << m_Method; +} + +void TranslatePlugin::StreamIn (istream &s) { + int version; + s >> version; + s >> m_Method; + SetUpTranslatorClass (); +} diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/TranslatePlugin/TranslatePluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/TranslatePlugin/TranslatePluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/TranslatePlugin/TranslatePluginGUI.C 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/TranslatePlugin/TranslatePluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,62 @@ +/* SpiralPlugin + * Copyleft (C) 2003 Andy Preston + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "TranslatePluginGUI.h" +#include + +using namespace std; + +//////////////////////////////////////////// + +TranslatePluginGUI::TranslatePluginGUI (int w, int h,TranslatePlugin *o,ChannelHandler *ch,const HostInfo *Info) : +SpiralPluginGUI (w, h, o, ch) +{ + m_Method = new Fl_Choice (0, 20, 150, 20, ""); + //m_Method->color (Info->GUI_COLOUR); + m_Method->box (FL_PLASTIC_UP_BOX); + m_Method->textsize (10); + m_Method->labelsize (10); + m_Method->callback ((Fl_Callback*) cb_Method); + m_Method->add ("Pass Through"); + m_Method->add ("Note -> Frequency"); + m_Method->add ("Frequency -> Note"); + m_Method->add ("Note -> Note Number"); + m_Method->add ("Note Number -> Note"); + m_Method->value (0); + add (m_Method); + end (); +} + +void TranslatePluginGUI::UpdateValues (SpiralPlugin *o) { + TranslatePlugin *Plugin = (TranslatePlugin *)o; + m_Method->value (Plugin->GetMethod ()); +} + +inline void TranslatePluginGUI::cb_Method_i (Fl_Choice *o, void *v) { + m_GUICH->Set ("Method", int (o->value ())); + m_GUICH->SetCommand (TranslatePlugin::SETMETHOD); +} + +void TranslatePluginGUI::cb_Method (Fl_Choice *o, void *v) { + ((TranslatePluginGUI*)(o->parent ()))->cb_Method_i (o, v); +} + +const string TranslatePluginGUI::GetHelpText (const string &loc) { + return string("") + + "Translates control voltages into other formats."; +} diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/TranslatePlugin/TranslatePluginGUI.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/TranslatePlugin/TranslatePluginGUI.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/TranslatePlugin/TranslatePluginGUI.h 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/TranslatePlugin/TranslatePluginGUI.h 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,39 @@ +/* SpiralPlugin + * Copyleft (C) 2003 Andy Preston + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include "TranslatePlugin.h" +#include "../SpiralPluginGUI.h" + +#ifndef TranslateGUI +#define TranslateGUI + +class TranslatePluginGUI : public SpiralPluginGUI { + public: + TranslatePluginGUI (int w, int h, TranslatePlugin *o, ChannelHandler *ch, const HostInfo *Info); + virtual void UpdateValues (SpiralPlugin *o); + protected: + const std::string GetHelpText (const std::string &loc); + private: + Fl_Choice *m_Method; + inline void cb_Method_i (Fl_Choice *o, void *v); + static void cb_Method (Fl_Choice *o, void *v); +}; + +#endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/TranslatePlugin/TranslatePlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/TranslatePlugin/TranslatePlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/TranslatePlugin/TranslatePlugin.h 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/TranslatePlugin/TranslatePlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,78 @@ +/* SpiralSound + * Copyleft (C) 2003 Andy Preston + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../SpiralPlugin.h" +#include + +#ifndef TranslatePLUGIN +#define TranslatePLUGIN + +class TranslatePlugin; + +class TranslateClass { + public: + virtual float Translate (float i) = 0; +}; + +class TranslatePass : public TranslateClass { + public: + virtual float Translate (float i); +}; + +class TranslateNoteToFreq : public TranslateClass { + public: + virtual float Translate (float i); +}; + +class TranslateFreqToNote : public TranslateClass { + public: + virtual float Translate (float i); +}; + +class TranslateNoteToVolt : public TranslateClass { + public: + virtual float Translate (float i); +}; + +class TranslateVoltToNote : public TranslateClass { + public: + virtual float Translate (float i); +}; + +//////////////////////////////////////////////////////////////////////// + +class TranslatePlugin : public SpiralPlugin { + public: + TranslatePlugin(); + virtual ~TranslatePlugin (); + virtual PluginInfo& Initialise (const HostInfo *Host); + virtual SpiralGUIType* CreateGUI (); + virtual void Execute (); + enum GUICommands { NOCMD, SETMETHOD }; + virtual void ExecuteCommands (); + virtual void StreamOut (std::ostream &s); + virtual void StreamIn (std::istream &s); + enum TranMethod { tr_Pass, tr_NoteToFreq, tr_FreqToNote, tr_NoteToVolt, tr_VoltToNote }; + int GetMethod (void) { return m_Method; } + private: + int m_Method; + TranslateClass *m_Translator; + void SetUpTranslatorClass (void); +}; + +#endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/TransposePlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/TransposePlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/TransposePlugin/Makefile.in 2004-01-17 10:32:43.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/TransposePlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -11,9 +11,6 @@ MOC = moc UIC = -TAR = tar -cf -GZIP = gzip -9f - INSTALL = @INSTALL@ ###### Autoconf variables @@ -92,10 +89,6 @@ moc: $(SRCMOC) -dist: - $(TAR) TransposePlugin.tar TransposePlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) TransposePlugin.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/TransposePlugin/TransposePlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/TransposePlugin/TransposePlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/TransposePlugin/TransposePlugin.C 2003-08-08 17:55:52.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/TransposePlugin/TransposePlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -16,6 +16,11 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include +#include +#include +#include + #include "TransposePlugin.h" #include "TransposePluginGUI.h" #include "SpiralIcon.xpm" @@ -47,7 +52,8 @@ TransposePlugin::TransposePlugin () : m_Amount(0), -m_Out(0.0) +m_Out(0.0), +m_BufferInitialized(false) { m_PluginInfo.Name = "Transpose"; m_PluginInfo.Width = 80; @@ -71,25 +77,36 @@ return new TransposePluginGUI (m_PluginInfo.Width, m_PluginInfo.Height, this, m_AudioCH, m_HostInfo); } + + void TransposePlugin::Execute () { - int Match [2]; - for (int n=0; nBUFSIZE; n++) { - Match[0]=0; - Match[1]=0; - for (int i=0; i<2 && InputExists(i); i++) { - float Freq, Dif, MinDif = 30000; - Freq = GetInputPitch (i, n); - for (int c=0; c<131; c++) { - Dif = fabs (NoteTable[c] - Freq); - if (Dif > MinDif) break; - MinDif=Dif; - Match[i]=c; - } - } - if (! InputExists (1)) Match[1] = m_Amount; - m_Out = NoteTable [(Match[0] + Match[1]) % 132]; - SetOutputPitch (0, n, m_Out); - } + float base=110, transpose=m_Amount; + float alpha = 17.312340490667; + + for (int n=0; nBUFSIZE; n++) + { + float input0 = GetInputPitch(0, n); + float input1 = GetInputPitch(1, n); + + if (input0 > 0) + { + // input's half steps from base of 110 = round(alpha*logf(GetInputPitch(0, n)/110)); + // cv's half steps from base of 110 = round(alpha*logf(GetInputPitch(1, n)/110)); + + base = floor((alpha*logf(input0/110.0)) + 0.5); + if (InputExists(1)) + { + transpose = (input1 > 0)?floor((alpha*logf(input1/110)) + 0.5):8.176; + } + + m_Out = 110 * powf(2, (base+transpose) / 12); + } + else + { + m_Out = 8.176; + } + SetOutputPitch (0, n, m_Out); + } } void TransposePlugin::StreamOut (ostream &s) { diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/TransposePlugin/TransposePlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/TransposePlugin/TransposePlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/TransposePlugin/TransposePlugin.h 2003-08-08 17:55:52.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/TransposePlugin/TransposePlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -23,19 +23,22 @@ #define TransposePLUGIN class TransposePlugin : public SpiralPlugin { - public: - TransposePlugin(); - virtual ~TransposePlugin (); - virtual PluginInfo& Initialise (const HostInfo *Host); - virtual SpiralGUIType* CreateGUI (); - virtual void Execute (); - //virtual void ExecuteCommands (); - virtual void StreamOut (std::ostream &s); - virtual void StreamIn (std::istream &s); - int GetAmount () { return m_Amount; } - private: - int m_Amount; - float m_Out; +public: + TransposePlugin(); + virtual ~TransposePlugin (); + virtual PluginInfo& Initialise (const HostInfo *Host); + virtual SpiralGUIType* CreateGUI (); + virtual void Execute (); + //virtual void ExecuteCommands (); + virtual void StreamOut (std::ostream &s); + virtual void StreamIn (std::istream &s); + int GetAmount () { return m_Amount; } +private: + int m_Amount; + float m_Out; + + float m_Buffer[2][2]; + bool m_BufferInitialized; }; #endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/TrigPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/TrigPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/TrigPlugin/Makefile.in 2004-01-17 10:32:43.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/TrigPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -13,10 +13,7 @@ LFLAGS = LIBS = @FLTK_LIBS@ MOC = moc -UIC = - -TAR = tar -cf -GZIP = gzip -9f +UIC = INSTALL = @INSTALL@ diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/TrigPlugin/TrigPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/TrigPlugin/TrigPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/TrigPlugin/TrigPluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/TrigPlugin/TrigPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -18,6 +18,7 @@ #include "TrigPluginGUI.h" #include +#include #include using namespace std; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/WaveShaperPlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/WaveShaperPlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/WaveShaperPlugin/Makefile.in 2004-01-17 10:32:43.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/WaveShaperPlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -15,9 +15,6 @@ MOC = moc UIC = -TAR = tar -cf -GZIP = gzip -9f - INSTALL = @INSTALL@ ###### Autoconf variables @@ -102,13 +99,6 @@ moc: $(SRCMOC) -tmake: - tmake WaveShaperPlugin.pro - -dist: - $(TAR) WaveShaperPlugin.tar WaveShaperPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) WaveShaperPlugin.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/WaveShaperPlugin/WaveShaperPlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/WaveShaperPlugin/WaveShaperPlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/WaveShaperPlugin/WaveShaperPlugin.C 2003-08-08 17:55:52.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/WaveShaperPlugin/WaveShaperPlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -96,6 +96,12 @@ } } +void WaveShaperPlugin::Reset() +{ + ResetPorts(); + calc(); +} + void WaveShaperPlugin::Execute () { float k1, k2; if (!InputExists (0)) return; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/WaveShaperPlugin/WaveShaperPluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/WaveShaperPlugin/WaveShaperPluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/WaveShaperPlugin/WaveShaperPluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/WaveShaperPlugin/WaveShaperPluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -19,6 +19,7 @@ #include "WaveShaperPluginGUI.h" #include +#include #include using namespace std; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/WaveShaperPlugin/WaveShaperPlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/WaveShaperPlugin/WaveShaperPlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/WaveShaperPlugin/WaveShaperPlugin.h 2003-08-08 17:55:52.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/WaveShaperPlugin/WaveShaperPlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -30,6 +30,7 @@ virtual PluginInfo& Initialise (const HostInfo *Host); virtual SpiralGUIType* CreateGUI(); virtual void Execute(); + virtual void Reset(); virtual void ExecuteCommands(); virtual void StreamOut(std::ostream &s); virtual void StreamIn(std::istream &s); diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/WaveTablePlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/WaveTablePlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/WaveTablePlugin/Makefile.in 2004-01-17 10:32:43.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/WaveTablePlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -13,10 +13,7 @@ LFLAGS = LIBS = @FLTK_LIBS@ MOC = moc -UIC = - -TAR = tar -cf -GZIP = gzip -9f +UIC = INSTALL = @INSTALL@ @@ -110,13 +107,6 @@ moc: $(SRCMOC) -tmake: - tmake WaveTablePlugin.pro - -dist: - $(TAR) WaveTablePlugin.tar WaveTablePlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) WaveTablePlugin.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/WaveTablePlugin/WaveTablePlugin.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/WaveTablePlugin/WaveTablePlugin.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/WaveTablePlugin/WaveTablePlugin.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/WaveTablePlugin/WaveTablePlugin.C 2012-05-31 04:13:57.000000000 +0000 @@ -160,6 +160,22 @@ } } +void WaveTablePlugin::Reset() +{ + ResetPorts(); + + for (int n=0; n +#include #include "../GUI/WS_Square.h" #include "../GUI/WS_Saw.h" #include "../GUI/WS_RevSaw.h" diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/WaveTablePlugin/WaveTablePlugin.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/WaveTablePlugin/WaveTablePlugin.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/WaveTablePlugin/WaveTablePlugin.h 2003-08-08 17:55:52.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/WaveTablePlugin/WaveTablePlugin.h 2012-05-31 04:13:57.000000000 +0000 @@ -34,6 +34,8 @@ virtual PluginInfo &Initialise(const HostInfo *Host); virtual SpiralGUIType *CreateGUI(); virtual void Execute(); + virtual void Reset(); + virtual void StreamOut(std::ostream &s); virtual void StreamIn(std::istream &s); diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/WaveTablePlugin/WaveTablePlugin.pro spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/WaveTablePlugin/WaveTablePlugin.pro --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/WaveTablePlugin/WaveTablePlugin.pro 2002-07-28 23:18:17.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/WaveTablePlugin/WaveTablePlugin.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -HEADERS = ../SpiralPlugin.h \ - ../SpiralPluginGUI.h \ - ../Widgets/Fl_Knob.H \ - ../Widgets/Fl_DragBar.H \ - ../../Sample.h \ - WaveTablePlugin.h \ - WaveTablePluginGUI.h - -SOURCES = ../SpiralPlugin.C \ - ../SpiralPluginGUI.C \ - ../Widgets/Fl_Knob.cxx \ - ../Widgets/Fl_DragBar.cxx \ - ../../Sample.C \ - WaveTablePlugin.C \ - WaveTablePluginGUI.C - -TARGET = WaveTablePlugin.so diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/Widgets/Fl_EventMap.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/Widgets/Fl_EventMap.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/Widgets/Fl_EventMap.C 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/Widgets/Fl_EventMap.C 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,552 @@ +/* EventMap Widget + * Copyleft (C) 2001 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "Fl_EventMap.h" +#include +#include +#include +#include + +static const int AREA_WIDTH = 1000; +static const int AREA_HEIGHT = 1000; +static const int BUTTON_COLOUR = 10; + +static const int EVENT_COLOUR = 0; + +int BG_COLOUR;// = 139; +int BLACK_KEY_COL;// = 141; +int LINE_COLOUR;// = 140; + +//////////////////////////////////////////////////////////////////// + +Fl_EventMap::Fl_EventMap(int x, int y, int ww, int h, const char* label) : +Fl_Group(x,y,ww,h,label), +m_Type(ARRANGE_MAP), +m_Update(true), +m_Zoom(1.0f), +m_GridSizeX(0), +m_GridSizeY(10), +m_PixelsPerSec(100), +m_NextID(0), +m_StartLoop(1.0f), +m_EndLoop(2.0f), +m_Pos(0), +m_LastPos(0), +m_DrawBeats(true), +m_BarLength(1), +m_BeatsBar(4), +m_FirstUpdate(true) +{ + box(FL_FLAT_BOX); + + fl_color(0,100,161); + BG_COLOUR=fl_color(); + fl_color(0,90,150); + BLACK_KEY_COL=fl_color(); + fl_color(0,80,150); + LINE_COLOUR=fl_color(); + + fl_color(200,200,200); +// SpiralSound/Plugins/Widgets/Fl_EventMap.C:65: declaration of `w' shadows a parameter + int w=fl_color(); + fl_color(50,50,50); + int b=fl_color(); + + // white/black keys for the melody + m_KeyColMap[0] = w; + m_KeyColMap[1] = b; + m_KeyColMap[2] = w; + m_KeyColMap[3] = b; + m_KeyColMap[4] = w; + m_KeyColMap[5] = w; + m_KeyColMap[6] = b; + m_KeyColMap[7] = w; + m_KeyColMap[8] = b; + m_KeyColMap[9] = w; + m_KeyColMap[10] = b; + m_KeyColMap[11] = w; +} + +void Fl_EventMap::SetCallbacks(const EventCallbacks &s) +{ + m_Callbacks.cb_NewEvent=s.cb_NewEvent; + m_Callbacks.cb_EventDoubleClicked=s.cb_EventDoubleClicked; + m_Callbacks.cb_CopyEvent=s.cb_CopyEvent; + m_Callbacks.cb_CloneEvent=s.cb_CloneEvent; + m_Callbacks.cb_InstanceEvent=s.cb_InstanceEvent; + m_Callbacks.cb_MoveEvent=s.cb_MoveEvent; + m_Callbacks.cb_EditEvent=s.cb_EditEvent; + m_Callbacks.cb_DelEvent=s.cb_DelEvent; + m_Callbacks.cb_RenameEvent=s.cb_RenameEvent; + m_Callbacks.cb_Recolour=s.cb_Recolour; +} + +void Fl_EventMap::CreateWindow() +{ + show(); +} + +void Fl_EventMap::draw() +{ + Fl_Widget*const* a = array(); + if (!(damage() & ~FL_DAMAGE_CHILD)) + { + for (int i=children(); i--;) update_child(**a++); + return; + } + + draw_box(); + m_FirstUpdate=true; + + fl_color(BG_COLOUR); + fl_rectf(x(),y(),w(),h()); + // draw the section markers + + if (m_GridSizeY) + { + int c=0; + // draw the snap points + for (int n=y(); n::iterator i=m_EventMap.begin(); + i!=m_EventMap.end(); i++) + { + Fl_SEvent *pEvent = i->second; + + if (pEvent->Killed()) + { + RemoveEvent(i->first); + } + } + + return event; +} + +void Fl_EventMap::SetZoomLevel(float s) +{ + m_Zoom=s; + m_PixelsPerSec=int(100/m_Zoom); + + vector EventVec; + for (map::iterator i=m_EventMap.begin(); + i!=m_EventMap.end(); i++) + { + i->second->SetPixelsPerSec(m_PixelsPerSec); + } + + redraw(); +} + +void Fl_EventMap::SetSnapGap(float s) +{ + m_GridSizeX=(int)(s*(float)m_PixelsPerSec); + + for (map::iterator i=m_EventMap.begin(); + i!=m_EventMap.end(); i++) + { + i->second->SetSnapGap(s); + } + + redraw(); +} + +void Fl_EventMap::SetTime(float Time) +{ + assert(m_PixelsPerSec!=0); + + Time -= m_TimeOffset; + + m_Pos = (int)(Time*m_PixelsPerSec); + + // line marker update + // all in all, some orrible code... + if (m_Update && window()->visible() && visible_r() && m_Pos!=m_LastPos) + { + window()->make_current(); + int DrawPos=m_Pos+x(); + + int Left=parent()->x(); + int Top=parent()->y(); + int Width=parent()->w(); + int Depth=parent()->h(); + + if (DrawPos>Left && DrawPos Fl_EventMap::GetEvents(float Time) +{ + SetTime(Time); + + vector EventVec; + for (map::iterator i=m_EventMap.begin(); + i!=m_EventMap.end(); i++) + { + Fl_SEvent *pEvent = i->second; + + bool State=pEvent->UpdateState(Time); + + EventInfo::Type type=EventInfo::ON; + + if (pEvent->AtStart()) type=EventInfo::START; + if (pEvent->AtEnd()) type=EventInfo::END; + + // Collect the events happening now, or just finished + if(State || pEvent->AtEnd()) + { + EventVec.push_back(EventInfo(pEvent->GetID(),pEvent->GetGroup(), + type,pEvent->GetStartTime())); + } + } + return EventVec; +} + +int Fl_EventMap::GetGroupFromY(int y) +{ + return y/m_GridSizeY; +} + +int Fl_EventMap::AddEventTime(float st, int g, float lt, Fl_SEvent::Type EType, bool CallBack) +{ + int ex,ey,ew; + ex=(int)(st*(float)m_PixelsPerSec)+x(); + ew=(int)(lt*(float)m_PixelsPerSec); + ey=g*m_GridSizeY+y(); + + return AddEvent(ex, ey, ew, EType, CallBack); +} + +int Fl_EventMap::AddEvent(int x, int y, int w, Fl_SEvent::Type EType, bool CallBack) +{ + Fl_SEvent *NewEvent; + if (m_Type==PERCUSSION_MAP) + { + NewEvent = new Fl_CircEvent(x,y,w,m_GridSizeY); + } + else + { + NewEvent = new Fl_SEvent(x,y,w,m_GridSizeY); + } + + if (m_Type==MELODY_MAP) NewEvent->LockResize(false); + + NewEvent->SetPixelsPerSec(m_PixelsPerSec, true); + NewEvent->color(EVENT_COLOUR); + NewEvent->labelsize(10); + NewEvent->SetID(m_NextID++); + + NewEvent->SetType(EType); + char Name[256]; + if (m_Type==ARRANGE_MAP) + { + if(NewEvent->GetType()==Fl_SEvent::MELODY) + sprintf(Name,"Melody %d",NewEvent->GetID()); + + if(NewEvent->GetType()==Fl_SEvent::PERCUSSION) + sprintf(Name,"Percussion %d",NewEvent->GetID()); + + } + else sprintf(Name,"This shouldnt be read!"); + + NewEvent->SetName(Name); + NewEvent->SetGridX(m_GridSizeX); + NewEvent->SetGridY(m_GridSizeY); + + map::iterator i=m_EventMap.find(NewEvent->GetID()); + if (i!=m_EventMap.end()) + { + cerr<<"Event ID not unique, not added!"<BuildMenu(); + + NewEvent->SnapX(); + NewEvent->SnapY(); + + NewEvent->SetPixelsPerSec(m_PixelsPerSec,true); + + m_EventMap[NewEvent->GetID()]=NewEvent; + + int pID = NewEvent->GetID(); + if (m_Callbacks.cb_NewEvent && CallBack) m_Callbacks.cb_NewEvent(NewEvent,&pID); + + redraw(); + return NewEvent->GetID(); +} + +int Fl_EventMap::CopyEvent(int x, int y, int w, int ID, float LengthTime) +{ + // make the new widget + int NewID = AddEvent(x,y,w,m_EventMap[ID]->GetType(),false); + + // set the length of time exactly, as rounding + // errors cause a reinit of the sample memory + GetEvent(NewID)->SetLengthTime(LengthTime); + + //string Name="Copy of "+m_EventMap[ID]->GetName(); + //GetEvent(NewID)->SetName(Name); + + GetEvent(NewID)->SetName(m_EventMap[ID]->GetName()); + GetEvent(NewID)->SetColour(m_EventMap[ID]->GetColour()); + GetEvent(NewID)->SetChannel(m_EventMap[ID]->GetChannel()); + + return NewID; +} + +void Fl_EventMap::RemoveAllEvents() +{ + for (map::iterator i=m_EventMap.begin(); + i!=m_EventMap.end(); i++) + { + Fl_SEvent *e=i->second; + remove(e); + m_EventMap.erase(i); + delete(e); + } + m_EventMap.clear(); + m_NextID=0; + + redraw(); +} + +void Fl_EventMap::RemoveEvent(int ID) +{ + map::iterator i=m_EventMap.find(ID); + if (i==m_EventMap.end()) + { + cerr<<"Event ID not found to delete"<second; + remove(e); + m_EventMap.erase(i); + delete(e); + + cerr<<"removed "<::iterator i=m_EventMap.find(ID); + if (i==m_EventMap.end()) + { + cerr<<"Event ID not found"<SetLengthTime(l); +} + +void Fl_EventMap::CopyFrom(Fl_EventMap *Other) +{ + m_Type = Other->m_Type; + m_Zoom = Other->m_Zoom; + m_GridSizeX = Other->m_GridSizeX; + m_GridSizeY = Other->m_GridSizeY; + m_PixelsPerSec = Other->m_PixelsPerSec; + m_StartLoop = Other->m_StartLoop; + m_EndLoop = Other->m_EndLoop; + m_Pos = Other->m_Pos; + m_LastPos = Other->m_LastPos; + m_BarLength = Other->m_BarLength; + m_BeatsBar = Other->m_BeatsBar; + m_NextID = Other->m_NextID; + + for (map::iterator i=Other->m_EventMap.begin(); + i!=Other->m_EventMap.end(); i++) + { + Fl_SEvent *NewEvent; + + if (m_Type==PERCUSSION_MAP) + { + NewEvent = new Fl_CircEvent(*(Fl_CircEvent*)i->second); + } + else + { + NewEvent = new Fl_SEvent(*i->second); + } + + add(NewEvent); + m_EventMap[NewEvent->GetID()]=NewEvent; + } +} + +///////////////////////////////////////////////////// + +istream &operator>>(istream &s, Fl_EventMap &o) +{ + string dummy; + s>>dummy; + if (dummy!="EventMap") cerr<<"Error in stream before Fl_EventMap"<>(int&)o.m_Type; + s>>o.m_Zoom; + s>>o.m_GridSizeX; + s>>o.m_GridSizeY; + s>>o.m_PixelsPerSec; + s>>o.m_StartLoop; + s>>o.m_EndLoop; + s>>o.m_Pos; + s>>o.m_LastPos; + s>>o.m_BarLength; + s>>o.m_BeatsBar; + + int Num; + + s>>Num; + float st,lt; + int g,t; + + for (int n=0; n>st>>g>>lt>>t; + o.AddEventTime(st,g,lt,(Fl_SEvent::Type)(t), false); + } + + return s; +} + +ostream &operator<<(ostream &s, Fl_EventMap &o) +{ + s<<"EventMap "; + s<<(int)o.m_Type<<" "; + s<::iterator i=o.m_EventMap.begin(); + i!=o.m_EventMap.end(); i++) + { + s<second->GetStartTime()<<" "<second->GetGroup()<<" "<< + i->second->GetLengthTime()<<" "<<(int)(i->second->GetType())<<" "; + } + s< + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "Fl_SEvent.h" + + +#ifndef EVENTMAP +#define EVENTMAP + +using namespace std; + +///////////////////////////////////////////////////////// + +class EventInfo +{ +public: + enum Type{START,ON,END}; + + EventInfo(int ID, int Group, Type t, float s) + {m_ID=ID; m_Group=Group; m_Type=t; m_SectionStart=s;} + int m_ID; + int m_Group; + Type m_Type; + float m_SectionStart; +}; + +///////////////////////////////////////////////////////// + +class Fl_EventMap : public Fl_Group +{ +public: + + enum ModeType {ARRANGE_MAP,MELODY_MAP,PERCUSSION_MAP}; + + Fl_EventMap(int x, int y, int w, int h, const char* label=0); + + virtual void draw(); + virtual int handle(int event); + void CreateWindow(); + + vector GetEvents(float Time); + + void SetTime(float Time); + void SetUpdate(bool s) {m_Update=s;} + void SetZoomLevel(float s); + void SetGridSizeX(int s) { m_GridSizeX=s; } + void SetGridSizeY(int s) { m_GridSizeY=s; } + + void SetType(ModeType s) { m_Type=s; } + ModeType GetType() { return m_Type; } + + void SetID(int ID) { m_ID=ID; } + int GetID() { return m_ID; } + float GetStartTime() { return m_StartLoop;} + float GetEndTime() { return m_EndLoop;} + void SetEndTime(float s) { m_EndLoop=s;} + float GetTimeOffset() { return m_TimeOffset;} + void SetTimeOffset(float s) { m_TimeOffset=s;} + void SetBeatsBar(int s) { m_BeatsBar=s; redraw();} + void SetBarLength(float s) { m_BarLength=s; redraw(); } + void SetSnapGap(float s); + int *GetKeyColMap() { return m_KeyColMap; } + int GetX() { return x(); } + int GetY() { return y(); } + void DrawBeats(bool s) { m_DrawBeats=s; redraw(); } + int AddEventTime(float st, int g, float lt, Fl_SEvent::Type EType, bool CallBack=true); + void SetEventLength(int ID, float l); + int AddEvent(int x, int y, int w, Fl_SEvent::Type EType, bool CallBack=true); + int CopyEvent(int x, int y, int w, int ID, float LengthTime); + void RemoveAllEvents(); + void RemoveEvent(int ID); + Fl_SEvent *GetEvent(int ID); + void CopyFrom(Fl_EventMap *Other); + + // called by the event widgets on the owner of this object + // if you're going to hack callbacks - do it in style ;) + class EventCallbacks + { + public: + EventCallbacks() + { + cb_NewEvent=cb_EventDoubleClicked=cb_CopyEvent=cb_CloneEvent= + cb_InstanceEvent=cb_MoveEvent=cb_EditEvent=cb_DelEvent= + cb_RenameEvent=cb_Recolour=NULL; + } + + void (*cb_NewEvent)(Fl_Widget*, void*); + void (*cb_EventDoubleClicked)(Fl_Widget*, void*); + void (*cb_CopyEvent)(Fl_Widget*, void*); + void (*cb_CloneEvent)(Fl_Widget*, void*); + void (*cb_InstanceEvent)(Fl_Widget*, void*); + void (*cb_MoveEvent)(Fl_Widget*, void*); + void (*cb_EditEvent)(Fl_Widget*, void*); + void (*cb_DelEvent)(Fl_Widget*, void*); + void (*cb_RenameEvent)(Fl_Widget*, void*); + void (*cb_Recolour)(Fl_Widget*, void*); + }; + + EventCallbacks m_Callbacks; + void SetCallbacks(const EventCallbacks &s); + + void TriggerStart(); + void TriggerEnd(); + + void SetFirstUpdate() { m_FirstUpdate=true; } + +protected: + + int GetGroupFromY(int y); + +private: + ModeType m_Type; + bool m_Update; + float m_Zoom; + int m_ID; + int m_GridSizeX; + int m_GridSizeY; + int m_PixelsPerSec; + int m_NextID; + float m_StartLoop; + float m_EndLoop; + int m_Pos; + int m_LastPos; + bool m_DrawBeats; + float m_BarLength; + float m_TimeOffset; + int m_BeatsBar; + + int m_KeyColMap[12]; + + map m_EventMap; + + bool m_FirstUpdate; + + friend istream &operator>>(istream &s, Fl_EventMap &o); + friend ostream &operator<<(ostream &s, Fl_EventMap &o); +}; + +istream &operator>>(istream &s, Fl_EventMap &o); +ostream &operator<<(ostream &s, Fl_EventMap &o); + +#endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/Widgets/Fl_Knob.fld spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/Widgets/Fl_Knob.fld --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/Widgets/Fl_Knob.fld 2002-09-18 20:04:55.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/Widgets/Fl_Knob.fld 2012-05-31 04:13:57.000000000 +0000 @@ -2,10 +2,10 @@ version 1.0100 header_name {.H} code_name {.cxx} -decl {\#include } {public +decl {\#include } {public } -decl {\#include } {} +decl {\#include } {} decl {\#include } {} diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/Widgets/Fl_SEvent.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/Widgets/Fl_SEvent.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/Widgets/Fl_SEvent.C 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/Widgets/Fl_SEvent.C 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,331 @@ +/* Event Widget + * Copyleft (C) 2001 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "Fl_SEvent.h" +#include "Fl_EventMap.h" +#include +#include +#include +#include + +static const int MELODY_WIDGET_COL = 142; +static const int PERCUSSION_WIDGET_COL = 140; +static const int EVENT_RESIZE_GRAB = 10; + +Fl_SEvent::Fl_SEvent(int x, int y, int w, int h, const char* label) : +Fl_Group(x,y,w,h,""), +m_Type(NO_TYPE), +m_LastState(false), +m_FirstUpdate(false), +m_LastUpdate(false), +m_Name(""), +m_ID(-1), +m_Colour(PERCUSSION_WIDGET_COL), +m_GridX(0), +m_GridY(0), +m_LockX(false), +m_LockY(false), +m_LockResize(true), +m_ResizeGrab(8), +m_PixelsPerSec(100), +m_Channel(0), +m_StartTime(0.0f), +m_LengthTime(0.0f), +m_SnapGap(0.0f), +m_CurrentDragMode(NONE), +m_DelMe(false) +{ + Fl_Group::label(m_Name.c_str()); + labelsize(8); +} + +void Fl_SEvent::BuildMenu() +{ + Fl_EventMap::EventCallbacks *cb =&((Fl_EventMap*)parent())->m_Callbacks; + + m_Menu = new Fl_Menu_Button(x(),y(),w(),h(),""); + m_Menu->type(Fl_Menu_Button::POPUP3); + m_Menu->textsize(8); + + if (cb->cb_CopyEvent) m_Menu->add("copy", 0, cb->cb_CopyEvent,this); + if (cb->cb_CloneEvent) m_Menu->add("clone", 0, cb->cb_CloneEvent,this); + if (cb->cb_InstanceEvent) m_Menu->add("instance", 0, cb->cb_InstanceEvent,this); + if (cb->cb_DelEvent) m_Menu->add("delete", 0, cb->cb_DelEvent,this); + if (cb->cb_RenameEvent) m_Menu->add("rename", 0, cb->cb_RenameEvent,this); + if (cb->cb_Recolour) m_Menu->add("colour", 0, cb->cb_Recolour,this); + if (cb->cb_EditEvent) m_Menu->add("edit", 0, cb->cb_EditEvent,this); + add(m_Menu); +} + + +Fl_SEvent::Fl_SEvent(const Fl_SEvent &Other) : +Fl_Group(Other.x(),Other.y(),Other.w(),Other.h(),Other.label()), +m_Type(Other.m_Type), +m_LastState(Other.m_LastState), +m_FirstUpdate(Other.m_FirstUpdate), +m_LastUpdate(Other.m_LastUpdate), +m_Name(Other.m_Name), +m_ID(Other.m_ID), +m_Colour(Other.m_Colour), +m_GridX(Other.m_GridX), +m_GridY(Other.m_GridY), +m_LockX(Other.m_LockX), +m_LockY(Other.m_LockY), +m_LockResize(Other.m_LockResize), +m_ResizeGrab(Other.m_ResizeGrab), +m_PixelsPerSec(Other.m_PixelsPerSec), +m_Channel(Other.m_Channel), +m_StartTime(Other.m_StartTime), +m_LengthTime(Other.m_LengthTime), +m_SnapGap(Other.m_SnapGap), +m_CurrentDragMode(Other.m_CurrentDragMode), +m_DelMe(false), +LastButtonPushed(0) +{ +} + +Fl_SEvent::~Fl_SEvent() +{ +} + +bool Fl_SEvent::UpdateState(float Time) +{ + m_FirstUpdate=false; + m_LastUpdate=false; + + bool State=(Time>m_StartTime && TimeGetType()==Fl_EventMap::MELODY_MAP) + { + int Col=FL_BLACK; + if (parent()) Col=((Fl_EventMap*)(parent()))->GetKeyColMap()[GetGroup()%12]; + fl_color(Col); + fl_rectf(x()+1,y()+1,w()-1,h()-1); + + // draw shadow + fl_color(FL_BLACK); + fl_line(x()+w(),y()+1,x()+w(),y()+h()); + fl_line(x()+w(),y()+h(),x()+1,y()+h()); + } + else + { + fl_color(m_Colour); + + fl_rectf(x()+1,y()+1,w()-1,h()-1); + + // draw shadow + fl_color(FL_BLACK); + fl_line(x()+w(),y()+1,x()+w(),y()+h()); + fl_line(x()+w(),y()+h(),x()+1,y()+h()); + + fl_push_clip(x()+1,y()+1,w()-1,h()-1); + fl_font(fl_font(), 8); + fl_draw(m_Name.c_str(),x()+2,y()+h()-2); + fl_pop_clip(); + } + + + // todo: sample rendering +} + +int Fl_SEvent::handle(int event) +{ + int mx=Fl::event_x(); + int my=Fl::event_y(); + + m_Menu->resize(x(),y(),w(),h()); + + Fl_EventMap::EventCallbacks *cb =&((Fl_EventMap*)parent())->m_Callbacks; + + static int offsx,offsy; + + if (Fl::event_button()==1 && event==FL_PUSH && Fl::event_clicks()==1) + { + if (cb->cb_EventDoubleClicked!=NULL) + { + cb->cb_EventDoubleClicked(this,NULL); + } + } + + switch (event) + { + case FL_PUSH: + LastButtonPushed=Fl::event_button(); + + offsx=mx-x(); + offsy=my-y(); + + /*if (Fl::event_key(FL_BackSpace)) + { + Fl_EventMap *p = (Fl_EventMap*)parent(); + if (p && p->GetType()!=Fl_EventMap::ARRANGE_MAP) + { + if (cb->cb_DelEvent!=NULL) cb->cb_DelEvent(this,NULL); + m_DelMe=true; + } + }*/ + + if (LastButtonPushed==1) + { + // if the last EVENT_RESIZE_GRAB pixels + // have been grabbed, resize. + if (offsx>w()-EVENT_RESIZE_GRAB) m_CurrentDragMode=RESIZING; + else m_CurrentDragMode=MOVING; + } + + // fall through + case FL_DRAG: + { + if (LastButtonPushed==1 || LastButtonPushed==3) + { + if(m_CurrentDragMode==RESIZING) + { + w(mx-x()+(m_ResizeGrab/2)); + //m_Menu->size(w(),h()); + + m_LengthTime=w()/(float)m_PixelsPerSec; + } + + if(m_CurrentDragMode==MOVING) + { + x(mx-offsx); + y(my-offsy); + m_Menu->position(x(),y()); + + m_StartTime=(x()-GetParentX())/(float)m_PixelsPerSec; + } + + my=y(); + SnapY(); + + if (cb->cb_MoveEvent!=NULL) cb->cb_MoveEvent(this,NULL); + parent()->redraw(); + } + } + break; + + case FL_RELEASE: + { + m_CurrentDragMode=NONE; + } + break; + } + + Fl_Group::handle(event); + + return 1; +} + +void Fl_SEvent::SetPixelsPerSec(int s, bool FirstTime) +{ + m_PixelsPerSec=s; + + if (FirstTime) + { + m_StartTime=(x()-GetParentX())/(float)m_PixelsPerSec; + m_LengthTime=w()/(float)m_PixelsPerSec; + } + else + { + // convert back to new value + + //get relative x + int rel_x=x()-GetParentX(); + + rel_x=(int)(m_StartTime*m_PixelsPerSec); + x(rel_x+GetParentX()); + + w((int)(m_LengthTime*m_PixelsPerSec)); + m_GridX=(int)(m_SnapGap*(float)m_PixelsPerSec); + } +} + +int Fl_SEvent::GetParentX() +{ + Fl_EventMap* P=(Fl_EventMap*)(parent()); + if (P) + { + return P->GetX(); + } + else + { + return 0; + } +} + +int Fl_SEvent::GetParentY() +{ + Fl_EventMap* P=(Fl_EventMap*)(parent()); + if (P) + { + return P->GetY(); + } + else + { + return 0; + } +} + +//////////////////////////////////////////////////////////////////// + +Fl_CircEvent::Fl_CircEvent(int x, int y, int w, int h, const char* label) : +Fl_SEvent(x,y,12,h,label) +{ +} + +Fl_CircEvent::Fl_CircEvent(const Fl_CircEvent &Other) : +Fl_SEvent(Other) +{ +} + +void Fl_CircEvent::draw() +{ + // hackish way to override the zoom scale of the width + w(12); + + int Col=0; + if (parent()) Col=((Fl_EventMap*)(parent()))->GetKeyColMap()[GetGroup()%12]; + fl_color(Col); + + fl_rectf(x(),y()+1,12,12); + + fl_color(FL_BLACK); + fl_line(x()+1,y()+13, x()+13,y()+13); + fl_line(x()+12,y()+13, x()+12,y()+1); + +// fl_pie(x(),y(),12,12,0,360); +} diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/Widgets/Fl_SEvent.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/Widgets/Fl_SEvent.h --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/Widgets/Fl_SEvent.h 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/Widgets/Fl_SEvent.h 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,138 @@ +/* Event Widget + * Copyleft (C) 2001 David Griffiths + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#ifndef SEVENT +#define SEVENT + +using namespace std; + +class Fl_EventMap; + +class Fl_SEvent : public Fl_Group +{ +public: + enum Type{NO_TYPE,MELODY,PERCUSSION}; + enum DragMode{NONE,MOVING,RESIZING}; + + Fl_SEvent(int x, int y, int w, int h, const char* label=0); + Fl_SEvent(const Fl_SEvent &Other); + virtual ~Fl_SEvent(); + + virtual void draw(); + virtual int handle(int event); + + void BuildMenu(); + + int GetID() { return m_ID; } + void SetID(int s) { m_ID=s; } + void SetChannel(int s) { m_Channel=s; } + int GetChannel() { return m_Channel; } + int GetColour() { return m_Colour; } + void SetColour(int s) { m_Colour=s; } + void SnapX() { if (m_GridX) x(x()-((x()-GetParentX())%m_GridX)); redraw(); } + void SnapY() { if (m_GridY) y(y()-((y()-GetParentY())%m_GridY)); redraw(); } + void SetName(string s) { m_Name=s; } + string GetName() { return m_Name; } + void SetGridX(int s) { m_GridX=s; } + void SetGridY(int s) { m_GridY=s; } + void LockX() { m_LockX=true; } + void LockY() { m_LockY=true; } + void LockResize(bool s){ m_LockResize=s; } + void SetResizeGrab(int s) { m_ResizeGrab=s; } + void SetSnapGap(float s) + { m_SnapGap=s; if(s) m_GridX=(int)(s*(float)m_PixelsPerSec); } + float GetStartTime() { return m_StartTime; } + float GetLengthTime() { return m_LengthTime; } + void SetLengthTime(float s) { m_LengthTime=s; w((int)(m_LengthTime*m_PixelsPerSec)); redraw(); } + int GetGroup() { return (y()-GetParentY())/m_GridY; } + Type GetType() { return m_Type; } + void SetType(Type s) { m_Type=s; } + void SetPixelsPerSec(int s, bool FirstTime=false); + int GetParentX(); + int GetParentY(); + void Place(int sx, int sy) { x(sx); y(sy); } + + bool UpdateState(float Time); + bool AtStart() { return m_FirstUpdate; } + bool AtEnd() { return m_LastUpdate; } + bool Killed() { return m_DelMe; } + void KillMe() { m_DelMe=true; } + + int GetX() { return x(); } + int GetY() { return y(); } + int GetW() { return w(); } + +private: + + Fl_Menu_Button *m_Menu; + + Type m_Type; + // whether we were active or not last tick + bool m_LastState; + + // if this is the first or last update + bool m_FirstUpdate; + bool m_LastUpdate; + + string m_Name; + int m_ID; + int m_Colour; + int m_GridX; + int m_GridY; + bool m_LockX; + bool m_LockY; + bool m_LockResize; + int m_ResizeGrab; + int m_PixelsPerSec; + int m_Channel; + + float m_StartTime; + float m_LengthTime; + float m_SnapGap; + + DragMode m_CurrentDragMode; + + bool m_DelMe; + + int LastButtonPushed; +}; + +///////////////////////////////////////////////////////// + +class Fl_CircEvent : public Fl_SEvent +{ +public: + Fl_CircEvent(int x, int y, int w, int h, const char* label=0); + Fl_CircEvent(const Fl_CircEvent &Other); + virtual void draw(); +private: +}; + +#endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/XFadePlugin/Makefile.in spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/XFadePlugin/Makefile.in --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/XFadePlugin/Makefile.in 2004-01-17 10:32:43.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/XFadePlugin/Makefile.in 2012-05-31 04:13:57.000000000 +0000 @@ -15,9 +15,6 @@ MOC = moc UIC = -TAR = tar -cf -GZIP = gzip -9f - INSTALL = @INSTALL@ ###### Autoconf variables @@ -95,13 +92,6 @@ moc: $(SRCMOC) -tmake: - tmake XFadePlugin.pro - -dist: - $(TAR) XFadePlugin.tar XFadePlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) XFadePlugin.tar - clean: -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) -rm -f *~ core diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/XFadePlugin/XFadePluginGUI.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/XFadePlugin/XFadePluginGUI.C --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/XFadePlugin/XFadePluginGUI.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/XFadePlugin/XFadePluginGUI.C 2012-05-31 04:13:57.000000000 +0000 @@ -18,6 +18,7 @@ #include "XFadePluginGUI.h" #include +#include using namespace std; diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/Plugins/XFadePlugin/XFadePlugin.pro spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/XFadePlugin/XFadePlugin.pro --- spiralsynthmodular-0.2.2a/SpiralSound/Plugins/XFadePlugin/XFadePlugin.pro 2002-07-28 23:18:17.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/Plugins/XFadePlugin/XFadePlugin.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -HEADERS = ../SpiralPlugin.h \ - ../SpiralPluginGUI.h \ - ../Widgets/Fl_Knob.H \ - ../Widgets/Fl_DragBar.H \ - ../../Sample.h \ - XFadePlugin.h \ - XFadePluginGUI.h - -SOURCES = ../SpiralPlugin.C \ - ../SpiralPluginGUI.C \ - ../Widgets/Fl_Knob.cxx \ - ../Widgets/Fl_DragBar.cxx \ - ../../Sample.C \ - XFadePlugin.C \ - XFadePluginGUI.C - -TARGET = XFadePlugin.so diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/SpiralInfo.C spiralsynthmodular-0.2.3+git20140329/SpiralSound/SpiralInfo.C --- spiralsynthmodular-0.2.2a/SpiralSound/SpiralInfo.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/SpiralInfo.C 2012-05-31 04:13:57.000000000 +0000 @@ -24,6 +24,9 @@ #include "SpiralInfo.h" #include "../SpiralSynthPluginLocation.h" + +//#define DEBUG_CONFIG + float RandFloat (float s, float e) { return s+((rand()%10000/10000.0)*(e-s)); } @@ -77,7 +80,7 @@ } SpiralInfo::SpiralInfo(): -m_Version(1) +m_Version(2) { m_ResFileName = getenv("HOME"); m_ResFileName += "/.spiralmodular"; @@ -99,47 +102,324 @@ StreamOutPrefs (o); } -void SpiralInfo::StreamInPrefs (istream &s) { +void SpiralInfo::StreamOutMainColourPrefs (ostream &s) +{ + s << "[MAIN COLOURS]" << endl; + s << "ToolBoxColour = " << GUICOL_Tool << endl; + s << "ButtonColour = " << GUICOL_Button << endl; + s << "CanvasColour = " << GUICOL_Canvas << endl; + s << "DeviceColour = " << GUICOL_Device << endl; + s << "DeviceBoxType = " << GUIDEVICE_Box << endl; + + s << endl; //section spacer +} + +bool SpiralInfo::StreamInMainColourPrefs (istream &s, string §ion, string &ident) +{ + char temp[256]; + bool result = false; + + /* just ignore if this isn't calling us */ + if (section == "MAIN COLOURS") + { + if (ident == "ToolBoxColour") + s >> GUICOL_Tool; + + else if (ident == "ButtonColour") + s >> GUICOL_Button; + + else if (ident == "CanvasColour") + s >> GUICOL_Canvas; + + else if (ident == "DeviceColour") + s >> GUICOL_Device; + + else if (ident == "DeviceBoxType") + s >> GUIDEVICE_Box; + + else + /* ignore idents that don't belong here/we don't know about */ + s >> temp; + + result = true; + } + + return result; +} + +void SpiralInfo::StreamOutDeviceColourPrefs (ostream &s) +{ + s << "[DEVICE COLOURS]" << endl; + s << "GUIColour = " << GUI_COLOUR << endl; + s << "ScopeBGColour = " << SCOPE_BG_COLOUR << endl; + s << "ScopeFGColour = " << SCOPE_FG_COLOUR << endl; + s << "ScopeSelColour = " << SCOPE_SEL_COLOUR << endl; + s << "ScopeIndColour = " << SCOPE_IND_COLOUR << endl; + s << "ScopeMrkColour = " << SCOPE_MRK_COLOUR << endl; + + s << endl; //section spacer +} + +bool SpiralInfo::StreamInDeviceColourPrefs (istream &s, string §ion, string &ident) +{ + char temp[256]; + bool result = false; + + /* just ignore if this isn't calling us */ + if (section == "DEVICE COLOURS") + { + if (ident == "GUIColour") + s >> GUI_COLOUR; + + else if (ident == "ScopeBGColour") + s >> SCOPE_BG_COLOUR; + + else if (ident == "ScopeFGColour") + s >> SCOPE_FG_COLOUR; + + else if (ident == "ScopeSelColour") + s >> SCOPE_SEL_COLOUR; + + else if (ident == "ScopeIndColour") + s >> SCOPE_IND_COLOUR; + + else if (ident == "ScopeMrkColour") + s >> SCOPE_MRK_COLOUR; + + else + /* ignore idents that don't belong here/we don't know about */ + s >> temp; + + result = true; + } + + return result; +} + +void SpiralInfo::StreamOutAudioSettingsPrefs (ostream &s) +{ + s << "[AUDIO SETTINGS]" << endl; + + s << "BufferSize = " << BUFSIZE << endl; + s << "FragmentSize = " << FRAGSIZE << endl; + s << "FragmentCount = " << FRAGCOUNT << endl; + s << "Samplerate = " << SAMPLERATE << endl; + s << "WantMidi = " << WANTMIDI << endl; + s << "FilterGranularity = " << FILTERGRAN << endl; + s << "Output = " << OUTPUTFILE << endl; + s << "Midi = " << MIDIFILE << endl; + s << "UsePluginList = " << USEPLUGINLIST << endl; + s << "Polyphony = " << POLY << endl; + + s << endl; //section spacer +} + +bool SpiralInfo::StreamInAudioSettingsPrefs (istream &s, string §ion, string &ident) +{ + char temp[256]; + bool result = false; + + /* just ignore if this isn't calling us */ + if (section == "AUDIO SETTINGS") + { + if (ident == "BufferSize") + s >> BUFSIZE; + + else if (ident == "FragmentSize") + s >> FRAGSIZE; + + else if (ident == "FragmentCount") + s >> FRAGCOUNT; + + else if (ident == "Samplerate") + s >> SAMPLERATE; + + else if (ident == "WantMidi") + s >> WANTMIDI; + + else if (ident == "FilterGranularity") + s >> FILTERGRAN; + + else if (ident == "Output") + s >> OUTPUTFILE; + + else if (ident == "Midi") + s >> MIDIFILE; + + else if (ident == "UsePluginList") + s >> USEPLUGINLIST; + + else if (ident == "Polyphony") + s >> POLY; + + else + /* ignore idents that don't belong here/we don't know about */ + s >> temp; + + result = true; + } + + return result; +} + +void SpiralInfo::StreamInPrefs (istream &s) +{ // These lines are from SpiralInfo char temp[256]; + s >> temp >> temp >> temp; s >> temp >> temp >> m_Version; s >> temp >> temp >> LOCALE; - s >> temp >> temp >> BUFSIZE; - s >> temp >> temp >> FRAGSIZE; - s >> temp >> temp >> FRAGCOUNT; - s >> temp >> temp >> SAMPLERATE; - s >> temp >> temp >> WANTMIDI; - s >> temp >> temp >> FILTERGRAN; - s >> temp >> temp >> OUTPUTFILE; - s >> temp >> temp >> MIDIFILE; - s >> temp >> temp >> USEPLUGINLIST; - s >> temp >> temp >> POLY; - if (m_Version>0) { - s >> temp >> temp >> GUI_COLOUR; - s >> temp >> temp >> SCOPE_BG_COLOUR; - s >> temp >> temp >> SCOPE_FG_COLOUR; - s >> temp >> temp >> SCOPE_SEL_COLOUR; - s >> temp >> temp >> SCOPE_IND_COLOUR; - s >> temp >> temp >> SCOPE_MRK_COLOUR; - } - s >> temp >> temp; - s >> temp >> temp >> GUICOL_Tool; - s >> temp >> temp >> GUICOL_Button; - s >> temp >> temp >> GUICOL_Canvas; - s >> temp >> temp >> GUICOL_Device; - s >> temp >> temp >> GUIDEVICE_Box; - s >> temp >> temp >> PLUGIN_PATH; - s >> temp >> temp; - string st; - PLUGINVEC.clear(); - if (USEPLUGINLIST) { - while (st!="end" && !s.eof()) { - s >> st; - if (st!="end") PLUGINVEC.push_back (st); - } - } + switch (m_Version) + { + case 2: + { + char test; + string section; + + /* skip next line, since this is just a spacer between file header + and the rest of the file config + */ + s.seekg (2, ios::cur ); + + while (! s.eof () && ! s.fail() ) + { + /* peek first char to find out if this is a delimiter line + a header line, or a regular section + */ + test = s.peek(); + + switch (test) + { + /* if the line starts with an open bracket just presume its a header */ + case '[': + { + /* skip open bracket */ + s.ignore(1); + + /* read header line up to close bracket or end of line */ + s.getline (temp, 256, ']'); + + /* move to next line */ + s.seekg (1, ios::cur ); + + /* assign current section string for easy testing */ + section = temp; + cout << "at section " + section << endl; + + /* the plugins format is a bit odd so we + do it all here at once mostly the same + as the old way + */ + if (section == "PLUGINS") + { + s >> temp >> temp >> PLUGIN_PATH; + s >> temp >> temp; + + string st; + PLUGINVEC.clear(); + while (st!="end" && !s.eof()) + { + s >> st; + if (st!="end" && USEPLUGINLIST) PLUGINVEC.push_back (st); + printf ( "loop\n" ); + } + + /* move to next line */ + s.seekg (1, ios::cur ); + } + } + break; + + case '\n': + { + /* skip this line, its just a spacer between section */ + s.seekg (1, ios::cur ); + } + break; + + default: + { + string ident; + s >> ident;//read in identifier name + s >> temp;//skip "=" + + /* Check to see if this a Audio Settings section */ + if (StreamInAudioSettingsPrefs(s, section, ident)) { +#ifdef DEBUG_CONFIG + cout << "successfully read " + section + ", " + ident << endl; +#endif + /* Check next to see if this a Main Colour section */ + } else if (StreamInMainColourPrefs(s, section, ident)) { +#ifdef DEBUG_CONFIG + cout << "successfully read " + section + ", " + ident << endl; +#endif + /* Check next to see if this a Device Colour section */ + } else if (StreamInDeviceColourPrefs(s, section, ident)) { +#ifdef DEBUG_CONFIG + cout << "successfully read " + section + ", " + ident << endl; +#endif + /* Ignore idents for sections that are invalid or we don't know about */ + } else { + s >> temp; +#ifdef DEBUG_CONFIG + cout << "ignoring. don't know how to handle, " + section + ", " + ident << endl; +#endif + } + + s.seekg (1, ios::cur ); //move to next line + } + } + } + } + break; + + default: //old file fallback + { + s >> temp >> temp >> BUFSIZE; + s >> temp >> temp >> FRAGSIZE; + s >> temp >> temp >> FRAGCOUNT; + s >> temp >> temp >> SAMPLERATE; + + s >> temp >> temp >> WANTMIDI; + s >> temp >> temp >> FILTERGRAN; + + s >> temp >> temp >> OUTPUTFILE; + s >> temp >> temp >> MIDIFILE; + + s >> temp >> temp >> USEPLUGINLIST; + + s >> temp >> temp >> POLY; + if (m_Version>0) { + s >> temp >> temp >> GUI_COLOUR; + s >> temp >> temp >> SCOPE_BG_COLOUR; + s >> temp >> temp >> SCOPE_FG_COLOUR; + s >> temp >> temp >> SCOPE_SEL_COLOUR; + s >> temp >> temp >> SCOPE_IND_COLOUR; + s >> temp >> temp >> SCOPE_MRK_COLOUR; + } + s >> temp >> temp; + s >> temp >> temp >> GUICOL_Tool; + s >> temp >> temp >> GUICOL_Button; + s >> temp >> temp >> GUICOL_Canvas; + s >> temp >> temp >> GUICOL_Device; + s >> temp >> temp >> GUIDEVICE_Box; + s >> temp >> temp >> PLUGIN_PATH; + s >> temp >> temp; + + string st; + PLUGINVEC.clear(); + if (USEPLUGINLIST) + { + while (st!="end" && !s.eof()) + { + s >> st; + if (st!="end") PLUGINVEC.push_back (st); + } + } + } + } #if __APPLE__ // ignore custom paths, plugins are encapsulated in the app anyway // this prevents the program to fail if the user move the application icon @@ -147,39 +427,36 @@ #endif } -void SpiralInfo::StreamOutPrefs (ostream &s) { - // These lines are from SpiralInfo - s << "SpiralSound resource file" << endl << endl; - s << "Version = " << m_Version << endl; - s << "Locale = " << LOCALE << endl; - s << "BufferSize = " << BUFSIZE << endl; - s << "FragmentSize = " << FRAGSIZE << endl; - s << "FragmentCount = " << FRAGCOUNT << endl; - s << "Samplerate = " << SAMPLERATE << endl; - s << "WantMidi = " << WANTMIDI << endl; - s << "FilterGranularity = " << FILTERGRAN << endl; - s << "Output = " << OUTPUTFILE << endl; - s << "Midi = " << MIDIFILE << endl; - s << "UsePluginList = " << USEPLUGINLIST << endl; - s << "Polyphony = " << POLY << endl; - s << "GUIColour = " << GUI_COLOUR << endl; - s << "ScopeBGColour = " << SCOPE_BG_COLOUR << endl; - s << "ScopeFGColour = " << SCOPE_FG_COLOUR << endl; - s << "ScopeSelColour = " << SCOPE_SEL_COLOUR << endl; - s << "ScopeIndColour = " << SCOPE_IND_COLOUR << endl; - s << "ScopeMrkColour = " << SCOPE_MRK_COLOUR << endl; - s << endl << "SpiralSynthModular Info:" << endl << endl; - s << "ToolBoxColour = " << GUICOL_Tool << endl; - s << "ButtonColour = " << GUICOL_Button << endl; - s << "CanvasColour = " << GUICOL_Canvas << endl; - s << "DeviceColour = " << GUICOL_Device << endl; - s << "DeviceBoxType = " << GUIDEVICE_Box << endl << endl; - s << "PluginPath = " << PLUGIN_PATH << endl << endl; - s << "PluginList = " << endl; - for (vector::iterator i=PLUGINVEC.begin(); i!=PLUGINVEC.end(); i++) { - s << *i << endl; - } - s << "end" << endl; +void SpiralInfo::StreamOutPrefs (ostream &s) +{ + s << "SpiralSound resource file" << endl << endl; + s << "Version = " << m_Version << endl; + s << "Locale = " << LOCALE << endl; + + s << endl; //section spacer + + /* Write Audio Settings section */ + StreamOutAudioSettingsPrefs(s); + + /* Write Main Colour section */ + StreamOutMainColourPrefs(s); + + /* Write Device Colour section */ + StreamOutDeviceColourPrefs(s); + + /* Write PLUGINS section + + because of the plugin path output format it must always be appended with an "end" line, + and currently this MUST be the last thing in the file + */ + s << "[PLUGINS]" << endl; + s << "PluginPath = " << PLUGIN_PATH << endl; + s << "PluginList = " << endl; + for (vector::iterator i=PLUGINVEC.begin(); i!=PLUGINVEC.end(); i++) + { + s << *i << endl; + } + s << "end" << endl; } void SpiralInfo::Alert (string Text) { diff -Nru spiralsynthmodular-0.2.2a/SpiralSound/SpiralInfo.h spiralsynthmodular-0.2.3+git20140329/SpiralSound/SpiralInfo.h --- spiralsynthmodular-0.2.2a/SpiralSound/SpiralInfo.h 2003-07-22 22:08:41.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSound/SpiralInfo.h 2012-05-31 04:13:57.000000000 +0000 @@ -72,6 +72,16 @@ string m_ResFileName; int m_Version; static SpiralInfo *m_SpiralInfo; + + void StreamOutMainColourPrefs (ostream &s); + bool StreamInMainColourPrefs (istream &s, string §ion, string &ident); + + void StreamOutDeviceColourPrefs (ostream &s); + bool StreamInDeviceColourPrefs (istream &s, string §ion, string &ident); + + void StreamOutAudioSettingsPrefs (ostream &s); + bool StreamInAudioSettingsPrefs (istream &s, string §ion, string &ident); + void StreamInPrefs (istream &s); void StreamOutPrefs (ostream &s); }; diff -Nru spiralsynthmodular-0.2.2a/SpiralSynthModular.C spiralsynthmodular-0.2.3+git20140329/SpiralSynthModular.C --- spiralsynthmodular-0.2.2a/SpiralSynthModular.C 2014-03-29 16:58:13.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSynthModular.C 2012-05-31 04:13:57.000000000 +0000 @@ -24,18 +24,15 @@ #include #include #include - #include #include -#include +#include #include #include - #include "SpiralSynthModular.h" #include "SpiralSound/PluginManager.h" #include "SpiralSound/SpiralInfo.h" #include "SpiralSound/Plugins/SpiralPluginGUI.h" - #include "GUI/SSM.xpm" #include "GUI/load.xpm" #include "GUI/save.xpm" @@ -74,16 +71,22 @@ ////////////////////////////////////////////////////////// SynthModular::SynthModular(): -m_NextID(0), -m_PauseAudio(false) +m_Frozen(false), +m_NextID(0) { + /* Shared Audio State Information */ m_Info.BUFSIZE = SpiralInfo::BUFSIZE; + m_Info.SAMPLERATE = SpiralInfo::SAMPLERATE; + m_Info.PAUSED = false; + + /* obsolete - REMOVE SOON */ m_Info.FRAGSIZE = SpiralInfo::FRAGSIZE; m_Info.FRAGCOUNT = SpiralInfo::FRAGCOUNT; - m_Info.SAMPLERATE = SpiralInfo::SAMPLERATE; m_Info.OUTPUTFILE = SpiralInfo::OUTPUTFILE; m_Info.MIDIFILE = SpiralInfo::MIDIFILE; m_Info.POLY = SpiralInfo::POLY; + + /* Shared GUI Preferences Information */ m_Info.GUI_COLOUR = SpiralInfo::GUI_COLOUR; m_Info.SCOPE_BG_COLOUR = SpiralInfo::SCOPE_BG_COLOUR; m_Info.SCOPE_FG_COLOUR = SpiralInfo::SCOPE_FG_COLOUR; @@ -95,7 +98,7 @@ for (int n=0; n<512; n++) Numbers[n]=n; - m_CH.Register("PauseAudio",&m_PauseAudio); + m_CH.Register("Frozen",&m_Frozen); } ////////////////////////////////////////////////////////// @@ -104,13 +107,14 @@ { ClearUp(); PluginManager::Get()->PackUpAndGoHome(); + system("rm -f ___temp.ssmcopytmp"); } ////////////////////////////////////////////////////////// void SynthModular::ClearUp() { - PauseAudio(); + FreezeAll(); for(map::iterator i=m_DeviceWinMap.begin(); i!=m_DeviceWinMap.end(); i++) @@ -119,7 +123,7 @@ if (i->second->m_Device) { if (i->second->m_Device->Kill()); - } + } i->second->m_DeviceGUI->Clear(); if (i->second->m_DeviceGUI->GetPluginWindow()) @@ -136,7 +140,7 @@ m_DeviceWinMap.clear(); m_NextID=0; - ResumeAudio(); + ThawAll(); } ////////////////////////////////////////////////////////// @@ -144,13 +148,13 @@ { m_CH.UpdateDataNow(); - if (m_PauseAudio) return; + if (m_Frozen) return; // for all the plugins for(map::iterator i=m_DeviceWinMap.begin(); i!=m_DeviceWinMap.end(); i++) { - if (i->second->m_Device && i->second->m_Device->IsDead()) + if (i->second->m_Device && i->second->m_Device->IsDead()) { //Delete Device delete i->second->m_Device; @@ -172,8 +176,22 @@ cerr<<"Finished updating"<second->m_Device->ExecuteCommands(); + // If this is an audio device see if we always need to ProcessAudio here + if ((!m_ResetingAudioThread)) + { + if (i->second->m_Device->IsAudioDriver()) + { + AudioDriver *driver = ((AudioDriver *)i->second->m_Device); + + if (driver->ProcessType() == AudioDriver::ALWAYS) + { + driver->ProcessAudio(); + } + } + + // run any commands we've received from the GUI's + i->second->m_Device->ExecuteCommands(); + } } } @@ -184,19 +202,40 @@ { // use the graphsort order to remove internal latency map::iterator di=m_DeviceWinMap.find(*i); - if (di!=m_DeviceWinMap.end() && di->second->m_Device && (! di->second->m_Device->IsDead())) + if (di!=m_DeviceWinMap.end() && di->second->m_Device && (! di->second->m_Device->IsDead()) && (!m_Info.PAUSED || m_ResetingAudioThread)) { #ifdef DEBUG_PLUGINS cerr<<"Executing plugin "<second->m_PluginID<second->m_Device->Execute(); + if (m_ResetingAudioThread) + { + di->second->m_Device->Reset(); + } + else + { + di->second->m_Device->Execute(); + + // If this is an audio device see if we need to ProcessAudio here + if (di->second->m_Device->IsAudioDriver()) + { + AudioDriver *driver = ((AudioDriver *)di->second->m_Device); + + if (driver->ProcessType() == AudioDriver::MANUAL) + { + driver->ProcessAudio(); + } + } + } #ifdef DEBUG_PLUGINS cerr<<"Finished executing"<second->m_DeviceGUI && i->second->m_DeviceGUI->Killed()) { bool erase = true; - + //Stop processing of audio if any if (i->second->m_Device) { if (i->second->m_Device->Kill()); erase = false; - } - + } + //Clear GUI Device i->second->m_DeviceGUI->Clear(); @@ -247,6 +286,13 @@ } m_Canvas->Poll(); + + if (m_HostNeedsUpdate) + { + cout << "Updating SampleRate to: " << SpiralInfo::SAMPLERATE << " and Buffer Size to: " << SpiralInfo::BUFSIZE << " to match current Audio Driver." << endl; + UpdateHostInfo(); + m_HostNeedsUpdate = false; + } } ////////////////////////////////////////////////////////// @@ -254,30 +300,53 @@ SpiralWindowType *SynthModular::CreateWindow() { m_TopWindow = new SpiralWindowType(MAIN_WIDTH, MAIN_HEIGHT, LABEL.c_str()); + m_TopWindow->user_data((void*)(this)); //m_TopWindow->resizable(m_TopWindow); - - int but=50; - int ToolbarHeight=but+0; - - m_Topbar = new Fl_Pack (0, 0, MAIN_WIDTH, ToolbarHeight, ""); + m_MainMenu = new Fl_Menu_Bar (0, 0, MAIN_WIDTH, 20, ""); + m_MainMenu->user_data((void*)(this)); + m_MainMenu->box(FL_PLASTIC_UP_BOX); + m_MainMenu->textsize (10); + m_MainMenu->add ("File/New", 0, cb_New, (void*)(this), FL_MENU_DIVIDER); + m_MainMenu->add ("File/Load", 0, cb_Load, (void*)(this), 0); + m_MainMenu->add ("File/Save As", 0, cb_Save, (void*)(this), 0); + m_MainMenu->add ("File/Merge", 0, cb_Merge, (void*)(this), FL_MENU_DIVIDER); + m_MainMenu->add ("File/Exit", 0, cb_Close, (void*)(this), 0); + m_MainMenu->add ("Edit/Cut", 0, cb_Cut, (void*)(this), 0); + m_MainMenu->add ("Edit/Copy", 0, cb_Copy, (void*)(this), 0); + m_MainMenu->add ("Edit/Paste", 0, cb_Paste, (void*)(this), 0); + m_MainMenu->add ("Edit/Delete", 0, cb_Delete, (void*)(this), FL_MENU_DIVIDER); + //m_MainMenu->add ("Edit/Toolbars/Plugins", 0, cb_Undefined, (void*)(this), 0); + //m_MainMenu->add ("Edit/Toolbars/Function", 0, cb_Undefined, (void*)(this), 0); + m_MainMenu->add ("Edit/Options", 0, cb_Options, (void*)(this), 0); + m_MainMenu->add ("Plugins/dummy", 0, NULL, NULL, 0); + m_MainMenu->add ("Audio/Pause", 0, cb_PlayPause, NULL, 0); + m_MainMenu->add ("Audio/Reset", 0, cb_Reset, NULL, 0); + //m_MainMenu->add ("Help/Plugins/dummy", 0, NULL, NULL, 0); + //m_MainMenu->add ("Help/Credits", 0, NULL, (void*)(this), 0); + //m_MainMenu->add ("Help/About", 0, NULL, (void*)(this), 0); + m_TopWindow->add (m_MainMenu); + int but = 50; + int ToolbarHeight = but + 0; + m_Topbar = new Fl_Pack (0, 20, MAIN_WIDTH, ToolbarHeight, ""); m_Topbar->user_data((void*)(this)); m_Topbar->type(FL_HORIZONTAL); - m_Topbar->color(SpiralInfo::GUICOL_Button); + m_Topbar->color(SpiralInfo::GUICOL_Button); m_TopWindow->add(m_Topbar); - m_ToolbarPanel = new Fl_Pack (0, 0, but*5, ToolbarHeight, ""); + m_ToolbarPanel = new Fl_Pack (0, 20, but*6, ToolbarHeight, ""); m_ToolbarPanel->user_data((void*)(this)); m_ToolbarPanel->type(FL_VERTICAL); - m_ToolbarPanel->color(SpiralInfo::GUICOL_Button); + m_ToolbarPanel->color(SpiralInfo::GUICOL_Button); m_Topbar->add(m_ToolbarPanel); - m_Toolbar = new Fl_Pack (0, 0, but*5, but, ""); + m_Toolbar = new Fl_Pack (0, 20, but*6, but, ""); m_Toolbar->user_data((void*)(this)); m_Toolbar->type(FL_HORIZONTAL); - m_Toolbar->color(SpiralInfo::GUICOL_Button); + m_Toolbar->color(SpiralInfo::GUICOL_Button); m_ToolbarPanel->add(m_Toolbar); - m_Load = new Fl_Button(0, 0, but, but, ""); + m_Load = new Fl_Button (0, 0, but, but, ""); + m_Load->user_data ((void*)(this)); Fl_Pixmap *tPix = new Fl_Pixmap(load_xpm); m_Load->image(tPix->copy()); delete tPix; @@ -291,6 +360,7 @@ m_Toolbar->add(m_Load); m_Save = new Fl_Button(0, 0, but, but, ""); + m_Save->user_data ((void*)(this)); tPix = new Fl_Pixmap(save_xpm); m_Save->image(tPix->copy()); delete tPix; @@ -304,6 +374,7 @@ m_Toolbar->add(m_Save); m_New = new Fl_Button(0, 0, but, but, ""); + m_New->user_data ((void*)(this)); tPix = new Fl_Pixmap(new_xpm); m_New->image(tPix->copy()); delete tPix; @@ -317,6 +388,7 @@ m_Toolbar->add(m_New); m_Options = new Fl_Button(0, 0, but, but, ""); + m_Options->user_data ((void*)(this)); tPix = new Fl_Pixmap(options_xpm); m_Options->image(tPix->copy()); delete tPix; @@ -326,7 +398,7 @@ m_Options->selection_color(SpiralInfo::GUICOL_Tool); m_Options->labelsize (1); m_Options->tooltip("Options"); - m_Options->callback((Fl_Callback*)cb_Rload); + m_Options->callback((Fl_Callback*)cb_Options); m_Toolbar->add(m_Options); m_NewComment = new Fl_Button(0, 0, but, but, ""); @@ -342,14 +414,39 @@ m_NewComment->callback((Fl_Callback*)cb_NewComment); m_Toolbar->add(m_NewComment); + m_PlayResetGroup = new Fl_Pack (0, 0, but, but, ""); + m_PlayResetGroup->color(SpiralInfo::GUICOL_Button); + m_Toolbar->add(m_PlayResetGroup); + + m_PlayPause = new Fl_Button(0, 0, but, but/2, "@||"); + m_PlayPause->user_data((void*)(this)); + m_PlayPause->type(0); + m_PlayPause->box(FL_PLASTIC_UP_BOX); + m_PlayPause->color(SpiralInfo::GUICOL_Button); + m_PlayPause->selection_color(SpiralInfo::GUICOL_Tool); + m_PlayPause->labelsize (10); + m_PlayPause->tooltip("Pause"); + m_PlayPause->callback((Fl_Callback*)cb_PlayPause); + m_PlayResetGroup->add(m_PlayPause); + + m_Reset = new Fl_Button(0, 0, but, but/2, "Reset"); + m_Reset->box(FL_PLASTIC_UP_BOX); + m_Reset->color(SpiralInfo::GUICOL_Button); + m_Reset->user_data((void*)(this)); + m_Reset->selection_color(SpiralInfo::GUICOL_Tool); + m_Reset->labelsize (10); + m_Reset->tooltip("Reset Audio State of all Plugins"); + m_Reset->callback((Fl_Callback*)cb_Reset); + m_PlayResetGroup->add(m_Reset); + m_GroupFiller = new Fl_Group (0, 0, 0, ToolbarHeight, ""); - m_GroupFiller->color(SpiralInfo::GUICOL_Button); + m_GroupFiller->color(SpiralInfo::GUICOL_Button); m_Topbar->add (m_GroupFiller); - m_GroupTab = new Fl_Tabs (0, 0, MAIN_WIDTH-m_GroupFiller->w()-but*5, ToolbarHeight, ""); + m_GroupTab = new Fl_Tabs (0, 0, MAIN_WIDTH-m_GroupFiller->w()-but*6, ToolbarHeight, ""); m_GroupTab->user_data ((void*)(this)); - m_GroupTab->box(FL_PLASTIC_DOWN_BOX); - m_GroupTab->color(SpiralInfo::GUICOL_Button); + m_GroupTab->box(FL_PLASTIC_DOWN_BOX); + m_GroupTab->color(SpiralInfo::GUICOL_Button); m_GroupTab->callback((Fl_Callback*)cb_GroupTab); m_Topbar->add (m_GroupTab); @@ -357,7 +454,8 @@ ///////////////// - m_CanvasScroll = new Fl_Scroll(0, ToolbarHeight, MAIN_WIDTH, MAIN_HEIGHT-ToolbarHeight, ""); + ToolbarHeight += 20; // Stretch this a bit to allow room for the menu-bar too. + m_CanvasScroll = new Fl_Scroll (0, ToolbarHeight, MAIN_WIDTH, MAIN_HEIGHT-ToolbarHeight, ""); m_TopWindow->add(m_CanvasScroll); m_TopWindow->resizable(m_CanvasScroll); @@ -370,7 +468,12 @@ m_Canvas->user_data((void*)(this)); m_Canvas->SetConnectionCallback((Fl_Callback*)cb_Connection); m_Canvas->SetUnconnectCallback((Fl_Callback*)cb_Unconnect); - m_Canvas->SetAddDeviceCallback((Fl_Callback*)cb_NewDeviceFromMenu); + m_Canvas->SetAddDeviceCallback((Fl_Callback*)cb_NewDeviceFromCanvasMenu); + m_Canvas->SetCutDeviceGroupCallback((Fl_Callback*)cb_Cut); + m_Canvas->SetCopyDeviceGroupCallback((Fl_Callback*)cb_Copy); + m_Canvas->SetPasteDeviceGroupCallback((Fl_Callback*)cb_Paste); + m_Canvas->SetMergePatchCallback((Fl_Callback*)cb_Merge); + m_CanvasScroll->add(m_Canvas); m_SettingsWindow = new SettingsWindow; @@ -425,144 +528,137 @@ return ret; } -void SynthModular::LoadPlugins(string pluginPath) -{ - - int Width = 35; - int Height = 35; - - int SWidth = 256; - int SHeight = 256; - - Fl_Pixmap pic(SSM_xpm); - - Fl_Double_Window* Splash = new Fl_Double_Window((Fl::w()/2)-(SWidth/2), - (Fl::h()/2)-(SHeight/2), - SWidth,SHeight,"SSM"); - Splash->border(0); - - Fl_Box* pbut = new Fl_Box(0,8,SWidth,SHeight,""); - pbut->box(FL_NO_BOX); - pic.label(pbut); - Fl_Box *splashtext = new Fl_Box(5,SHeight-20,200,20,"Loading..."); - splashtext->labelsize(10); - splashtext->box(FL_NO_BOX); - splashtext->align(FL_ALIGN_INSIDE|FL_ALIGN_LEFT); - Splash->add(pbut); - Splash->add(splashtext); - Splash->show(); - - int ID=-1; - - vector PluginVector; - - if (SpiralInfo::USEPLUGINLIST) { - PluginVector=SpiralInfo::PLUGINVEC; - } - else { - if (pluginPath.empty()) { - PluginVector=BuildPluginList (SpiralInfo::PLUGIN_PATH); - } - else { - string::iterator i = pluginPath.end() - 1; - if (*i != '/') pluginPath += '/'; - PluginVector=BuildPluginList(pluginPath); - } - } - - for (vector::iterator i=PluginVector.begin(); - i!=PluginVector.end(); i++) - { - string Fullpath; - if (pluginPath=="") - { - Fullpath=SpiralInfo::PLUGIN_PATH+*i; - } - else - { - Fullpath=pluginPath+*"/"+*i; - } - - ID=PluginManager::Get()->LoadPlugin(Fullpath.c_str()); - if (ID!=PluginError) - { - #ifdef DEBUG_PLUGINS - cerr << ID << " = Plugin [" << *i << "]" << endl; - #endif - - Fl_ToolButton *NewButton = new Fl_ToolButton(0,0,Width,Height,""); - NewButton->user_data((void*)(this)); - NewButton->labelsize(1); - Fl_Pixmap *tPix = new Fl_Pixmap(PluginManager::Get()->GetPlugin(ID)->GetIcon()); - NewButton->image(tPix->copy(tPix->w(),tPix->h())); - delete tPix; - - string GroupName = PluginManager::Get()->GetPlugin(ID)->GetGroupName(); - Fl_Pack* the_group=NULL; - - // find or create this group, and add an icon - map::iterator gi=m_PluginGroupMap.find(GroupName); - if (gi==m_PluginGroupMap.end()) - { - the_group = new Fl_Pack (m_GroupTab->x(), 16, m_GroupTab->w(), m_GroupTab->h()-15, GroupName.c_str()); - the_group->type(FL_HORIZONTAL); - the_group->labelsize(8); - the_group->color(SpiralInfo::GUICOL_Button); - the_group->user_data((void*)(this)); - //m_GroupTab->add(the_group); - m_GroupTab->value(the_group); - m_PluginGroupMap[GroupName]=the_group; - } - else - { - the_group=gi->second; - } - NewButton->type(0); - NewButton->box(FL_NO_BOX); - NewButton->down_box(FL_NO_BOX); - //NewButton->color(SpiralInfo::GUICOL_Button); - //NewButton->selection_color(SpiralInfo::GUICOL_Button); - the_group->add(NewButton); - - string tooltip=*i; - // find the first / if there is one, and get rid of everything before and including it - unsigned int p = tooltip.find ('/'); - if (p < tooltip.length()) tooltip.erase (0, p); - // find last . and get rid of everything after and including it - p = tooltip.rfind ('.'); - unsigned int l = tooltip.length (); - if (p < l) tooltip.erase (p, l); - m_Canvas->AddPluginName (tooltip, PluginManager::Get()->GetPlugin(ID)->ID); - splashtext->label (tooltip.c_str()); - Splash->redraw(); - NewButton->tooltip (tooltip.c_str()); - - NewButton->callback((Fl_Callback*)cb_NewDevice,&Numbers[ID]); - NewButton->show(); - m_DeviceVec.push_back(NewButton); - - the_group->redraw(); - -// m_NextPluginButton++; - Fl::check(); - } - } - map::iterator PlugGrp; - - for (PlugGrp = m_PluginGroupMap.begin(); PlugGrp!= m_PluginGroupMap.end(); ++PlugGrp) - { - m_GroupTab->add(PlugGrp->second); - PlugGrp->second->add(new Fl_Box(0,0,600,100,"")); - } - - // try to show the SpiralSound group - PlugGrp = m_PluginGroupMap.find("SpiralSound"); - // can't find it - show the first plugin group - if (PlugGrp==m_PluginGroupMap.end()) PlugGrp=m_PluginGroupMap.begin(); - m_GroupTab->value(PlugGrp->second); - - Splash->hide(); - delete Splash; +void SynthModular::LoadPlugins (string pluginPath) { + int Width = 35; + int Height = 35; + int SWidth = 256; + int SHeight = 256; + Fl_Pixmap pic (SSM_xpm); + Fl_Double_Window* Splash = new Fl_Double_Window ((Fl::w()/2) - (SWidth/2), (Fl::h()/2) - (SHeight/2), + SWidth, SHeight, "SSM"); + Splash->border(0); + Fl_Box* pbut = new Fl_Box (0, 8, SWidth, SHeight, ""); + pbut->box (FL_NO_BOX); + pic.label (pbut); + Fl_Box *splashtext = new Fl_Box (5, SHeight-20, 200, 20, "Loading..."); + splashtext->labelsize (10); + splashtext->box (FL_NO_BOX); + splashtext->align (FL_ALIGN_INSIDE | FL_ALIGN_LEFT); + Splash->add (pbut); + Splash->add (splashtext); + Splash->show(); + int ID=-1; + vector PluginVector; + if (SpiralInfo::USEPLUGINLIST) PluginVector = SpiralInfo::PLUGINVEC; + else { + if (pluginPath.empty()) PluginVector = BuildPluginList (SpiralInfo::PLUGIN_PATH); + else { + string::iterator i = pluginPath.end() - 1; + if (*i != '/') pluginPath += '/'; + PluginVector = BuildPluginList (pluginPath); + } + } + for (vector::iterator i=PluginVector.begin(); i!=PluginVector.end(); i++) { + string Fullpath; + if (pluginPath=="") Fullpath=SpiralInfo::PLUGIN_PATH+*i; + else Fullpath = pluginPath + *"/" + *i; + ID = PluginManager::Get()->LoadPlugin (Fullpath.c_str()); + if (ID!=PluginError) { + #ifdef DEBUG_PLUGINS + cerr << ID << " = Plugin [" << *i << "]" << endl; + #endif + Fl_ToolButton *NewButton = new Fl_ToolButton (0, 0, Width, Height, ""); + // we can't set user data, because the callback uses it + // NewButton->user_data ((void*)(this)); + NewButton->labelsize (1); + Fl_Pixmap *tPix = new Fl_Pixmap (PluginManager::Get()->GetPlugin(ID)->GetIcon()); + NewButton->image(tPix->copy(tPix->w(),tPix->h())); + delete tPix; + string GroupName = PluginManager::Get()->GetPlugin(ID)->GetGroupName(); + Fl_Pack* the_group=NULL; + // find or create this group, and add an icon + map::iterator gi = m_PluginGroupMap.find (GroupName); + if (gi == m_PluginGroupMap.end()) { + the_group = new Fl_Pack (m_GroupTab->x(), 16, m_GroupTab->w(), m_GroupTab->h() - 15, GroupName.c_str()); + the_group->type(FL_HORIZONTAL); + the_group->labelsize(8); + the_group->color(SpiralInfo::GUICOL_Button); + the_group->user_data((void*)(this)); + //m_GroupTab->add(the_group); + m_GroupTab->value(the_group); + m_PluginGroupMap[GroupName]=the_group; + } + else the_group = gi->second; + NewButton->type (0); + NewButton->box (FL_NO_BOX); + NewButton->down_box (FL_NO_BOX); + //NewButton->color(SpiralInfo::GUICOL_Button); + //NewButton->selection_color(SpiralInfo::GUICOL_Button); + the_group->add (NewButton); + + // we need to keep tooltips stored outside their widgets - widgets just have a pointer + // I haven't done anything about cleaning up these strings - which may cause memory leaks? + // But m_DeviceVec - which, I assume, would be used to keep track of / clean up the dynamicly + // created NewButton widgets isn't cleaned up either, so we might have 2 memory leaks + // involved? - but then again, they might be automatically deallocated because they're + // in another widget, in which case there's just one memory leak to deal with. (andy) + string* PluginName = new string (*i); + // find the first slash, if there is one, and get rid of everything before and including it + unsigned int p = PluginName->find ('/'); + if (p < PluginName->length()) PluginName->erase (0, p); + // find last . and get rid of everything after and including it + p = PluginName->rfind ('.'); + unsigned int l = PluginName->length (); + if (p < l) PluginName->erase (p, l); + NewButton->tooltip (PluginName->c_str()); + // Slashes have significance to the menu widgets, remove them from the GroupName + while ((p = GroupName.find ('/')) < PluginName->length()) + GroupName = GroupName.replace (p, 1, " and "); + string MenuEntry = "Plugins/" + GroupName + "/" + *PluginName; + m_MainMenu->add (MenuEntry.c_str(), 0, cb_NewDeviceFromMenu, &Numbers[ID], 0); + // when help is working better - this will put the plugins into the help menu + // MenuEntry = "Help/" + MenuEntry; + // m_MainMenu->add (MenuEntry.c_str(), 0, NULL, &Numbers[ID], 0); + + // Add the plugins to the canvas menu + m_Canvas->AddPluginName (MenuEntry, PluginManager::Get()->GetPlugin(ID)->ID); + // this overwrites the widget's user_data with that specified for the callback + // so we can't use it for other purposes + NewButton->callback ((Fl_Callback*)cb_NewDevice, &Numbers[ID]); + NewButton->show(); + // Nothing else ever touches m_DeviceVec - is this right??? (andy) + m_DeviceVec.push_back (NewButton); + the_group->redraw(); + // m_NextPluginButton++; + Fl::check(); + splashtext->label (PluginName->c_str()); + Splash->redraw(); + } + } + map::iterator PlugGrp; + for (PlugGrp = m_PluginGroupMap.begin(); PlugGrp!= m_PluginGroupMap.end(); ++PlugGrp) { + m_GroupTab->add (PlugGrp->second); + PlugGrp->second->add (new Fl_Box (0, 0, 600, 100, "")); + } + // try to show the SpiralSound group + PlugGrp = m_PluginGroupMap.find("SpiralSound"); + // can't find it - show the first plugin group + if (PlugGrp==m_PluginGroupMap.end()) PlugGrp=m_PluginGroupMap.begin(); + m_GroupTab->value(PlugGrp->second); + bool found_dummy; + int i; + do { + found_dummy = false; + for (i=0; isize(); i++) { + if (m_MainMenu->text (i) != NULL) { + found_dummy = (strcmp ("dummy", m_MainMenu->text (i)) == 0); + if (found_dummy) break; + } + } + if (found_dummy) m_MainMenu->remove (i); + } while (found_dummy); + Splash->hide(); + delete Splash; } ////////////////////////////////////////////////////////// @@ -616,6 +712,12 @@ nlw->m_Device->SetUpdateCallback(cb_Update); nlw->m_Device->SetParent((void*)this); + if ( nlw->m_Device->IsAudioDriver() ) + { + AudioDriver *driver = ((AudioDriver*)nlw->m_Device); + driver->SetChangeBufferAndSampleRateCallback(cb_ChangeBufferAndSampleRate); + } + PluginInfo PInfo = nlw->m_Device->Initialise(&m_Info); SpiralGUIType *temp = nlw->m_Device->CreateGUI(); Fl_Pixmap *Pix = new Fl_Pixmap(Plugin->GetIcon()); @@ -629,6 +731,7 @@ Info.YPos = y; //rand()%400; nlw->m_DeviceGUI = new Fl_DeviceGUI(Info, temp, Pix, nlw->m_Device->IsTerminal()); + Fl_Canvas::SetDeviceCallbacks(nlw->m_DeviceGUI, m_Canvas); m_Canvas->add(nlw->m_DeviceGUI); m_Canvas->redraw(); @@ -685,6 +788,7 @@ nlw->m_DeviceGUI = new Fl_CommentGUI(Info, NULL, NULL); + Fl_Canvas::SetDeviceCallbacks(nlw->m_DeviceGUI, m_Canvas); m_Canvas->add(nlw->m_DeviceGUI); m_Canvas->redraw(); @@ -708,33 +812,41 @@ ////////////////////////////////////////////////////////// -void SynthModular::UpdateHostInfo() +void SynthModular::cb_ChangeBufferAndSampleRate_i(long int NewBufferSize, long int NewSamplerate) { - // used to use string streams, but this seems to cause a compiler bug - // at the moment, so fall back to using a temporary file + if (SpiralInfo::BUFSIZE != NewBufferSize) + { + // update the settings + SpiralInfo::BUFSIZE = NewBufferSize; + m_HostNeedsUpdate = true; + } - //std::stringstream str; - fstream ofs("___temp.ssmtmp",ios::out); - //str<<*this; - ofs<<*this; + if (SpiralInfo::SAMPLERATE != NewSamplerate) + { + SpiralInfo::SAMPLERATE = NewSamplerate; + m_HostNeedsUpdate = true; + } +} - ClearUp(); - // update the settings +void SynthModular::UpdateHostInfo() +{ + /* Pause Audio */ + FreezeAll(); + + /* update the settings */ m_Info.BUFSIZE = SpiralInfo::BUFSIZE; + m_Info.SAMPLERATE = SpiralInfo::SAMPLERATE; + + /* obsolete - REMOVE SOON */ m_Info.FRAGSIZE = SpiralInfo::FRAGSIZE; m_Info.FRAGCOUNT = SpiralInfo::FRAGCOUNT; - m_Info.SAMPLERATE = SpiralInfo::SAMPLERATE; m_Info.OUTPUTFILE = SpiralInfo::OUTPUTFILE; m_Info.MIDIFILE = SpiralInfo::MIDIFILE; m_Info.POLY = SpiralInfo::POLY; - fstream ifs("___temp.ssmtmp",ios::in); - //str>>*this; - ifs>>*this; - - system("rm -f ___temp.ssmtmp"); - + /* Reset all plugin ports/buffers befure Resuming */ + ResetAudio(); } ////////////////////////////////////////////////////////// @@ -755,34 +867,78 @@ ////////////////////////////////////////////////////////// -istream &operator>>(istream &s, SynthModular &o) +iostream &SynthModular::StreamPatchIn(iostream &s, bool paste, bool merge) { - o.PauseAudio(); + //if we are merging as opposed to loading a new patch + //we have no need to pause audio + if (!merge && !paste) + FreezeAll(); + + //if we are pasting we don't have any of the file version + //or saving information. since its internal we didn't + //need it, but we do have other things we might need to load + + bool has_file_path; + char file_path[1024]; + string m_FromFilePath; - string dummy,dummy2; + string dummy,dummy2; int ver; - s>>dummy>>dummy>>dummy>>ver; - if (ver>FILE_VERSION) + if (paste) { - SpiralInfo::Alert("Bad file, or more recent version."); - return s; - } + m_Copied.devices>>has_file_path; - if (ver>2) + if (has_file_path) + { + m_Copied.devices.getline(file_path, 1024); + m_FromFilePath = file_path; + cerr << file_path << endl; + } + + } + else { - int MainWinX,MainWinY,MainWinW,MainWinH; - int EditWinX,EditWinY,EditWinW,EditWinH; + s>>dummy>>dummy>>dummy>>ver; - s>>MainWinX>>MainWinY>>MainWinW>>MainWinH; - s>>EditWinX>>EditWinY>>EditWinW>>EditWinH; + if (ver>FILE_VERSION) + { + SpiralInfo::Alert("Bad file, or more recent version."); + ThawAll(); + return s; + } - //o.m_MainWindow->resize(MainWinX,MainWinY,MainWinW,MainWinH); - //o.m_EditorWindow->resize(EditWinX,EditWinY,EditWinW,EditWinH); + if (ver>2) + { + int MainWinX,MainWinY,MainWinW,MainWinH; + int EditWinX,EditWinY,EditWinW,EditWinH; + + s>>MainWinX>>MainWinY>>MainWinW>>MainWinH; + s>>EditWinX>>EditWinY>>EditWinW>>EditWinH; + + //o.m_MainWindow->resize(MainWinX,MainWinY,MainWinW,MainWinH); + //o.m_EditorWindow->resize(EditWinX,EditWinY,EditWinW,EditWinH); + } + + if (merge) + m_FromFilePath = m_MergeFilePath; } + //wether pasting or merging we need to clear the current + //selection so we can replace it with the new devices + if (paste || merge) + Fl_Canvas::ClearSelection(m_Canvas); + int Num, ID, PluginID, x,y,ps,px,py; - s>>dummy>>Num; + + if (paste) + { + Num = m_Copied.devicecount; + } + else + { + s>>dummy>>Num; + } for(int n=0; n3) + if (paste || ver>3) { // load the device name int size; @@ -811,75 +967,108 @@ } else { Name = ""; } - } + } #ifdef DEBUG_STREAM cerr<1) s>>ps>>px>>py; - - // Check we're not duplicating an ID - if (o.m_DeviceWinMap.find(ID)!=o.m_DeviceWinMap.end()) + if (paste || ver>1) s>>ps>>px>>py; + + //if we are merging a patch or pasting we will change duplicate ID's + if (!paste && !merge) { - SpiralInfo::Alert("Duplicate device ID found in file - aborting load"); - return s; + // Check we're not duplicating an ID + if (m_DeviceWinMap.find(ID)!=m_DeviceWinMap.end()) + { + SpiralInfo::Alert("Duplicate device ID found in file - aborting load"); + ThawAll(); + return s; + } } if (PluginID==COMMENT_ID) { - DeviceWin* temp = o.NewComment(PluginID, x, y); + DeviceWin* temp = NewComment(PluginID, x, y); if (temp) { + if (paste || merge) + { + m_Copied.m_DeviceIds[ID] = m_NextID++; + ID = m_Copied.m_DeviceIds[ID]; + } + temp->m_DeviceGUI->SetID(ID); - o.m_DeviceWinMap[ID]=temp; - ((Fl_CommentGUI*)(o.m_DeviceWinMap[ID]->m_DeviceGUI))->StreamIn(s); // load the plugin - if (o.m_NextID<=ID) o.m_NextID=ID+1; + m_DeviceWinMap[ID]=temp; + ((Fl_CommentGUI*)(m_DeviceWinMap[ID]->m_DeviceGUI))->StreamIn(s); // load the plugin + + if (paste || merge) + Fl_Canvas::AppendSelection(ID, m_Canvas); + else + if (m_NextID<=ID) m_NextID=ID+1; + } } else { - DeviceWin* temp = o.NewDeviceWin(PluginID, x, y); + DeviceWin* temp = NewDeviceWin(PluginID, x, y); if (temp) { + int oldID=ID; + if (paste || merge) + { + m_Copied.m_DeviceIds[ID] = m_NextID++; + + ID = m_Copied.m_DeviceIds[ID]; + } + temp->m_DeviceGUI->SetID(ID); - if (ver>3) + + if (paste || ver>3) { // set the titlebars temp->m_DeviceGUI->SetName(Name); } - temp->m_Device->SetUpdateInfoCallback(ID,o.cb_UpdatePluginInfo); - o.m_DeviceWinMap[ID]=temp; - o.m_DeviceWinMap[ID]->m_Device->StreamIn(s); // load the plugin + temp->m_Device->SetUpdateInfoCallback(ID,cb_UpdatePluginInfo); + m_DeviceWinMap[ID]=temp; + m_DeviceWinMap[ID]->m_Device->StreamIn(s); // load the plugin + // load external files - o.m_DeviceWinMap[ID]->m_Device->LoadExternalFiles(o.m_FilePath+"_files/"); + if (paste || merge) + m_DeviceWinMap[ID]->m_Device->LoadExternalFiles(m_FromFilePath+"_files/", oldID); + else + m_DeviceWinMap[ID]->m_Device->LoadExternalFiles(m_FilePath+"_files/"); - if (ver>1 && o.m_DeviceWinMap[ID]->m_DeviceGUI->GetPluginWindow()) + if ((paste || ver>1) && m_DeviceWinMap[ID]->m_DeviceGUI->GetPluginWindow()) { // set the GUI up with the loaded values // looks messy, but if we do it here, the plugin and it's gui can remain // totally seperated. - ((SpiralPluginGUI*)(o.m_DeviceWinMap[ID]->m_DeviceGUI->GetPluginWindow()))-> - UpdateValues(o.m_DeviceWinMap[ID]->m_Device); + ((SpiralPluginGUI*)(m_DeviceWinMap[ID]->m_DeviceGUI->GetPluginWindow()))-> + UpdateValues(m_DeviceWinMap[ID]->m_Device); // updates the data in the channel buffers, so the values don't // get overwritten in the next tick. (should maybe be somewhere else) - o.m_DeviceWinMap[ID]->m_Device->GetChannelHandler()->FlushChannels(); + m_DeviceWinMap[ID]->m_Device->GetChannelHandler()->FlushChannels(); // position the plugin window in the main window - //o.m_DeviceWinMap[ID]->m_DeviceGUI->GetPluginWindow()->position(px,py); + //m_DeviceWinMap[ID]->m_DeviceGUI->GetPluginWindow()->position(px,py); if (ps) { - o.m_DeviceWinMap[ID]->m_DeviceGUI->Maximise(); + m_DeviceWinMap[ID]->m_DeviceGUI->Maximise(); // reposition after maximise - o.m_DeviceWinMap[ID]->m_DeviceGUI->position(x,y); + m_DeviceWinMap[ID]->m_DeviceGUI->position(x,y); } - else o.m_DeviceWinMap[ID]->m_DeviceGUI->Minimise(); + else m_DeviceWinMap[ID]->m_DeviceGUI->Minimise(); + + if (paste || merge) + Fl_Canvas::AppendSelection(ID, m_Canvas); } - if (o.m_NextID<=ID) o.m_NextID=ID+1; + if (!paste && !merge) + if (m_NextID<=ID) m_NextID=ID+1; } else { @@ -891,23 +1080,32 @@ } } - s>>*o.m_Canvas; - - o.ResumeAudio(); + if (!paste && !merge) + { + s>>*m_Canvas; + ThawAll(); + } + return s; } +iostream &operator>>(iostream &s, SynthModular &o) +{ + return o.StreamPatchIn(s, false, false); + +} + ////////////////////////////////////////////////////////// ostream &operator<<(ostream &s, SynthModular &o) { - o.PauseAudio(); + o.FreezeAll(); s<<"SpiralSynthModular File Ver "<2) @@ -925,10 +1123,8 @@ for(map::iterator i=o.m_DeviceWinMap.begin(); i!=o.m_DeviceWinMap.end(); i++) { - // 0.2.2fix1 Andrew Johnson Critical BUG in 0.2.2 Sun, 14 Mar 2004 - // if (i->second->m_DeviceGUI && i->second->m_Device) - if (i->second->m_DeviceGUI && ((i->second->m_Device) || (i->second->m_PluginID==COMMENT_ID))) - { + if (i->second->m_DeviceGUI && ((i->second->m_Device) || (i->second->m_PluginID==COMMENT_ID))) + { s<first<<" "; // save the id @@ -983,126 +1179,295 @@ system(command.c_str()); } - o.ResumeAudio(); + o.ThawAll(); return s; } -////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////// -inline void SynthModular::cb_Close_i(Fl_Window* o, void* v) -{ - m_SettingsWindow->hide(); - delete m_SettingsWindow; - m_TopWindow->hide(); - delete m_TopWindow; - o->hide(); -} +// Callbacks -void SynthModular::cb_Close(Fl_Window* o, void* v) -{((SynthModular*)(o->user_data()))->cb_Close_i(o,v);} +///////////////////////////////// +// File Menu & associated buttons -////////////////////////////////////////////////////////// +// New -inline void SynthModular::cb_Load_i(Fl_Button* o, void* v) -{ - if (m_DeviceWinMap.size()>0 && !Pawfal_YesNo("Load - Lose changes to current patch?")) - { - return; - } +inline void SynthModular::cb_New_i (Fl_Widget *o, void *v) { + if (m_DeviceWinMap.size()>0 && !Pawfal_YesNo ("New - Lose changes to current patch?")) + return; + m_TopWindow->label (TITLEBAR.c_str()); + ClearUp(); +} + +void SynthModular::cb_New (Fl_Widget *o, void *v) { + ((SynthModular*)(o->user_data()))->cb_New_i (o, v); +} + +// Load + +inline void SynthModular::cb_Load_i (Fl_Widget *o, void *v) { + if (m_DeviceWinMap.size()>0 && !Pawfal_YesNo ("Load - Lose changes to current patch?")) + return; + char *fn=fl_file_chooser ("Load a patch", "*.ssm", NULL); + if (fn && fn!='\0') { + ifstream in (fn); + if (in) { + fstream inf; + inf.open (fn, ios::in); + m_FilePath = fn; + ClearUp(); + inf >> *this; + inf.close(); + TITLEBAR = LABEL + " " + fn; + m_TopWindow->label (TITLEBAR.c_str()); + } + } +} + +void SynthModular::cb_Load(Fl_Widget *o, void *v) { + ((SynthModular*)(o->user_data()))->cb_Load_i (o, v); +} + +// Save + +inline void SynthModular::cb_Save_i (Fl_Widget *o, void *v) { + char *fn=fl_file_chooser("Save a patch", "*.ssm", NULL); + if (fn && fn!='\0') { + ifstream ifl (fn); + if (ifl) { + if (!Pawfal_YesNo ("File [%s] exists, overwrite?", fn)) + return; + } + ofstream of (fn); + if (of) { + m_FilePath = fn; + of << *this; + TITLEBAR = LABEL + " " + fn; + m_TopWindow->label (TITLEBAR.c_str()); + } + else { + fl_message ( "%s", string ("Error saving " + string(fn)).c_str()); + } + } +} + +void SynthModular::cb_Save (Fl_Widget *o, void *v) { + ((SynthModular*)(o->user_data()))->cb_Save_i (o, v); +} + +// Merge + +inline void SynthModular::cb_Merge_i (Fl_Widget *o, void *v) { + char *fn = fl_file_chooser ("Merge a patch", "*.ssm", NULL); + if (fn && fn!='\0') { + ifstream in (fn); + if (in) { + fstream inf; + inf.open (fn, ios::in); + m_MergeFilePath = fn; + StreamPatchIn (inf, false, true); + m_Canvas->StreamSelectionWiresIn (inf, m_Copied.m_DeviceIds, true, false); + inf.close(); + } + } +} + +void SynthModular::cb_Merge (Fl_Widget *o, void *v) { + ((SynthModular*)(o->parent()->user_data()))->cb_Merge_i (o, v); +} + +// Close + +inline void SynthModular::cb_Close_i (Fl_Widget *o, void *v) { + m_SettingsWindow->hide(); + delete m_SettingsWindow; + m_TopWindow->hide(); + delete m_TopWindow; +} + +void SynthModular::cb_Close (Fl_Widget *o, void *v) { + ((SynthModular*)(o->user_data()))->cb_Close_i (o, v); +} + +///////////////////////////////// +// Edit Menu + +// Cut + +inline void SynthModular::cb_Cut_i(Fl_Widget *o, void *v) { + if (! m_Canvas->HaveSelection()) return; + // show some warning here + cb_Copy_i (o, v); // should we be calling an inline function here?????? + for (unsigned int i=0; iSelection().m_DeviceIds.size(); i++) { + int ID = m_Canvas->Selection().m_DeviceIds[i]; + Fl_DeviceGUI::Kill(m_DeviceWinMap[ID]->m_DeviceGUI); + } + Fl_Canvas::ClearSelection(m_Canvas); +} + +void SynthModular::cb_Cut (Fl_Widget *o, void *v) { + ((SynthModular*)(o->parent()->user_data()))->cb_Cut_i (o, v); +} + +// Copy + +inline void SynthModular::cb_Copy_i (Fl_Widget *o, void *v) { + if (! m_Canvas->HaveSelection()) return; + m_Copied.devices.open ("___temp.ssmcopytmp", ios::out); + m_Copied.devicecount = 0; + m_Copied.m_DeviceIds.clear(); + if (m_FilePath != "") { + m_Copied.devices << true << " " << m_FilePath << endl; + } + else m_Copied.devices << false << endl; + for (unsigned int i=0; iSelection().m_DeviceIds.size(); i++) { + int ID = m_Canvas->Selection().m_DeviceIds[i]; + std::map::iterator j = m_DeviceWinMap.find(ID); + m_Copied.m_DeviceIds[ID] = ID; + m_Copied.devicecount += 1; + m_Copied.devices << "Device " << j->first << " " ; // save the id + m_Copied.devices << "Plugin " <second->m_PluginID << endl; + m_Copied.devices << j->second->m_DeviceGUI->x() << " "; + m_Copied.devices << j->second->m_DeviceGUI->y() << " "; + m_Copied.devices << j->second->m_DeviceGUI->GetName().size() << " "; + m_Copied.devices << j->second->m_DeviceGUI->GetName() << " "; + if (j->second->m_DeviceGUI->GetPluginWindow()) { + m_Copied.devices << j->second->m_DeviceGUI->GetPluginWindow()->visible() << " "; + m_Copied.devices << j->second->m_DeviceGUI->GetPluginWindow()->x() << " "; + m_Copied.devices << j->second->m_DeviceGUI->GetPluginWindow()->y() << " "; + } + else m_Copied.devices << 0 << " " << 0 << " " << 0; + m_Copied.devices << endl; + if (j->second->m_PluginID == COMMENT_ID) { + // save the comment gui + ((Fl_CommentGUI*)(j->second->m_DeviceGUI))->StreamOut (m_Copied.devices); + } + else { + // save the plugin + j->second->m_Device->StreamOut (m_Copied.devices); + } + m_Copied.devices<StreamSelectionWiresOut(m_Copied.devices); + m_Copied.devices.close(); + Fl_Canvas::EnablePaste (m_Canvas); +} - char *fn=fl_file_chooser("Load a patch", "*.ssm", NULL); +void SynthModular::cb_Copy (Fl_Widget *o, void *v) { + ((SynthModular*)(o->parent()->user_data()))->cb_Copy_i (o, v); +} - if (fn && fn!='\0') - { - ifstream inf(fn); +// Paste - if (inf) - { - m_FilePath=fn; +inline void SynthModular::cb_Paste_i (Fl_Widget *o, void *v) { + if (m_Copied.devicecount <= 0) return; + m_Copied.devices.open ("___temp.ssmcopytmp", ios::in); + StreamPatchIn(m_Copied.devices, true, false); + m_Canvas->StreamSelectionWiresIn (m_Copied.devices, m_Copied.m_DeviceIds, false, true); + m_Copied.devices.close(); +} - ClearUp(); - inf>>*this; +void SynthModular::cb_Paste (Fl_Widget *o, void *v) { + ((SynthModular*)(o->parent()->user_data()))->cb_Paste_i (o, v); +} - TITLEBAR=LABEL+" "+fn; - m_TopWindow->label(TITLEBAR.c_str()); - } - } +// Delete + +inline void SynthModular::cb_Delete_i (Fl_Widget *o, void *v) { + m_Canvas->DeleteSelection(); } -void SynthModular::cb_Load(Fl_Button* o, void* v) -{((SynthModular*)(o->parent()->user_data()))->cb_Load_i(o,v);} +void SynthModular::cb_Delete (Fl_Widget *o, void *v) { + ((SynthModular*)(o->user_data()))->cb_Delete_i (o, v); +} -////////////////////////////////////////////////////////// +// Options -inline void SynthModular::cb_Save_i(Fl_Button* o, void* v) -{ - char *fn=fl_file_chooser("Save a patch", "*.ssm", NULL); +inline void SynthModular::cb_Options_i (Fl_Widget *o, void *v) { + m_SettingsWindow->show(); +} - if (fn && fn!='\0') - { - ifstream ifl(fn); - if (ifl) - { - if (!Pawfal_YesNo("File [%s] exists, overwrite?",fn)) - { - return; - } - } +void SynthModular::cb_Options (Fl_Widget* o, void* v) { + ((SynthModular*)(o->user_data()))->cb_Options_i (o, v); +} - ofstream of(fn); +///////////////////////////////// +// Plugin Menu - if (of) - { - m_FilePath=fn; +// This callback has the name that the callback for the canvas menu +// used to have please note - that is now NewDeviceFromCanvasMenu - of<<*this; +inline void SynthModular::cb_NewDeviceFromMenu_i (Fl_Widget *o, void *v) { + AddDevice (*((int*)v)); +} - TITLEBAR=LABEL+" "+fn; - m_TopWindow->label(TITLEBAR.c_str()); - } - else - { - fl_message(string("Error saving "+string(fn)).c_str()); - } - } +void SynthModular::cb_NewDeviceFromMenu (Fl_Widget *o, void *v) { + ((SynthModular*)(o->user_data()))->cb_NewDeviceFromMenu_i (o, v); } -void SynthModular::cb_Save(Fl_Button* o, void* v) -{((SynthModular*)(o->parent()->user_data()))->cb_Save_i(o,v);} -////////////////////////////////////////////////////////// +// (Plugin Buttons) -inline void SynthModular::cb_New_i(Fl_Button* o, void* v) -{ - if (m_DeviceWinMap.size()>0 && !Pawfal_YesNo("New - Lose changes to current patch?")) - { - return; - } +inline void SynthModular::cb_NewDevice_i (Fl_Button *o, void *v) { + AddDevice (*((int*)v)); +} - m_TopWindow->label(TITLEBAR.c_str()); +void SynthModular::cb_NewDevice (Fl_Button *o, void *v) { + ((SynthModular*)(o->parent()->user_data()))->cb_NewDevice_i (o, v); +} - ClearUp(); +// (Plugin Canvas Menu) + +inline void SynthModular::cb_NewDeviceFromCanvasMenu_i (Fl_Canvas* o, void* v) { + AddDevice(*((int*)v),*((int*)v+1),*((int*)v+2)); } -void SynthModular::cb_New(Fl_Button* o, void* v) -{((SynthModular*)(o->parent()->user_data()))->cb_New_i(o,v);} -////////////////////////////////////////////////////////// +void SynthModular::cb_NewDeviceFromCanvasMenu(Fl_Canvas* o, void* v) { + ((SynthModular*)(o->user_data()))->cb_NewDeviceFromCanvasMenu_i(o,v); +} + + +///////////////////////////////// +// Audio Menu + +// Play / Pause + +inline void SynthModular::cb_PlayPause_i (Fl_Widget *o, void *v) { + string oldname = m_PlayPause->tooltip (); + if (m_Info.PAUSED) { + m_PlayPause->label ("@||"); + m_PlayPause->tooltip ("Pause"); + ResumeAudio(); + } + else { + m_PlayPause->label ("@>"); + m_PlayPause->tooltip ("Play"); + PauseAudio(); + } + for (int i=0; isize(); i++) { + if (m_MainMenu->text (i) != NULL) { + if (oldname == m_MainMenu->text (i)) { + m_MainMenu->replace (i, m_PlayPause->tooltip()); + break; + } + } + } -inline void SynthModular::cb_NewDevice_i(Fl_Button* o, void* v) -{ - AddDevice(*((int*)v)); } -void SynthModular::cb_NewDevice(Fl_Button* o, void* v) -{((SynthModular*)(o->parent()->user_data()))->cb_NewDevice_i(o,v);} -////////////////////////////////////////////////////////// +void SynthModular::cb_PlayPause (Fl_Widget *o, void *v) { + ((SynthModular*)(o->user_data()))->cb_PlayPause_i (o, v); +} -inline void SynthModular::cb_NewDeviceFromMenu_i(Fl_Canvas* o, void* v) -{ - AddDevice(*((int*)v),*((int*)v+1),*((int*)v+2)); +// Reset + +inline void SynthModular::cb_Reset_i (Fl_Widget *o, void *v) { + ResetAudio(); +} + +void SynthModular::cb_Reset (Fl_Widget *o, void *v) { + ((SynthModular*)(o->user_data()))->cb_Reset_i (o, v); } -void SynthModular::cb_NewDeviceFromMenu(Fl_Canvas* o, void* v) -{((SynthModular*)(o->user_data()))->cb_NewDeviceFromMenu_i(o,v);} ////////////////////////////////////////////////////////// @@ -1125,30 +1490,6 @@ ////////////////////////////////////////////////////////// -inline void SynthModular::cb_Rload_i(Fl_Button* o, void* v) -{ - m_SettingsWindow->show(); - - /*PluginManager::Get()->UnloadAll(); - - m_ToolBox->remove(m_ToolPack); - delete m_ToolPack; - - m_ToolPack = new Fl_Pack(5,20,TOOLBOX_WIDTH-10, TOOLBOX_HEIGHT-40,""); - m_ToolPack->type(FL_VERTICAL); - m_ToolPack->box(FL_NO_BOX); - m_ToolPack->color(SpiralInfo::GUICOL_Tool); - m_ToolPack->user_data((void*)(this)); - m_ToolBox->add(m_ToolPack); - m_ToolBox->redraw(); - - LoadPlugins();*/ -} -void SynthModular::cb_Rload(Fl_Button* o, void* v) -{((SynthModular*)(o->parent()->user_data()))->cb_Rload_i(o,v);} - -////////////////////////////////////////////////////////// - inline void SynthModular::cb_Connection_i(Fl_Canvas* o, void* v) { CanvasWire *Wire; @@ -1162,32 +1503,32 @@ SpiralInfo::Alert("Warning: Connection problem - can't find source "+string(num)); return; } - + map::iterator di=m_DeviceWinMap.find(Wire->InputID); if (di==m_DeviceWinMap.end()) { - char num[32]; + char num[32]; sprintf(num,"%d",Wire->InputID); SpiralInfo::Alert("Warning: Connection problem - can't find destination "+string(num)); return; } Sample *sample=NULL; - + if (!si->second->m_Device->GetOutput(Wire->OutputPort,&sample)) - { - char num[32]; + { + char num[32]; sprintf(num,"%d,%d",Wire->OutputID,Wire->OutputPort); SpiralInfo::Alert("Warning: Connection problem - can't find source output "+string(num)); - return; + return; } - + if (!di->second->m_Device->SetInput(Wire->InputPort,(const Sample*)sample)) - { - char num[32]; + { + char num[32]; sprintf(num,"%d,%d",Wire->InputID,Wire->InputPort); SpiralInfo::Alert("Warning: Connection problem - can't find source input "+string(num)); - return; + return; } } void SynthModular::cb_Connection(Fl_Canvas* o, void* v) @@ -1199,9 +1540,9 @@ { CanvasWire *Wire; Wire=(CanvasWire*)v; - + //cerr<InputID<<" "<InputPort<::iterator di=m_DeviceWinMap.find(Wire->InputID); if (di==m_DeviceWinMap.end()) { @@ -1234,18 +1575,22 @@ void SynthModular::LoadPatch(const char *fn) { - ifstream inf(fn); + ifstream in(fn); + + if (in) + { + fstream inf; + inf.open(fn, std::ios::in); - if (inf) - { - m_FilePath=fn; + m_FilePath=fn; ClearUp(); - inf>>*this; + inf>>*this; - TITLEBAR=LABEL+" "+fn; - m_TopWindow->label(TITLEBAR.c_str()); - } + inf.close(); + + TITLEBAR=LABEL+" "+fn; + m_TopWindow->label(TITLEBAR.c_str()); + } } -////////////////////////////////////////////////////////// diff -Nru spiralsynthmodular-0.2.2a/SpiralSynthModular.h spiralsynthmodular-0.2.3+git20140329/SpiralSynthModular.h --- spiralsynthmodular-0.2.2a/SpiralSynthModular.h 2004-03-07 07:14:39.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSynthModular.h 2012-05-31 04:13:57.000000000 +0000 @@ -30,8 +30,10 @@ #include #include #include +#include #include #include +#include #include #include "GUI/Widgets/Fl_DeviceGUI.h" #include "GUI/Widgets/Fl_CommentGUI.h" @@ -40,7 +42,7 @@ #include "SpiralSound/ChannelHandler.h" #include "SettingsWindow.h" -const static string VER_STRING = "0.2.2"; +const static string VER_STRING = "0.2.3.cvs"; typedef Fl_Double_Window SpiralWindowType; // typedef Fl_Window SpiralWindowType; @@ -61,11 +63,21 @@ class Fl_ToolButton : public Fl_Button { public: - Fl_ToolButton(int x, int y, int w, int h, const char *n=NULL) : + Fl_ToolButton(int x, int y, int w, int h, const char *n=NULL) : Fl_Button(x,y,w,h,n) {} virtual void draw() { draw_label(); } }; +class DeviceGroup +{ +public: + DeviceGroup() { devicecount = 0; } + + int devicecount; + fstream devices; + map m_DeviceIds;//old ID, new ID +}; + class SynthModular { public: @@ -84,20 +96,43 @@ void UpdatePluginGUIs(); void LoadPatch(const char *fn); - void PauseAudio() + void FreezeAll() { - m_CH.Set("PauseAudio",true); + m_CH.Set("Frozen",true); m_CH.Wait(); } + void ThawAll() + { + m_CH.Set("Frozen",false); + } + + void PauseAudio() + { + m_Info.PAUSED = true; + } + void ResumeAudio() { - m_CH.Set("PauseAudio",false); + m_Info.PAUSED = false; + } + + void ResetAudio() + { + if (! m_ResetingAudioThread) + { + FreezeAll(); + + m_ResetingAudioThread = true; + + ThawAll(); + } } // only for audio thread - bool IsPaused() { return m_PauseAudio; } + bool IsFrozen() { return m_Frozen; } + iostream &StreamPatchIn(iostream &s, bool paste, bool merge); private: vector BuildPluginList(const string &Path); @@ -106,6 +141,8 @@ DeviceWin* NewComment(int n, int x, int y); HostInfo m_Info; + bool m_ResetingAudioThread, m_HostNeedsUpdate, m_Frozen; + static DeviceGUIInfo BuildDeviceGUIInfo(PluginInfo &PInfo); @@ -114,72 +151,84 @@ static map m_DeviceWinMap; int m_NextID; - static bool m_CallbackUpdateMode; static bool m_BlockingOutputPluginIsReady; - string m_FilePath; + string m_FilePath, m_MergeFilePath; // Main GUI stuff - void CreateGUI(int xoff=0, int yoff=0, char *name=""); - - Fl_Pack *m_Topbar, *m_ToolbarPanel, *m_Toolbar; - Fl_Group *m_GroupFiller; - Fl_Button *m_Load; - Fl_Button *m_Save; - Fl_Button *m_New; - Fl_Button *m_Options; - Fl_Button *m_NewComment; + void CreateGUI (int xoff=0, int yoff=0, char *name=""); + Fl_Menu_Bar *m_MainMenu; + Fl_Pack *m_Topbar, *m_ToolbarPanel, *m_Toolbar; + Fl_Group *m_GroupFiller; + Fl_Button *m_Load, *m_Save, *m_New, *m_Options, *m_NewComment; + Fl_Pack *m_PlayResetGroup; + Fl_Button *m_PlayPause, *m_Reset; Fl_Tabs *m_GroupTab; - Fl_Canvas *m_Canvas; Fl_Scroll *m_CanvasScroll; - map m_PluginGroupMap; - SettingsWindow *m_SettingsWindow; - SpiralWindowType* m_TopWindow; - vector m_DeviceVec; - ChannelHandler m_CH; // used for threadsafe communication - bool m_PauseAudio; + DeviceGroup m_Copied; - inline void cb_NewDevice_i(Fl_Button* o, void* v); - static void cb_NewDevice(Fl_Button* o, void* v); - inline void cb_NewDeviceFromMenu_i(Fl_Canvas* o, void* v); - static void cb_NewDeviceFromMenu(Fl_Canvas* o, void* v); inline void cb_NewComment_i(Fl_Button* o, void* v); - static void cb_NewComment(Fl_Button* o, void* v); - inline void cb_Load_i(Fl_Button* o, void* v); - static void cb_Load(Fl_Button* o, void* v); - inline void cb_Save_i(Fl_Button* o, void* v); - static void cb_Save(Fl_Button* o, void* v); - inline void cb_New_i(Fl_Button* o, void* v); - static void cb_New(Fl_Button* o, void* v); + static void cb_NewComment(Fl_Button* o, void* v); + // File menu - and associated buttons, etc. + inline void cb_New_i (Fl_Widget *o, void *v); + static void cb_New (Fl_Widget *o, void *v); + inline void cb_Load_i (Fl_Widget *o, void *v); + static void cb_Load (Fl_Widget *o, void *v); + inline void cb_Save_i (Fl_Widget *o, void *v); + static void cb_Save (Fl_Widget *o, void *v); + inline void cb_Merge_i (Fl_Widget *o, void *v); + static void cb_Merge (Fl_Widget *o, void *v); + inline void cb_Close_i (Fl_Widget *o, void *v); + static void cb_Close (Fl_Widget *o, void *v); + // Edit menu + inline void cb_Cut_i (Fl_Widget *o, void *v); + static void cb_Cut (Fl_Widget *o, void *v); + inline void cb_Copy_i (Fl_Widget *o, void *v); + static void cb_Copy (Fl_Widget *o, void *v); + inline void cb_Paste_i (Fl_Widget *o, void *v); + static void cb_Paste (Fl_Widget *o, void *v); + inline void cb_Delete_i (Fl_Widget *o, void *v); + static void cb_Delete (Fl_Widget *o, void *v); + inline void cb_Options_i (Fl_Widget *o, void *v); + static void cb_Options (Fl_Widget *o, void *v); + // Plugin Menu + inline void cb_NewDevice_i (Fl_Button *o, void *v); + static void cb_NewDevice (Fl_Button *o, void *v); + inline void cb_NewDeviceFromMenu_i (Fl_Widget *o, void *v); + static void cb_NewDeviceFromMenu (Fl_Widget *o, void *v); + inline void cb_NewDeviceFromCanvasMenu_i (Fl_Canvas *o, void *v); + static void cb_NewDeviceFromCanvasMenu (Fl_Canvas *o, void *v); + // Audio Menu + inline void cb_PlayPause_i (Fl_Widget *o, void *v); + static void cb_PlayPause (Fl_Widget *o, void *v); + inline void cb_Reset_i (Fl_Widget *o, void *v); + static void cb_Reset (Fl_Widget *o, void *v); + inline void cb_Connection_i(Fl_Canvas* o, void* v); static void cb_Connection(Fl_Canvas* o, void* v); inline void cb_Unconnect_i(Fl_Canvas* o, void* v); static void cb_Unconnect(Fl_Canvas* o, void* v); - inline void cb_Close_i(Fl_Window* o, void* v); - static void cb_Close(Fl_Window* o, void* v); - inline void cb_GroupTab_i(Fl_Tabs* o, void* v); static void cb_GroupTab(Fl_Tabs* o, void* v); - - inline void cb_Rload_i(Fl_Button* o, void* v); - static void cb_Rload(Fl_Button* o, void* v); - - static void cb_Update(void* o, bool Mode); - static void cb_Blocking(void* o, bool Mode); + static void cb_Update(void* o, bool Mode); + static void cb_Blocking(void* o, bool Mode); static void cb_UpdatePluginInfo(int ID, void *PluginInfo); - - + inline void cb_ChangeBufferAndSampleRate_i(long int NewBufferSize, long int NewSamplerate); + static void cb_ChangeBufferAndSampleRate(long unsigned int NewBufferSize, long unsigned int NewSamplerate, void *o) + { + ((SynthModular*)o)->cb_ChangeBufferAndSampleRate_i(NewBufferSize, NewSamplerate); + } friend istream &operator>>(istream &s, SynthModular &o); friend ostream &operator<<(ostream &s, SynthModular &o); }; -istream &operator>>(istream &s, SynthModular &o); +iostream &operator>>(iostream &s, SynthModular &o); ostream &operator<<(ostream &s, SynthModular &o); #endif diff -Nru spiralsynthmodular-0.2.2a/SpiralSynthModular.pro spiralsynthmodular-0.2.3+git20140329/SpiralSynthModular.pro --- spiralsynthmodular-0.2.2a/SpiralSynthModular.pro 2003-07-22 22:08:34.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/SpiralSynthModular.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -HEADERS = SpiralSynthModular.h \ - GraphSort.h \ - GUI/Widgets/Fl_DeviceGUI.h \ - GUI/Widgets/Fl_CommentGUI.h \ - GUI/Widgets/Fl_DragBar.H \ - GUI/Widgets/Fl_Canvas.h \ - SpiralSound/SpiralInfo.h \ - SpiralSound/Sample.h \ - SpiralSound/Plugins/SpiralPlugin.h \ - SpiralSound/Plugins/SpiralPluginGUI.h \ - SpiralSound/PluginManager.h \ - SettingsWindow.h \ - SpiralSynthPluginLocation.h - -SOURCES = SpiralSynthModular.C \ - GraphSort.C \ - GUI/Widgets/Fl_DeviceGUI.C \ - GUI/Widgets/Fl_CommentGUI.C \ - GUI/Widgets/Fl_DragBar.cxx \ - GUI/Widgets/Fl_Canvas.C \ - SpiralSound/SpiralInfo.C \ - SpiralSound/Sample.C \ - SpiralSound/Plugins/SpiralPlugin.C \ - SpiralSound/Plugins/SpiralPluginGUI.C \ - SpiralSound/PluginManager.C \ - SettingsWindow.C - -TARGET = SpiralSynthModular diff -Nru spiralsynthmodular-0.2.2a/stamp-h spiralsynthmodular-0.2.3+git20140329/stamp-h --- spiralsynthmodular-0.2.2a/stamp-h 2004-02-17 15:37:08.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/stamp-h 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -timestamp diff -Nru spiralsynthmodular-0.2.2a/test-run spiralsynthmodular-0.2.3+git20140329/test-run --- spiralsynthmodular-0.2.2a/test-run 1970-01-01 00:00:00.000000000 +0000 +++ spiralsynthmodular-0.2.3+git20140329/test-run 2012-05-31 04:13:57.000000000 +0000 @@ -0,0 +1,20 @@ +#!/bin/bash + +if [ $# -gt 0 ] ; then + if ! [ -e links/$1.so ] ; then + echo Creating link for $1 + ln -s ../SpiralSound/Plugins/$1/$1.so links/$1.so + fi +else + if ! [ -d links ] ; then + if [ -e links ] ; then + echo A file \"links\" alredy exists, can\'t create the directory + exit + fi + mkdir links + fi + xargs -n 1 $0 < SpiralSound/PluginList.txt + + ./spiralsynthmodular --PluginPath `pwd`/links/ +fi +