seq24-0.9.3/0000755000175000017500000000000012651206575007473 500000000000000seq24-0.9.3/depcomp0000755000175000017500000005601612321053731010764 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2013-05-30.07; # UTC # Copyright (C) 1999-2013 Free Software Foundation, Inc. # 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, see . # 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. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: seq24-0.9.3/ChangeLog0000644000175000017500000004552212651206370011166 00000000000000+++ Release 0.9.3 (2016-02-24) +++ 2016-01-22 Wolfgang Illmeyer * configure.ac, src/perfedit.cpp, m4/*: Make the build work with C++11, as required by recent versions of gtkmm 2012-02-25 Guido Scholz * src/perform.*: Remove --file option from jack session commandline, hint by Frank Kober 2012-02-24 Guido Scholz * src/perform.*: Register empty process callback for JACK, patch provided by Lieven Moors 2012-01-05 Sebastien Alaiwan * src/perform.cpp: Fix clock tick drift 2011-01-04 Guido Scholz * src/lash.*, src/seq24.cpp: Fix lash client initialization +++ Release 0.9.2 (2010-11-27) +++ 2010-11-25 Guido Scholz * configure.in: remove unused variables, harmonize option enabling/disabling 2010-11-24 Guido Scholz * src/mainwnd.cpp, src/mainwnd.h: use initialization list for members, close pipe on exit, use name label for sreen set name 2010-11-23 Guido Scholz * src/seq24.cpp: read only existing configuration files 2010-11-23 Guido Scholz * src/configfile.cpp, src/configfile.h, src/controllers.h, src/event.cpp, src/event.h, src/font.cpp, src/font.h, src/globals.h, src/maintime.cpp, src/maintime.h, src/mainwid.cpp, src/mainwid.h, src/mainwnd.h, src/midibus.cpp, src/midibus.h, src/midibus_portmidi.cpp, src/midibus_portmidi.h, src/midifile.cpp, src/mutex.cpp, src/mutex.h, src/options.cpp, src/options.h, src/optionsfile.cpp, src/optionsfile.h, src/perfedit.cpp, src/perfedit.h, src/perfnames.cpp, src/perfnames.h, src/perform.cpp, src/perform.h, src/perfroll.cpp, src/perfroll.h, src/seqdata.cpp, src/seqdata.h, src/seqedit.cpp, src/seqedit.h, src/seqevent.cpp, src/seqevent.h, src/seqkeys.cpp, src/seqkeys.h, src/seqmenu.cpp, src/seqmenu.h, src/seqroll.cpp, src/seqroll.h, src/seqtime.cpp, src/seqtime.h, src/sequence.cpp, src/sequence.h, src/userfile.cpp, src/userfile.h: remove trailing whitespaces 2010-11-23 Guido Scholz * src/mainwnd.cpp, src/seq24.cpp: add missing line breaks 2010-11-23 Guido Scholz * man/seq24.1, src/mainwnd.h, src/seq24.cpp: remove -f commandline option to be replaced by a simple argument 2010-11-23 Guido Scholz * src/lash.cpp, src/lash.h, src/seq24.cpp: fix lash connect to start after command line parsing 2010-11-22 Guido Scholz * src/mainwnd.cpp, src/mainwnd.h: add interrupt handlers for SIGINT and SIGUSR1 to enable LADISH level 1 support 2010-11-22 Guido Scholz * src/mainwnd.cpp: fix typo again 2010-11-22 Guido Scholz * src/keybindentry.cpp, src/keybindentry.h, src/Makefile.am, src/options.cpp: move keybindentry class to separate file 2010-11-21 Guido Scholz * src/mainwnd.cpp: fix typo 2010-11-21 Guido Scholz * src/seq24.cpp: change short option for version to V, fix compiler warning 2010-11-20 Guido Scholz * man/seq24.1: add missing command line parameters to man page 2010-11-20 Guido Scholz * src/seq24.cpp: add missing command line parameters to help message, show also short options, add version option 2010-11-20 Guido Scholz * src/lash.cpp, src/seq24.cpp: first parse command line before anything else is done 2010-11-20 Guido Scholz * src/mainwnd.cpp: fix doubled key event for screen set name line (notes edit line) 2010-11-20 Guido Scholz * src/mainwnd.cpp: rearrange bottom line item layout to get rid of whitespace label spacing, add mnemonics for widgets 2010-11-20 Guido Scholz * src/mainwnd.cpp: rearrange bottom line item addition 2010-11-14 Guido Scholz * src/mainwnd.cpp: rename box containers to make clear what they are responsible for 2010-11-11 Guido Scholz * src/mainwnd.h: remove doubled options header include 2010-11-11 Guido Scholz * src/options.cpp: remove doubled "show_all()" call 2010-11-11 Guido Scholz * INSTALL, configure.in, src/globals.h, src/perform.cpp, src/perform.h, src/seq24.cpp: add support for jack session, patch provided by Torben Hohn (slightly changed) 2010-11-10 Guido Scholz * src/pixmaps/Makefile.am: add missing file 2010-11-10 Guido Scholz * src/pixmaps, configure.in, src/Makefile.am, src/font.cpp, src/mainwnd.cpp, src/perfedit.cpp, src/seqedit.cpp, src/bus.xpm, src/pixmaps/bus.xpm, src/collapse.xpm, src/pixmaps/collapse.xpm, src/copy.xpm, src/pixmaps/copy.xpm, src/down.xpm, src/pixmaps/down.xpm, src/expand.xpm, src/pixmaps/expand.xpm, src/font_b.xpm, src/pixmaps/font_b.xpm, src/font_w.xpm, src/pixmaps/font_w.xpm, src/key.xpm, src/pixmaps/key.xpm, src/learn.xpm, src/pixmaps/learn.xpm, src/learn2.xpm, src/pixmaps/learn2.xpm, src/length.xpm, src/pixmaps/length.xpm, src/loop.xpm, src/pixmaps/loop.xpm, src/menu_empty.xpm, src/pixmaps/menu_empty.xpm, src/menu_full.xpm, src/pixmaps/menu_full.xpm, src/midi.xpm, src/pixmaps/midi.xpm, src/note_length.xpm, src/pixmaps/note_length.xpm, src/perfedit.xpm, src/pixmaps/perfedit.xpm, src/play.xpm, src/pixmaps/play.xpm, src/play2.xpm, src/pixmaps/play2.xpm, src/q_rec.xpm, src/pixmaps/q_rec.xpm, src/quanize.xpm, src/pixmaps/quanize.xpm, src/rec.xpm, src/pixmaps/rec.xpm, src/redo.xpm, src/pixmaps/redo.xpm, src/scale.xpm, src/pixmaps/scale.xpm, src/seq-editor.xpm, src/pixmaps/seq-editor.xpm, src/seq24.xpm, src/pixmaps/seq24.xpm, src/seq24_32.xpm, src/pixmaps/seq24_32.xpm, src/sequences.xpm, src/pixmaps/sequences.xpm, src/snap.xpm, src/pixmaps/snap.xpm, src/song-editor.xpm, src/pixmaps/song-editor.xpm, src/stop.xpm, src/pixmaps/stop.xpm, src/thru.xpm, src/pixmaps/thru.xpm, src/tools.xpm, src/pixmaps/tools.xpm, src/undo.xpm, src/pixmaps/undo.xpm, src/zoom.xpm, src/pixmaps/zoom.xpm: cleanup pixmap files into separate directory 2010-11-10 Guido Scholz * src/perform.cpp: fix sched_param memory leaks 2010-11-10 Guido Scholz * src/options.cpp: fix typo 2010-11-10 Guido Scholz * src/options.cpp, src/options.h: fix tooltip usage for older GTK versions (GTK_MINOR_VERSION < 12) +++ Release 0.9.1 (2010-11-08) +++ 2010-11-08 Guido Scholz * depcomp, install-sh, missing, mkinstalldirs: remove administrative autotools scripts from repository 2010-11-08 Guido Scholz * NEWS: fix some typos 2010-11-08 Guido Scholz * src/perform.cpp: fix compiler warning 2010-11-08 Guido Scholz * src/perform.cpp: Revert revision 48.1.21..48.1.23 MIDI clock change 2010-11-07 Guido Scholz * src/options.*: table container for control keys, table container for mute-group keys, mnemonics for notebook pages, Jack sync page redesigned using group frames and mnemonics, select mouse interaction mode via radiobuttons. * src/mainwnd.cpp: Update author list and date 2010-11-06 Guido Scholz * src/options.cpp: Use stock-id for OK button, split notebook setup according to contained pages, table container for sequence group keys 2010-11-05 Guido Scholz * src/mainwnd.cpp: fix HButtonBox compile error 2010-02-21 Sebastien Alaiwan * src/configfile.cpp, src/event.cpp, src/event.h, src/maintime.cpp, src/mainwid.cpp, src/mainwid.h, src/midibus.cpp, src/midibus.h, src/midifile.cpp, src/midifile.h, src/options.cpp, src/perfnames.cpp, src/perfroll.cpp, src/perftime.cpp, src/perftime.h, src/seqdata.cpp, src/seqdata.h, src/seqedit.cpp, src/seqedit.h, src/seqevent.cpp, src/seqevent.h, src/seqkeys.cpp, src/seqmenu.cpp, src/seqroll.cpp, src/seqroll.h, src/seqtime.cpp, src/sequence.cpp: Merged constructor initializer lists 2010-02-21 Sebastien Alaiwan * src/event.cpp, src/mainwnd.cpp, src/seqmenu.cpp: Merged 2010-02-21 Sebastien Alaiwan * src/configfile.cpp, src/event.cpp, src/event.h, src/maintime.cpp, src/mainwid.cpp, src/mainwid.h, src/midibus.cpp, src/midibus.h, src/midifile.cpp, src/midifile.h, src/options.cpp, src/perfnames.cpp, src/perfroll.cpp, src/perftime.cpp, src/perftime.h, src/seqdata.cpp, src/seqdata.h, src/seqedit.cpp, src/seqedit.h, src/seqevent.cpp, src/seqevent.h, src/seqkeys.cpp, src/seqmenu.cpp, src/seqroll.cpp, src/seqroll.h, src/seqtime.cpp, src/sequence.cpp: Code improvement: use initializer lists in constructors 2010-02-20 Sebastien Alaiwan * src/event.cpp, src/mainwnd.cpp, src/seqmenu.cpp: Merge removal of useless nullity tests 2010-02-20 Sebastien Alaiwan * src/event.cpp, src/mainwnd.cpp, src/seqmenu.cpp: Removed unecessary nullity tests before deletes. deleting NULL has no effect. 2010-02-20 Sebastien Alaiwan * src/midifile.cpp: Cleanup: removed some unused variables, reduced unecessary big scope of some other variables 2010-02-20 Sebastien Alaiwan * src/midifile.cpp, src/midifile.h: Wrapped reading of single bytes, and removed the push_front/reverse list browsing insanity. 2010-02-20 Sebastien Alaiwan * src/midifile.cpp, src/midifile.h: Use STL in midifile instead of news/deletes 2009-10-06 Ivan Hernandez * src/sequence.cpp, src/sequence.h: Plyphonic Step Edit 2009-10-06 Ivan Hernandez * src/seqroll.cpp, src/sequence.cpp: Monophonic Step Edit on Sequence 2009-10-05 Ivan Hernandez * src/sequence.cpp: Fixed adding notes on the begining when midi record is on and not playing sequence 2009-09-26 Killian EBEL * src/perform.cpp: Fixed jack_position_t->bar calculation which always where 0 or negative while using Hydrogen 0.9.4 at the same time. 2009-06-27 Guido Scholz * src/mainwnd.cpp: Mute group learn dialogs changed to use std:string formatting. 2009-06-26 Guido Scholz * configure.in: Support for --as-needed linker flag added to remove unused library references. 2009-06-25 Guido Scholz * src/perform.cpp: MIDI clock control modified. 2009-06-24 Kevin Meinert * src/globals.h, src/midifile.cpp: Support for mute groups in MIDI files added. 2009-06-23 Guido Scholz * src/mainwid.cpp, src/mainwnd.cpp, src/options.cpp, src/perfnames.cpp, src/perftime.cpp, src/perfedit.cpp, src/seqdata.cpp, src/perform.cpp, src/seqedit.cpp, src/seqkeys.cpp, seqtime.cpp. src/seqmenu.cpp, src/optionsfile.cpp, src/userfile.cpp: sprintf() replaced by snprintf() to avoid buffer overflows. 2009-06-18 Kevin Meinert * src/globals.h, src/mainwnd.cpp, src/midibus_portmidi.cpp, src/options.cpp, src/optionsfile.cpp, src/perfedit.cpp, src/perform.cpp, src/seq24.cpp, src/seqroll.cpp: Some compiler warnings fixed, generic key name translation. 2009-05-29 Guido Scholz * src/options.cpp: Fixed missing return value for on_key_press_event(). * src/midibus.cpp: Improved MIDI buffer size handling. * man/seq24.1: Command line option for mouse interaction method added. * SEQ24: Documentation for mute groups added (provided by Andrea delle Canne and Frank Kober). 2009-05-29 Sebastien Alaiw * src/midibus.cpp: Fixed handling of error condition for snd_midi_event_decode(). 2009-05-28 Kevin Meinert , Andrea delle Canne * src/globals.h, src/learn.xpm, src/learn2.xpm, src/mainwid.*, src/options.*, src/optionsfile.cpp, src/perfedit.cpp, src/perform.*, src/seq24.cpp, src/seqedit.cpp, src/seqmenu.cpp, src/seqroll.cpp, src/userfile.cpp: Mute group feature added. 2009-05-27 Kevin Meinert * src/perform.*: Support for MIDI clock synchronization added. * src/globals.h, src/mainwnd.cpp, src/options.h, src/optionsfile.cpp, src/seq24.cpp, src/perfroll.*, src/seqroll.*, src/seqevent.*, src/sequence.*: Fruitty loop editing added. 2009-05-22 Sebastien Alaiw * src/mainwnd.cpp: Fixed file save as crash. * src/midifile.cpp: Fixed MIDI sysex event reading. 2009-05-22 Guido Scholz * src/seq24.cpp, src/midibus.*, midibus_portmidi.*, perform.cpp, options.cpp, lash.*, seauence.h, globals.h, configwin32.h: Support for (lost) Win32 platform support added (reworked patch from Kevin Meinert, Rob Buse). * src/seqedit.cpp, src/seqroll.*: Optimized redraw for sequencer roll background (from Win32 version, Rob Buse). 2009-03-14 Stéphane Letz <> * src/iperform.cpp: Adaptations for jack2 applied. 2008-12-01 Guido Scholz * src/seq.cpp, src/optionsfile.cpp: Fixed error if path for last used directory is not properly set. * src/mainwnd.cpp: "Cancel" option added to "Save file?" question. 2008-11-30 Guido Scholz * src/mainwnd.cpp: Check for GTK minor version added to avoid tooltip compile error for GTK < 2.12. 2008-11-29 Guido Scholz * src/globals.h, src/configfile.*, src/midifile.*, src/mainwnd.*, src/optionsfile.*, src/seq24.cpp: Handle filenames more consistently as UTF-8 strings. +++ Release 0.9.0 (2008-11-27) +++ 2008-11-27 Guido Scholz * src/perfedit.cpp, src/seqedit.cpp: Window icons for song editor and sequence editor added. 2008-10-18 Guido Scholz * src/midifile.cpp: Fixed memory leak if MIDI file format error occurs. Error messages added to give user better feedback about reason behind file read error. 2008-09-28 Daniel Ellis * src/perfroll.cpp: Panning in the song editor using the scroll wheel (when SHIFT is used). 2008-09-16 Daniel Ellis * src/seqdata.cpp, src/seqedit.*, src/seqroll.cpp: Zooming and panning in the editor window using the scroll wheel (when CTRL or SHIFT are used) implemented. Horizontal scroll step interval increased to 1/16 note per zoom level and page interval to 1 bar. 2008-09-16 Guido Scholz * src/mainwnd.*: About dialog changed to use new layout. Project contributors added accordingly. * src/seqdata.cpp: Buffer overflow fixed; provided by Anthony Green. 2008-09-15 Guido Scholz * src/main.cpp, src/mainwnd.*: File new/open/save/close logic rewritten to monitor user applied file changes. 2008-09-13 Guido Scholz * src/dump.cpp, src/Makefile.am: "dump" program removed, source files in Makefile.am reordered. * configure.in, src/Makefile.am: Cleanup compiler and linker variables handling for gtkmm library. * src/mainwnd.*: Use newer file dialog, MIDI files are preselectable. ".midi" suffix is added if user does not append a valid MIDI file extension. New menu item to show and hide song edit window. Tooltips for bottom line elements added. 2008-09-08 Jaakko Sipari * perfroll.cpp, seqevent.cpp, seqroll.cpp: Added backspace as an optional delete key to the pattern editor. 2008-09-08 Guido Scholz * src/mainwnd.cpp: Keyboard shortcuts for menu items added. Menu rearranged to use less separators. 2008-09-07 Guido Scholz * src/mainwnd.*: Title page naming changed. * src/seqedit.cpp: Fixed GTK warning about invalid input string, caused by buffer overflow. 2008-08-30 Guido Scholz * man/seq24.1: Man page from Ubuntu added; written by Dana Olson. 2008-08-27 Guido Scholz * src/*.xpm: Fixed missing "const" to avoid compiler warnings. * configure.in: Enabled bzip2 tarball for make target "dist". Checks for gtkmm-2.4 , sigc-2.0 and asound libraries added. * main.cpp, src/seq24_32.xpm: Application icon added. Typos fixed. * event.cpp, font.cpp: Missing include for header files added; was complained by gcc 4.3. * mainwnd.h, options.cpp, perfedit.*, seqedit.cpp, seqmenu.cpp: Switched to sigc++-2.0 API, to make program compatible to latest sigc++ version (2.2). 2008-07-03 Ivan Hernandez * redo.xpm, seqedit.*, sequence.*: Added Redo function on sequence editor. 2008-05-19 Ivan Hernandez * midifile.cpp: Fixes the BPM saving on 64bit platforms, patch provided by Pete Leigh. 2008-05-12 Ivan Hernandez * globals.h, mainwnd.cpp, optionsfile.cpp, seqedit.*, seqroll.cpp, sequence.*, q_rec.xpm, quanize.xpm: Round robbin logic on sequence edit. Start stop shortcut on sequence editor. Remembers last used directory on configuration so you go where you worked. Live Quantize, so notes get to the right time when you play. Fixed volume. Makes midi input have a fixed volume when you record. v0.4.2 ------------------------------------------------ 2003-5-14 * Updated main interface * added --priority flag (runs at higher priority) * refactored midi system, took out midi prebuffer v0.4.1 ------------------------------------------------ * Fixed gcc 3.2 compile problem * real time value change in data window v0.4.0 ------------------------------------------------ 2002-10-8 * Added Performace editor. v0.3.0 ------------------------------------------------ 2002-9-16 * Midi clock configure Dialog ( removed #ifndef MIDI_CLOCK stuff ) * Updated main interface (progress bars, spin widgets for bpm and screen set ) * Midi recording & midi Thru in edit window * Ability to move/select/delete rouge Note On/Off events (just deleted them before ) * Added Paino Roll progress indicator, removed one from upper time bar thing. * Removed context menu to switch from Add/Select mode on paino roll. Now you just right click and hold down on paino roll and event bar to toggle modes. * Moved Event select button, now on bottom with a display of curent event type. v0.2.0 ------------------------------------------------- 2002-08-04 * Added Control Code Editor 2002-07-16 * seqkeys.C - fixed black key drawing problem v0.1.1 ------------------------------------------------- 2002-07-15 Rob Buse rcbuse@filter24.org * added #define _GNU_SOURCE to makefile.in v0.1.0 ------------------------------------------------- 2002-07-14 Rob Buse rcbuse@filter24.org * Initial release of seq24-0.1.0 woohoo! seq24-0.9.3/Makefile.in0000644000175000017500000011736612651206573011474 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for seq24 # Makefile.am for seq24 # Makefile.am for seq24 # Makefile.am for seq24 VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : DIST_COMMON = $(srcdir)/man/Module.am $(srcdir)/src/Module.am \ $(srcdir)/src/pixmaps/Module.am INSTALL NEWS README AUTHORS \ ChangeLog $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/configure $(am__configure_deps) \ $(top_srcdir)/src/config.h.in depcomp $(dist_man_MANS) COPYING \ TODO compile install-sh missing bin_PROGRAMS = src/seq24$(EXEEXT) subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) am__dirstamp = $(am__leading_dot)dirstamp am_src_seq24_OBJECTS = src/configfile.$(OBJEXT) src/event.$(OBJEXT) \ src/font.$(OBJEXT) src/keybindentry.$(OBJEXT) \ src/lash.$(OBJEXT) src/maintime.$(OBJEXT) \ src/mainwid.$(OBJEXT) src/mainwnd.$(OBJEXT) \ src/midibus.$(OBJEXT) src/midibus_portmidi.$(OBJEXT) \ src/midifile.$(OBJEXT) src/mutex.$(OBJEXT) \ src/options.$(OBJEXT) src/optionsfile.$(OBJEXT) \ src/perfedit.$(OBJEXT) src/perfnames.$(OBJEXT) \ src/perform.$(OBJEXT) src/perfroll.$(OBJEXT) \ src/perfroll_input.$(OBJEXT) src/perftime.$(OBJEXT) \ src/seq24.$(OBJEXT) src/seqdata.$(OBJEXT) \ src/seqedit.$(OBJEXT) src/seqevent.$(OBJEXT) \ src/seqkeys.$(OBJEXT) src/seqmenu.$(OBJEXT) \ src/seqroll.$(OBJEXT) src/seqtime.$(OBJEXT) \ src/sequence.$(OBJEXT) src/userfile.$(OBJEXT) src_seq24_OBJECTS = $(am_src_seq24_OBJECTS) am__DEPENDENCIES_1 = src_seq24_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(src_seq24_SOURCES) DIST_SOURCES = $(src_seq24_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 NROFF = nroff MANS = $(dist_man_MANS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 GZIP_ENV = --best DIST_TARGETS = dist-bzip2 dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ GTKMM_CFLAGS = @GTKMM_CFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ HAVE_CXX11 = @HAVE_CXX11@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JACK_CFLAGS = @JACK_CFLAGS@ JACK_LIBS = @JACK_LIBS@ LASH_CFLAGS = @LASH_CFLAGS@ LASH_LIBS = @LASH_LIBS@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = MOSTLYCLEANFILES = *~ EXTRA_DIST = README COPYING RTC AUTHORS INSTALL SEQ24 NEWS ChangeLog \ seq24usr.example src/pixmaps/bus.xpm src/pixmaps/collapse.xpm \ src/pixmaps/copy.xpm src/pixmaps/down.xpm \ src/pixmaps/expand.xpm src/pixmaps/font_b.xpm \ src/pixmaps/font_w.xpm src/pixmaps/key.xpm \ src/pixmaps/learn2.xpm src/pixmaps/learn.xpm \ src/pixmaps/length.xpm src/pixmaps/loop.xpm \ src/pixmaps/menu_empty.xpm src/pixmaps/menu_full.xpm \ src/pixmaps/midi.xpm src/pixmaps/note_length.xpm \ src/pixmaps/perfedit.xpm src/pixmaps/play2.xpm \ src/pixmaps/play.xpm src/pixmaps/q_rec.xpm \ src/pixmaps/quanize.xpm src/pixmaps/rec.xpm \ src/pixmaps/redo.xpm src/pixmaps/scale.xpm \ src/pixmaps/seq24_32.xpm src/pixmaps/seq24.xpm \ src/pixmaps/seq-editor.xpm src/pixmaps/sequences.xpm \ src/pixmaps/snap.xpm src/pixmaps/song-editor.xpm \ src/pixmaps/stop.xpm src/pixmaps/thru.xpm \ src/pixmaps/tools.xpm src/pixmaps/undo.xpm \ src/pixmaps/zoom.xpm src/configwin32.h dist_man_MANS = man/seq24.1 AM_CXXFLAGS = $(GTKMM_CFLAGS) $(JACK_CFLAGS) $(LASH_CFLAGS) -Wall src_seq24_LDADD = $(GTKMM_LIBS) $(ALSA_LIBS) $(JACK_LIBS) $(LASH_LIBS) src_seq24_SOURCES = \ src/configfile.cpp \ src/controllers.h \ src/event.cpp \ src/font.cpp \ src/font.h \ src/globals.h \ src/keybindentry.cpp \ src/lash.cpp \ src/configfile.h \ src/event.h \ src/keybindentry.h \ src/lash.h \ src/maintime.cpp \ src/maintime.h \ src/mainwid.cpp \ src/mainwid.h \ src/mainwnd.cpp \ src/mainwnd.h \ src/midibus.cpp \ src/midibus.h \ src/midibus_portmidi.cpp \ src/midibus_portmidi.h \ src/midifile.cpp \ src/midifile.h \ src/mutex.cpp \ src/mutex.h \ src/options.cpp \ src/options.h \ src/optionsfile.cpp \ src/optionsfile.h \ src/perfedit.cpp \ src/perfedit.h \ src/perfnames.cpp \ src/perfnames.h \ src/perform.cpp \ src/perform.h \ src/perfroll.cpp \ src/perfroll.h \ src/perfroll_input.cpp \ src/perfroll_input.h \ src/perftime.cpp \ src/perftime.h \ src/seq24.cpp \ src/seqdata.cpp \ src/seqdata.h \ src/seqedit.cpp \ src/seqedit.h \ src/seqevent.cpp \ src/seqevent.h \ src/seqkeys.cpp \ src/seqkeys.h \ src/seqmenu.cpp \ src/seqmenu.h \ src/seqroll.cpp \ src/seqroll.h \ src/seqtime.cpp \ src/seqtime.h \ src/sequence.cpp \ src/sequence.h \ src/userfile.cpp \ src/userfile.h all: all-recursive .SUFFIXES: .SUFFIXES: .cpp .o .obj am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/man/Module.am $(srcdir)/src/Module.am $(srcdir)/src/pixmaps/Module.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(srcdir)/man/Module.am $(srcdir)/src/Module.am $(srcdir)/src/pixmaps/Module.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): src/config.h: src/stamp-h1 @test -f $@ || rm -f src/stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) src/stamp-h1 src/stamp-h1: $(top_srcdir)/src/config.h.in $(top_builddir)/config.status @rm -f src/stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status src/config.h $(top_srcdir)/src/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f src/stamp-h1 touch $@ distclean-hdr: -rm -f src/config.h src/stamp-h1 install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) src/$(am__dirstamp): @$(MKDIR_P) src @: > src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) src/$(DEPDIR) @: > src/$(DEPDIR)/$(am__dirstamp) src/configfile.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/event.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) src/font.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) src/keybindentry.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/lash.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) src/maintime.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/mainwid.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/mainwnd.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/midibus.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/midibus_portmidi.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/midifile.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/mutex.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) src/options.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/optionsfile.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/perfedit.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/perfnames.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/perform.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/perfroll.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/perfroll_input.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/perftime.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/seq24.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) src/seqdata.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/seqedit.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/seqevent.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/seqkeys.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/seqmenu.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/seqroll.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/seqtime.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/sequence.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/userfile.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/seq24$(EXEEXT): $(src_seq24_OBJECTS) $(src_seq24_DEPENDENCIES) $(EXTRA_src_seq24_DEPENDENCIES) src/$(am__dirstamp) @rm -f src/seq24$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(src_seq24_OBJECTS) $(src_seq24_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f src/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/configfile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/event.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/font.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/keybindentry.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lash.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/maintime.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/mainwid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/mainwnd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/midibus.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/midibus_portmidi.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/midifile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/mutex.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/options.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/optionsfile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/perfedit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/perfnames.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/perform.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/perfroll.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/perfroll_input.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/perftime.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/seq24.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/seqdata.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/seqedit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/seqevent.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/seqkeys.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/seqmenu.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/seqroll.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/seqtime.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/sequence.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/userfile.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` install-man1: $(dist_man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(dist_man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(PROGRAMS) $(MANS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f src/$(DEPDIR)/$(am__dirstamp) -rm -f src/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf src/$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-man install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-man1 install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -rf src/$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall-man: uninstall-man1 .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-binPROGRAMS \ clean-cscope clean-generic cscope cscopelist-am ctags ctags-am \ dist dist-all dist-bzip2 dist-gzip dist-lzip dist-shar \ dist-tarZ dist-xz dist-zip distcheck distclean \ distclean-compile distclean-generic distclean-hdr \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-man1 install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-binPROGRAMS uninstall-man \ uninstall-man1 # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: seq24-0.9.3/NEWS0000644000175000017500000000752712651206420010112 00000000000000seq24-0.9.3 (2016-01-24) Fixed Bugs * Fix LASH support (crash on 64 Bit systems) * Fix broken JACK transport with newer jackd version * Fix clock tick drift * Fix jack session commandline (obsolete --file option removed) New Features * Non recursive make General Changes * Some code cleanups * C++11 compatible compiler required seq24-0.9.2 (2010-11-27) Fixed Bugs * Fix tooltip usage for older GTK versions (GTK_MINOR_VERSION < 12) * Fix sched_param memory leaks * Fix doubled key event for screen set name line New Features * Add support for jack session, patch provided by Torben Hohn * Add interrupt handler for SIGUSR1 to enable LADISH level 1 support * Add interrupt handler for SIGINT to ask for unsaved file changes * Remove "-f" command line option to be replaced by a simple argument (see "seq24 --help" for more information) General Changes * Add mnemonics for bottom line widgets in main window and label for screen set name edit line * Add missing command line parameters to help message, display short options as well * Add command line option for program version * Add missing command line parameters to man page * Remove complaints about file read error if configuration files do not exist * Cleanup configure.in: remove unused variables, harmonize option enabling/disabling * Some code cleanups seq24-0.9.1 (2010-11-08) Fixed Bugs * Fixed error if path for last used directory is not properly set * Fixed adding notes on the beginning when MIDI record is on and not playing sequence * Fixed buffer overflow caused by string handling (tool menu) * Fixed file save as crash * Fixed MIDI sysex event reading * Fixed error if path for last used directory is not properly set * "Cancel" option added to "Save file?" question New Features * Support for MIDI clock synchronization * Support for mute groups * Optionally show shortcut key label on sequence icon * Fruity loop mouse interaction mode added * Monophonic step editing on sequence * Polyphonic step editing General Changes * A lot of code cleanups * Support for (lost) Win32 platform added * Optimized redraw for sequencer roll background (from Win32 version, Rob Buse) * Adaptations for jack2 applied seq24-0.9.0 (2008-11-27) Fixed Bugs * Fixed BPM saving on 64 bit platforms. * Several string buffer overruns fixed. * Several compiler warnings fixed. * Fixed memory leak if file loading fails due to format errors. New Features * Round robbin logic on sequence edit added. * Start stop shortcut on sequence editor added. * Remember last used directory on configuration so you go where you worked. * Live Quantize, so notes get to the right time when you play. * Fixed volume. Makes midi input have a fixed volume when you record. * Added Redo function on sequence editor. * Switched to sigc++-2.0 API, to make program compatible to latest sigc++ version (2.2). * Man page from Ubuntu added. * Keyboard shortcuts for menu items added. * Added backspace as an optional delete key to the pattern editor. * Use new file dialog layout, MIDI files are preselectable. ".midi" suffix is added if user does not append a valid MIDI file extension. * New menu item to show and hide song edit window. * Tooltips for bottom line elements in main window added. * File new/open/save/close logic rewritten to monitor user applied file changes. * "dump" program removed. * About dialog changed to use new layout. * Zooming and panning in the editor window using the scroll wheel (when CTRL or SHIFT are used) implemented. Horizontal scroll step interval increased to 1/16 note per zoom level and page interval to 1 bar. * Panning in the song editor using the scroll wheel (when SHIFT is used) implemented. * Window icons for song editor and sequence editor added. seq24-0.9.3/INSTALL0000644000175000017500000003661012651156360010446 00000000000000Installation Instructions ************************* Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== Briefly, the shell command `./configure && make && make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. Some packages provide this `INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. Running `configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type `make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the `make install' phase executed with root privileges. 5. Optionally, type `make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior `make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type `make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide `make distcheck', which can by used by developers to test that all other targets like `make install' and `make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. This is known as a "VPATH" build. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple `-arch' options to the compiler but only a single `-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the `lipo' tool if you have problems. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of `${prefix}', so that specifying just `--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to `configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the `make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, `make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of `${prefix}'. Any directories that were specified during `configure', but not in terms of `${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the `DESTDIR' variable. For example, `make install DESTDIR=/alternate/directory' will prepend `/alternate/directory' before all installation names. The approach of `DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of `${prefix}' at `configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of `make' will be. For these packages, running `./configure --enable-silent-rules' sets the default to minimal output, which can be overridden with `make V=1'; while running `./configure --disable-silent-rules' sets the default to verbose, which can be overridden with `make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. HP-UX `make' updates targets which have the same time stamps as their prerequisites, which makes it generally unusable when shipped generated files such as `configure' are involved. Use GNU `make' instead. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put `/usr/ucb' early in your `PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in `/usr/bin'. So, if you need `/usr/ucb' in your `PATH', put it _after_ `/usr/bin'. On Haiku, software installed for all users goes in `/boot/common', not `/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf limitation. Until the limitation is lifted, you can use this workaround: CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of all of the options to `configure', and exit. `--help=short' `--help=recursive' Print a summary of the options unique to this package's `configure', and exit. The `short' variant lists options used only in the top level, while the `recursive' variant lists options also present in any nested packages. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. `--no-create' `-n' Run the configure checks, but stop before creating any output files. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. seq24-0.9.3/AUTHORS0000644000175000017500000000071011465522762010462 00000000000000seq24 Authors ------------- Rob C. Buse Ivan Hernandez Guido Scholz Dana Olson Jaakko Sipari Peter Leigh Anthony Green Daniel Ellis Sebastien Alaiwan Kevin Meinert Andrea delle Canne seq24-0.9.3/configure.ac0000644000175000017500000000712512651206442011677 00000000000000dnl Process this file with autoconf to produce a configure script. AC_INIT(seq24, [0.9.3], [seq24-devel@lists.sourceforge.net]) AC_CONFIG_SRCDIR([src/event.cpp]) AC_CONFIG_HEADER([src/config.h]) AC_CONFIG_MACRO_DIRS([m4]) AM_INIT_AUTOMAKE([dist-bzip2 subdir-objects]) AC_DEFINE(_GNU_SOURCE, 1, [gnu source]) dnl Checks for programs. AC_PROG_AWK AC_PROG_CC AC_PROG_CXX AC_PROG_INSTALL AC_PROG_LN_S AX_CXX_COMPILE_STDCXX_11(noext,mandatory) dnl Do we have -Wl,--as-needed? AC_MSG_CHECKING(if --as-needed works) AC_ARG_ENABLE(as_needed, [AS_HELP_STRING(--enable-as-needed, [Enable linker option -Wl,--as-needed (default=yes)])], [ case "${enableval}" in yes) as_needed="1";; no) as_needed="";; *) AC_MSG_ERROR(bad value ${enableval} for --enable-as_needed);; esac ],[ as_needed="unknown" ]) if test x"${as_needed}" = x"unknown"; then ac_old_ldflags="${LDFLAGS}" LDFLAGS="-Wl,--as-needed" AC_TRY_LINK( [], [], [as_needed="1"], [as_needed=""]) LDFLAGS="${ac_old_ldflags}" fi if test -n "$as_needed"; then AC_MSG_RESULT(yes) LDFLAGS="${LDFLAGS} -Wl,--as-needed" else AC_MSG_RESULT(no) fi dnl Checks for libraries. AC_CHECK_LIB(rt, main, , AC_MSG_ERROR([POSIX.1b RealTime Library Missing -lrt])) AC_CHECK_LIB(gtkmm-2.4, _init,, AC_MSG_ERROR(Essential library libgtkmm-2.4 not found)) AC_CHECK_LIB(sigc-2.0, main,, AC_MSG_ERROR(Essential library libsigc++-2.0 not found)) dnl AC_CHECK_LIB(asound, snd_pcm_open,, dnl AC_MSG_ERROR(Essential library asound not found)) dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(getopt.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST dnl ALSA AM_PATH_ALSA(0.9.0) dnl gtkmm PKG_CHECK_MODULES(GTKMM, gtkmm-2.4 >= 2.4.0) AC_SUBST(GTKMM_CFLAGS) AC_SUBST(GTKMM_LIBS) dnl dnl JACK SUPPORT dnl AC_ARG_ENABLE(jack, [AS_HELP_STRING(--disable-jack, [Disable JACK support])], [jack=$enableval], [jack=yes]) AC_ARG_ENABLE(jack-session, [AS_HELP_STRING(--disable-jack-session, [Disable JACK session support])], [jack_session=$enableval], [jack_session=yes]) if test "$jack" != "no"; then PKG_CHECK_MODULES(JACK, jack >= 0.90.0, jack_found="yes", jack_found="no") if test "$jack_found" = "yes"; then AC_DEFINE(JACK_SUPPORT, 1, [Define to enable JACK driver]) AC_SUBST(JACK_CFLAGS) AC_SUBST(JACK_LIBS) dnl JACK session if test "$jack_session" != "no"; then AC_CHECK_HEADER(jack/session.h, jack_session_found="yes", jack_session_found="no") if test "$jack_session_found" = "yes"; then AC_DEFINE(JACK_SESSION, 1, [Define to enable JACK session support]) fi fi else AC_MSG_WARN([*** Could not find JACK library, disabling JACK support]) fi else AC_MSG_WARN([*** JACK support not enabled.]); fi dnl dnl LASH SUPPORT dnl AC_ARG_ENABLE(lash, [AS_HELP_STRING(--disable-lash, [Disable LASH support])], [lash=$enableval], [lash=yes]) if test "$lash" != "no"; then PKG_CHECK_MODULES(LASH, lash-1.0 >= 0.5.0, lash_found="yes", lash_found="no") if test "$lash_found" = "yes"; then AC_DEFINE(LASH_SUPPORT, 1, [Define to enable LASH support]) AC_SUBST(LASH_CFLAGS) AC_SUBST(LASH_LIBS) else AC_MSG_WARN([*** LASH not found, session support will not be built.]) fi else AC_MSG_WARN([*** LASH support not enabled.]); fi AC_OUTPUT(Makefile) seq24-0.9.3/RTC0000644000175000017500000000546311060731321007757 00000000000000** Note ** this text is quite outdated. If you check out the linux kernels high resolution timer patches for 2.4 (they are built in 2.5+). They will allow the scheduler and default timers to run at 1000Hz. [1] RTC - What is is.... The following was taken from the site of Takashi Iwai: (http://www.alsa-project.org/~iwai/alsa.html) ------------------------------------------------------------------------- RTC High Frequency Timer Patch RTC has a nice high-frequent interrupt capability up to 8192 Hz. Although this can be used (on the recent kernel) even from userspace via fasync signals, it is not allowed to use the interrupt from kernel. This is the very reason of this patch. This tiny patch adds a hook to the RTC driver in linux kernel. A callback function is called at each interrupt. For changing frequency, starting and stopping interrupts, use rtc_control function. The older version of this patch had more functionalities than the current version, for example, multiple callbacks with different frequencies are allowed. From this patch, however, I intensionally removed these things, because of simplicity. Only one callback can be used exclusively (even to user-space). That is, if a kernel driver (e.g. ALSA RTC timer) registers the callback, no other threads can use RTC interrupt. /dev/rtc cannot be opened during it. -------------------------------------------------------------------------- [2] What is does..... In a nutshell, it allows the sequencer to pump out midi messages at a resolution of 1 millisecond, compared to the standard 2.4.x kernels 10ms. This is needed for midi clock, where 2-3 ms in-between ticks is necessary, or your synced gear will be acting quite funny. ------------------------------------------------------------------------- [3] How to get it... So basically, if you want to use the RTC patch, you have to get it from the alsa-driver files. Download the current driver tarball from ( http://www.alsa-project.org/ ). Located in [alsa-driver-0.9.0x/utils/patches] are diff files to apply towards your kernel source. Once you have that patched and installed, you compile your alsa drivers with the rtc-timer module. Then, modify your modules.conf file accordingly. Here is what mine looks like: > modules.conf excerpt ------------------ # rtc options snd-timer snd_timer_limit=2 alias snd-timer-1 snd-rtctimer options snd-seq snd_seq_default_timer_resolution=1000 options snd-seq snd_seq_default_timer_device=1 # ALSA portion alias char-major-116 snd alias snd-card-0 snd-emu10k1 > -------------------------------------- ------------------------------------------------------------------------- [4] Problems ? If your having problems with the RTC module, please ask on one of the ALSA lists. The author of seq24 does not wish to troubleshoot your kernel/alsa issues. seq24-0.9.3/SEQ240000644000175000017500000003217611217356737010150 00000000000000SEQ24 - Midi Sequencer ====================== [1] What & Why [2] Who [3] Interface [4] Contact / Bugs / Ideas [5] License ----------------------------------------------------------- [1] What & Why Seq24 is a real-time midi sequencer. It was created to provide a very simple interface for editing and playing midi 'loops'. After searching for a software based sequencer that would provide the functionality needed for a live performance, there was little found in the software realm. I set out to create a very minimal sequencer that excludes the bloated features of the large software sequencers, and includes a small subset of features that I have found usable in performing. ----------------------------------------------------------- [2] Who Written by Rob C. Buse. I wrote this program to fill a hole. I figure it would be a waste if I was the only one using it. So, I released it under the GPL. ----------------------------------------------------------- [3] Interface The program is basically a loop playing machine with a simple interface. [3a] Main Window * File. The File menu is used to save and load standard MIDI files. It should be able to handle any Format 1 standard files, Any other sequencer should be capable of exporting. * Options Used to configure what bus midi clock gets dumped to. * Help. Shows the About box. * Boxes Each box represents a loop. By right clicking on an empty box you bring up a menu to create a new loop, or edit a existing one. Left clicking on a box will change its state from muted (white) to playing (black) when the sequencer is running. By clicking and holding the left button on a sequence, you can drag it to a new location on the grid. Right Clicking will bring up a menu of available options for the sequence. Here you can select the midi bus/channel. You can also clear all performance data (on/off) see section [3d] for more info. * 'Screen Sets' You only see 32 loops in the main window. This is a screen set. You can switch between sets by using the '[' and ']' keys on your keyboard or the spin widget labeled set. There are a total of 32 sets, for a total of 1024 loops. * BPM The ; and ' keys will increase/decrease tempo as will the bpm spinner. * Muting and Unmuting Tracks. Left clicking on a Tracks will toggle its playing status. Hitting its assigned keyboard key will also toggle its status. Below is the grid thats mapped to the loops on the screen set. [1 ][2 ][3 ][4 ][5 ][6 ][7 ][8 ] [q ][w ][e ][r ][t ][y ][u ][i ] [a ][s ][d ][f ][g ][h ][j ][k ] [z ][x ][c ][v ][b ][n ][m ][, ] * Mute/Unmute patterns (Groups) You can toggle the playing status of up to 32 previously defined mute/unmute patterns (groups) in the active screen set, similar to hardware sequencers. This is done either by one of the 'group toggle' keys or by a MIDI controller, both assigned in the .seq24rc file. A Mute/Unmute pattern (group) is stored by holding a 'group learn' key while pressing the corresponding 'group toggle' key. There are also keys assigned to turn on/off the group functionality. * Replace Holding down 'Left Ctrl' while selecting a sequence will mute all other sequences and turn on the selected sequences. * Restore Holding 'Alt' will save the state of playing sequences and restore them when 'Alt' is lifted. Holding 'Left Ctrl' and 'Alt' at the same time will enable you to flip over to new sequences briefly and then flip right back upon lifting 'Alt'. * Queue Holding 'Right Ctrl' will queue a on/off toggle for a sequence when the loop ends. Queue also works for mute/unmute patterns (groups), in this case every sequence will toggle its status after its individual loop end. * keep queue Pressing the 'keep queue' key assigned in the .seq24rc file activates permanent queue mode until you use the temporary Queue function again pressing 'Right Ctrl'. [3b] Options Window This window allows us to select which sequence gets midi clock, and which incoming midi events control the sequencer. [3c] Edit Window Right clicking on the main window then selecting New/Edit will bring up the edit window. The top bar of the sequence editor lets you change the name of the sequence, the time signature of the piece, and how long the loop is. Snap selects where the notes will be drawn. Note Length determines what size they will be. Scale is the relation between midi ticks and pixels. 1:4 = 4 ticks per pixel. The Bus button selects which ALSA device to use, and which midi channel. The 3rd line contains the Undo button, which will roll back any changes to the sequence from this session. You can select which Scale and Key the piece is in and it will grey out those keys on the roll not in the key. You can select a sequence to draw on the background to help with writing corresponding parts. Holding the mouse over any button for a short period will let you view what it does. While the sequencer is playing, you can mute/unmute the sequence by toggling the [Play] button. The [Thru] button will relay any ALSA midi input to the sequences Bus and midi channel. [Record] will capture and ALSA midi input and save it in the sequence. On both the grid window and the event window, HOLDING down the right mouse button will change your cursor to a pencil and put you in 'draw' mode. Then while still HOLDING the right mouse button, click the left mouse button to insert new notes. Many people find this combination strange at first, but once you get used to it, it becomes a very fast method of note manipulation. Pressing the middle mouse button will let you change the length of the note. The left mouse button lets you select multiple events which can then be clicked and moved, cut (Ctrl-X), copy (Ctrl-C), or pasted (Ctrl-V). When the notes are selected, you can delete them with the Delete key. Right clicking on the event strip ( directly under the paino roll grid ) will allow you to add/select/move midi events (not note on/off messages) somewhat like the piano grid. The data editor ( directly under the event strip ) is used to change note velocities, channel pressure, control codes, patch select, etc. Just click + drag the mouse across the window to draw a line. The values will match that line. Any events that are selected in the paino roll or event strip can have their values modified with the mouse wheel. The [Event] button allows you to select which type of data the event strip and data editor are currently displaying. [3d] Performace Edit Right Click on the Roll to enter draw mode, gray boxes represent when the track is on. Right and left click to drop the [R] and [L] anchors on the bar indicator. Use the collapse and expand button to modify events. Middle click on the bar indicator to drop a new start position. You can only change the start position when the performace is not playing. [3e] .seq24rc File After you run seq24 for the first time, it will generate a .seq24rc file in your home directory. It contains the the data for remote midi control, keyboard control, and midi clock. * [midi-control] For each sequence, we can set up midi events to turn a sequence on, off, or toggle it. We see the following lines in the [midi-control] section: 0 [0 0 0 0 0 0] [0 0 0 0 0 0] [0 0 0 0 0 0] 1 [0 0 0 0 0 0] [0 0 0 0 0 0] [0 0 0 0 0 0] 2 [0 0 0 0 0 0] [0 0 0 0 0 0] [0 0 0 0 0 0] ... The first number is the sequence in the main window. Each set of brackets corresponds to a midi filter. If the incoming midi event matches the filter, it will either [toggle],[on],or[off] the sequence respectivaly. The layout of each filter inside the bracket is as follows: [(on/off) (inverse) (midi status byte (channel ignored)) (data1) (data2 min) (data2 max)] If the on/off is set to 1, it will match the incoming midi to the pattern and perfrom the action (on/off/toggle) if the data falls in the range specified. All values are in decimal. The last three is the range of data that will match. The following is an example of responding to note on events, note 0, with any velocity to turn the sequence on, and note off events, note 0, and any velocity to turn the sequence off. Toggle On Off 1 [0 0 0 0 0 0] [1 0 144 0 0 127] [1 0 128 0 0 127] the inverse field will make the sequence perform the opposite action (off for on, on for off) if the data falls outside the specified range. This is cool because you can map several sequences to a knob or fader. The following example would map a row of sequences to one knob sending out changes for Control Code 1: Toggle On Off 0 [0 0 0 0 0 0] [1 1 176 1 0 15] [0 0 0 0 0 0] 1 [0 0 0 0 0 0] [1 1 176 1 16 31] [0 0 0 0 0 0] 2 [0 0 0 0 0 0] [1 1 176 1 32 47] [0 0 0 0 0 0] 3 [0 0 0 0 0 0] [1 1 176 1 48 63] [0 0 0 0 0 0] 4 [0 0 0 0 0 0] [1 1 176 1 64 79] [0 0 0 0 0 0] 5 [0 0 0 0 0 0] [1 1 176 1 80 95] [0 0 0 0 0 0] 6 [0 0 0 0 0 0] [1 1 176 1 96 111] [0 0 0 0 0 0] 7 [0 0 0 0 0 0] [1 1 176 1 112 127] [0 0 0 0 0 0] # mute in group This section controls 32 groups of mutes in the same way as defined for [midi-control]. A group is a set of sequences that can toggle their playing state together. Every group contains all 32 sequences in the active screen set (see after). [mute-group] Here there are the definitions of the state of the 32 sequences in the playing screen set when a group is selected. group [state of the first 8 sequences] [second 8] [third 8] [fourth 8] After the list of sequences and their midi events, you can set seq24 to handle midi events and change the following: * [midi-clock] The midi clock fields will contain the clocking state from the last time seq24 was run. Turn off clock with a 0, or on with a 1. * [keyboard-control] The keyboard control is a dump of the keys that seq24 recognises and its corresponding sequence number. Note that the first number corresponds to the number of sequences in the active screen set. * [keyboard-group] Same as keyboard-control, but to control groups. #bpm up and down -> keys to control bpm #screen set up and down -> keys for changing the active screenset #group functionality on, group functionality off, group learn -> note that the group learn key is a modifier key to be held while pressing a group toggle key #replace, queue, snapshot_1, snapshot_2, keep queue -> These are the other modifier keys explained in section 3a. *NOTES*: To see the required key codes when pressed, run seq24 with --show_keys. Seq24 will overwrite the .seq24rc file on quit. You should therefore quit seq24 before doing modifications to the .seq24rc file. Some keys should not be assigned to control sequences in seq24 as they are already assigned in the seq24 menu (with ctrl). [3f] JACK Transport In order to run seq24 with JACK Tranport Sync, you need to enable it at the command line with the following flags: --jack_transport : seq24 will sync to JACK transport if the JACK server is available. --jack_master : seq24 will try to be JACK master --jack_master_cond : The attempt to be JACK master will fail if there is already a master, otherwise it will just take over. --jack_start_mode : When seq24 is synced to JACK, The playback command comes from the JACK server. seq24 will play in performance mode by default (section [3d]). If you want live mode, set --jack_start_mode 0. It is best to run seq24 with another master like ardour. You can not change the BPM of seq24 while rolling in JACK sync mode. ----------------------------------------------------------- [4] Contact If you have Ideas about seq24 or a bug report, please email seq24@filter24.org. If its a bug report, please add [BUG] to the subject. ----------------------------------------------------------- [5] License Released under the Terms of the GPL. See the COPYING file for a full readout. seq24-0.9.3/seq24usr.example0000644000175000017500000002232211060731321012442 00000000000000# # This is an example for a .seq24usr file # Edit and place in your home directory # It allows you to give an alias to # each midi bus, midi channel, and midi control # codes per channel # # 1) Define your Instruments and their Control Code # names if they have them. # 2) Define a midi bus, its name, and what instruments # are on which channel # # [user-midi-bus-definitions] #number user buses 3 [user-midi-bus-0] #name 2x2 A (SuperNova,Q,TX81Z,DrumStation) # num channels 16 # NOTE: 0-15 not 1-16 # instruments -1 = GM 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 3 9 3 10 3 11 0 12 0 13 0 14 0 15 2 [user-midi-bus-1] 2x2 B (WaveStation,ESI-2000,MV4,ES-1,ER-1) # num channels 16 # NOTE: 0-15 not 1-16 # instruments -1 = GM 0 4 1 4 2 4 3 4 4 5 5 5 6 5 7 5 8 5 9 5 10 5 11 5 12 5 13 5 14 6 15 7 [user-midi-bus-2] PCR-30 (303) # num channels 1 # NOTE: 0-15 not 1-16 # instruments -1 = GM 0 8 # rest defaults to -1 : General MIDI [user-instrument-definitions] #number definitions 9 [user-instrument-0] #name Waldorf Micro Q # midi controllers 128 0 1 Modulation Wheel 2 Breath Control 3 4 Foot Control 5 Glide Rate 6 7 Channel Volume 8 9 10 Pan 11 12 Arp Range (0-9) (1-10 octaves) 13 Arp Length (0-15) (1-16 steps) 14 Arp Active (0-3) (Off,On,One Shot,Hold) 15 LFO 1 Shape (0-5) (Sine,Tri,Square,Saw,Rand,S&H) 16 LFO 1 Speed (0-127) (256 Bars-1/96) 17 LFO 1 Sync (0-1) (Off,On) 18 LFO 1 Delay 19 LFO 2 Shape (0-5) (Sine,Tri,Square,Saw,Rand,S&H) 20 LFO 2 Speed (0-127) (256 Bars-1/96) 21 LFO 2 Sync (0-1) (Off,On) 22 LFO 2 Delay 23 LFO 3 Shape (0-5) (Sine,Tri,Square,Saw,Rand,S&H) 24 LFO 3 Speed (0-127) (256 Bars-1/96) 25 LFO 3 Sync (0-1) (Off,On) 26 LFO 3 Delay 27 Osc 1 Octave (16,28,40-112) (128'-1/2') 28 Osc 1 Semitone (52-76) (-12-+12) 29 Osc 1 Detune (0-127) (-64-63) 30 Osc 1 FM 31 Osc 1 Shape (0-5) (Pulse,Saw,Tri,Sine,Alt 1,Alt 2) 32 Bank Select LSB (0-3) (Bank A-D) 33 Osc 1 PW 34 Osc 1 PWM (0-127) (-64-63) 35 Osc 2 Octave (16,28,40-112) (128'-1/2') 36 Osc 2 Semitone (52-76) (-12-+12) 37 Osc 2 Detune (0-127) (-64-63) 38 Osc 2 FM 39 Osc 2 Shape (0-5) (Pulse,Saw,Tri,Sine,Alt 1,Alt 2) 40 Osc 2 PW 41 Osc 2 PWM (0-127) (-64-63) 42 Osc 3 Octave (16,28,40-112) (128'-1/2') 43 Osc 3 Semitone (52-76) (-12-+12) 44 Osc 3 Detune (0-127) (-64-63) 45 Osc 3 FM 46 Osc 3 Shape (0-5) (Pulse,Saw,Tri,Sine,Alt 1,Alt 2) 47 Osc 3 PW 48 Osc 3 PWM (0-127) (-64-63) 49 Sync (0-1) (Off,On) 50 Pitchmod (0-127) (-64-63) 51 Glide Mode (0-9) 52 Osc 1 Level 53 Osc 1 Balance (0-127) (F1-mid-F2) 54 Ringmod Level 55 Ringmod Balance (0-127) (F1-mid-F2) 56 Osc 2 Level 57 Osc 2 Balance (0-127) (F1-mid-F2) 58 Osc 3 Level 59 Osc 3 Balance (0-127) (F1-mid-F2) 60 Noise/External Level 61 Noise/External Balance (0-127) (F1-mid-F2) 62 63 64 Sustain Pedal 65 Glide Active (0-1) (Off,On) 66 Sostenuto (0-1) (Off,On) 67 Routing (0-1) (Serial,Parallel) 68 Filter 1 Type (0-10) 69 Filter 1 Cutoff 70 Filter 1 Resonance 71 Filter 1 Drive 72 Filter 1 Keytrack (0-127) (-200-197) 73 Filter 1 Env Amount (0-127) (-64-63) 74 Filter 1 Env Velocity (0-127) (-64-63) 75 Filter 1 Cutoff Mod (0-127) (-64-63) 76 Filter 1 FM (0-127) (Off,1-127) 77 Filter 1 Pan (0-127) (L-mid-R) 78 Filter 1 Pan Mod (0-127) (-64-63) 79 Filter 2 Type (0-10) 80 Filter 2 Cutoff 81 Filter 2 Resonance 82 Filter 2 Drive 83 Filter 2 Keytrack (0-127) (-200-197) 84 Filter 2 Env Amount (0-127) (-64-63) 85 Filter 2 Env Velocity (0-127) (-64-63) 86 Filter 2 Cutoff Mod (0-127) (-64-63) 87 Filter 2 FM (0-127) (Off,1-127) 88 Filter 2 Pan (0-127) (L-mid-R) 89 Filter 2 Pan Mod (0-127) (-64-63) 90 Amp Volume 91 Amp Velocity (0-127) (-64-63) 92 Amp Mod (0-127) (-64-63) 93 FX 1 Mix 94 FX 2 Mix 95 Filter Env Attack 96 Filter Env Decay 97 Filter Env Sustain 98 Filter Env Decay 2 99 Filter Env Sustain 2 100 Filter Env Release 101 Amp Env Attack 102 Amp Env Decay 103 Amp Env Sustain 104 Amp Env Decay 2 105 Amp Env Sustain 2 106 Amp Env Release 107 Env 3 Attack 108 Env 3 Decay 109 Env 3 Sustain 110 Env 3 Decay 2 111 Env 3 Sustain 2 112 Env 3 Release 113 Env 4 Attack 114 Env 4 Decay 115 Env 4 Sustain 116 Env 4 Decay 2 117 Env 4 Sustain 2 118 Env 4 Release 119 120 All Sound Off (0) 121 Reset All Controllers (0) 122 Local Control (0-127) (Off,On) 123 All Notes Off (0) 124 125 126 127 [user-instrument-1] #name SuperNova # midi controllers 128 0 Bank Select MSB 1 Modulation Wheel 2 Breath Controller 3 Arp Pattern Select 4 Ring Modulator 2 * 3 Mix Level 5 Portamento Time 6 Data Entry 7 Part / Program Volume 8 Effects Confg Morph Amount 9 Arp Speed (Internal Clock Rate) [*] 10 Pan 11 Osc 1 Fine Tune 12 Osc 3 Fine Tune 13 Osc 1 Soften 14 Osc 2 Soften 15 Osc 3 Soften 16 LFO 1 Speed 17 LFO 1 Delay 18 LFO 2 Speed 19 LFO 2 Delay 20 Osc 1 Pitch Env 2 21 Osc 1 Pitch LFO 1 22 Osc 1 Pulse Width 23 Osc 2 Fine Tune 24 Noise Soften 25 Osc 2 Pitch Env 2 26 Osc 2 Pitch LFO 1 27 Osc 2 Pulse Width 28 Osc 1 Mix Level 29 Osc 2 Mix Level 30 Noise Mix Level 31 Ring Modulator 1 * 3 Mix Level 32 Bank Select LSB 33 Osc 3 Mix Level 34 Filter Tracking 35 Filter Freq LFO 2 36 Osc 1 Mix Env 2 37 Osc 2 Mix Env 2 38 Osc 3 Mix Env 2 39 Noise Mix Env 2 40 Osc 3 Pitch Env 2 41 Osc 3 Pitch LFO 1 42 Osc 3 Pulse Width 43 Osc 1 Width Env 2 44 Osc 2 Width Env 2 45 Osc 3 Width Env 2 46 Osc 1 Width LFO 1 47 Osc 2 Width LFO 1 48 Osc 3 Width LFO 1 49 Osc 1 Sync 50 Osc 2 Sync 51 Osc 3 Sync 52 Osc 1 Sync Env 2 53 Osc 2 Sync Env 2 54 Osc 3 Sync Env 2 55 Osc 1 Sync LFO 1 56 Osc 2 Sync LFO 1 57 Osc 3 Sync LFO 1 58 Distortion Mod Wheel Depth 59 Filter Freq Env 3 60 Filter Freq LFO 1 61 Osc 1 Soften Env 2 62 Osc 2 Soften Env 2 63 Osc 3 Soften Env 2 64 Sustain / Arp Latch 65 Arp Latch 66 Osc 1 Pitch Env 3 67 Osc 2 Pitch Env 3 68 Osc 3 Pitch Env 3 69 Osc 1 Width LFO 2 70 Osc 2 Width LFO 2 71 Osc 3 Width LFO 2 72 Filter Res Env 2 73 Filter Res LFO 1 74 Env 3 Delay 75 Env 3 Attack 76 Env 3 Decay 77 Env 3 Sustain 78 Env 3 Release 79 Env 3 Velocity 80 LFO 1 Speed Env 3 81 LFO 2 Speed Env 3 82 LFO 1 Offset 83 LFO 2 Offset 84 Reverb Mod Wheel Depth 85 Filter Res Env 3 86 Filter Res LFO 2 87 Chorus Speed 88 Chorus Mod Depth 89 Chorus Feedback 90 Distortion Level 91 Reverb Send Level 92 Delay Send Level 93 Chorus Send Level 94 Chorus Mod Wheel Depth 95 Reverb Decay 96 Reverb HF Damp 97 Master Volume Level [*] 98 NRPN Select LSB 99 NRPN Select MSB 100 Reverb Type / Early Ref Level [**] 101 Delay Time 102 Delay Feedback 103 Delay HF Damp 104 Filter Overdrive 105 Filter Cutoff Freq 106 Filter Resonance 107 Filter Freq Env 2 108 Env 1 Attack 109 Env 1 Decay 110 Env 1 Sustain 111 Env 1 Release 112 Env 1 Velocity 113 Env 2 Delay 114 Env 2 Attack 115 Env 2 Decay 116 Env 2 Sustain 117 Env 2 Release 118 Env 2 Velocity 119 Delay Mod Wheel Depth 120 All Sound Off 121 Reset Controllers 122 Local Control [*] 123 All Notes Off 124 All Notes Off 125 All Notes Off 126 All Notes Off 127 All Notes Off [user-instrument-2] #name DrumStation # midi controllers 92 20 808 Bass Drum Front cut 21 808 Bass Drum Pan 22 808 Bass Drum Distortion 23 808 Bass Drum Tune 24 808 Bass Drum Tone 25 808 Bass Drum Decay 26 808 Snare Drum Front cut 27 808 Snare Drum Pan 28 808 Snare Drum Distortion 29 808 Snare Drum Tune 30 808 Snare Drum Tone 31 808 Snare Drum Snappy 32 808 Low Tom Front cut 33 808 Low Tom Pan 34 808 Low Tom Distortion 35 808 Low Tom Tune 36 808 Low Tom Decay 37 808 Mid Tom Front cut 38 808 Mid Tom Pan 43 808 Mid Tom Pan 44 808 Mid Tom Distortion 45 808 Mid Tom Tune 46 808 Mid Tom Decay 47 808 Rim Shot Pan 48 808 Rim Shot Tune 49 808 Hand Clap Pan 50 808 Hand Clap Tune 51 808 Cowbell Pan 52 808 Cowbell Distortion 53 808 Cowbell Tune 54 808 Closed HiHat Pan 55 808 Closed HiHat Tune 56 808 Closed HiHat Decay 57 808 Open HiHat Pan 58 808 Open HiHat Tune 59 808 Open HiHat Decay 60 808 Crash Cymbal Pan 65 808 Crash Cymbal Tune 66 808 Mid Conga Pan 67 808 Mid Conga Distortion 68 808 Mid Conga Tune 69 808 High Conga Pan 70 808 High Conga Distortion 71 808 High Conga Tune 72 808 Maracas Pan 73 808 Maracas Tune 74 808 Claves Pan 75 808 Claves Tune 76 909 Bass Drum Tune 77 909 Bass Drum Attack 78 909 Bass Drum Decay 79 909 Snare Drum Tune 80 909 Snare Drum Tone 81 909 Snare Drum Snappy 82 909 Low Tom Front cut 83 909 Low Tom Pan 84 909 Low Tom Distortion 85 909 Low Tom Tune 86 909 Low Tom Decay 87 909 Mid Tom Front cut 88 909 Mid Tom Pan 89 909 Mid Tom Distortion 90 909 Mid Tom Tune 91 909 Mid Tom Decay 92 909 High Tom Front cut 93 909 High Tom Pan 94 909 High Tom Distortion 95 909 High Tom Tune 96 909 High Tom Decay 97 909 Rim Shot Pan 98 909 Rim Shot Tune 99 909 Rim Shot Hand Clap Pan 100 909 Rim Shot Tune 101 909 Closed HiHat Distortion 102 909 Closed HiHat Tune 103 909 Closed HiHat Decay 104 909 Open HiHat Tune 105 909 Bass Drum Front cut 106 909 Bass Drum Pan 107 909 Bass Drum Distortion 108 909 Snare Drum Front cut 109 909 Snare Drum Pan 110 909 Snare Drum Distortion 111 909 Closed HiHat Pan 112 909 Open HiHat Pan 113 909 Open HiHat Decay 114 909 Crash Cymbal Pan 115 909 Crash Cymbal Tune 116 909 Crash Cymbal Decay 117 909 Ride Cymbal Pan 118 909 Ride Cymbal Tune 119 909 Ride Cymbal Decay [user-instrument-3] #name TX81Z # midi controllers 0 [user-instrument-4] #name WaveStation # midi controllers 0 [user-instrument-5] #name ESI-2000 # midi controllers 0 [user-instrument-6] #name ES-1 # midi controllers 0 [user-instrument-7] #name ER-1 # midi controllers 0 [user-instrument-8] #name TB-303 # midi controllers 0 seq24-0.9.3/install-sh0000755000175000017500000003325512321053731011413 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-11-20.07; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: seq24-0.9.3/COPYING0000644000175000017500000003550411060731321010436 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330 Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS seq24-0.9.3/configure0000755000175000017500000066114512651206573011335 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for seq24 0.9.3. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: seq24-devel@lists.sourceforge.net about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='seq24' PACKAGE_TARNAME='seq24' PACKAGE_VERSION='0.9.3' PACKAGE_STRING='seq24 0.9.3' PACKAGE_BUGREPORT='seq24-devel@lists.sourceforge.net' PACKAGE_URL='' ac_unique_file="src/event.cpp" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS LASH_LIBS LASH_CFLAGS JACK_LIBS JACK_CFLAGS GTKMM_LIBS GTKMM_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG ALSA_LIBS ALSA_CFLAGS EGREP GREP CPP HAVE_CXX11 LN_S am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE ac_ct_CXX CXXFLAGS CXX am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_dependency_tracking enable_as_needed with_alsa_prefix with_alsa_inc_prefix enable_alsatest enable_jack enable_jack_session enable_lash ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CXX CXXFLAGS CCC CPP PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR GTKMM_CFLAGS GTKMM_LIBS JACK_CFLAGS JACK_LIBS LASH_CFLAGS LASH_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= 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=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -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_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$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 ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$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 | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$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 ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) 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 | -n) 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 ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$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_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=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 ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # 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 the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` 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 test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # 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 <<_ACEOF \`configure' configures seq24 0.9.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/seq24] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --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 _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of seq24 0.9.3:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --enable-as-needed Enable linker option -Wl,--as-needed (default=yes) --disable-alsatest Do not try to compile and run a test Alsa program --disable-jack Disable JACK support --disable-jack-session Disable JACK session support --disable-lash Disable LASH support Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-alsa-prefix=PFX Prefix where Alsa library is installed(optional) --with-alsa-inc-prefix=PFX Prefix where include libraries are (optional) Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CXX C++ compiler command CXXFLAGS C++ compiler flags CPP C preprocessor PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path GTKMM_CFLAGS C compiler flags for GTKMM, overriding pkg-config GTKMM_LIBS linker flags for GTKMM, overriding pkg-config JACK_CFLAGS C compiler flags for JACK, overriding pkg-config JACK_LIBS linker flags for JACK, overriding pkg-config LASH_CFLAGS C compiler flags for LASH, overriding pkg-config LASH_LIBS linker flags for LASH, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF seq24 configure 0.9.3 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## ------------------------------------------------ ## ## Report this to seq24-devel@lists.sourceforge.net ## ## ------------------------------------------------ ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by seq24 $as_me 0.9.3, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers src/config.h" am__api_version='1.14' 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 elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # 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 # AmigaOS /C/install, which installs bootblocks on floppy discs # 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" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /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 for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir 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. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&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}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='seq24' VERSION='0.9.3' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi $as_echo "#define _GNU_SOURCE 1" >>confdefs.h for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_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 $# != 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 ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CXX_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi ax_cxx_compile_cxx11_required=true ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_success=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features by default" >&5 $as_echo_n "checking whether $CXX supports C++11 features by default... " >&6; } if ${ax_cv_cxx_compile_cxx11+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ // If the compiler admits that it is not ready for C++11, why torture it? // Hopefully, this will speed up the test. #ifndef __cplusplus #error "This is not a C++ compiler" #elif __cplusplus < 201103L #error "This is not a C++11 compiler" #else namespace cxx11 { namespace test_static_assert { template struct check { static_assert(sizeof(int) <= sizeof(T), "not big enough"); }; } namespace test_final_override { struct Base { virtual void f() {} }; struct Derived : public Base { virtual void f() override {} }; } namespace test_double_right_angle_brackets { template < typename T > struct check {}; typedef check single_type; typedef check> double_type; typedef check>> triple_type; typedef check>>> quadruple_type; } namespace test_decltype { int f() { int a = 1; decltype(a) b = 2; return a + b; } } namespace test_type_deduction { template < typename T1, typename T2 > struct is_same { static const bool value = false; }; template < typename T > struct is_same { static const bool value = true; }; template < typename T1, typename T2 > auto add(T1 a1, T2 a2) -> decltype(a1 + a2) { return a1 + a2; } int test(const int c, volatile int v) { static_assert(is_same::value == true, ""); static_assert(is_same::value == false, ""); static_assert(is_same::value == false, ""); auto ac = c; auto av = v; auto sumi = ac + av + 'x'; auto sumf = ac + av + 1.0; static_assert(is_same::value == true, ""); static_assert(is_same::value == true, ""); static_assert(is_same::value == true, ""); static_assert(is_same::value == false, ""); static_assert(is_same::value == true, ""); return (sumf > 0.0) ? sumi : add(c, v); } } namespace test_noexcept { int f() { return 0; } int g() noexcept { return 0; } static_assert(noexcept(f()) == false, ""); static_assert(noexcept(g()) == true, ""); } namespace test_constexpr { template < typename CharT > unsigned long constexpr strlen_c_r(const CharT *const s, const unsigned long acc) noexcept { return *s ? strlen_c_r(s + 1, acc + 1) : acc; } template < typename CharT > unsigned long constexpr strlen_c(const CharT *const s) noexcept { return strlen_c_r(s, 0UL); } static_assert(strlen_c("") == 0UL, ""); static_assert(strlen_c("1") == 1UL, ""); static_assert(strlen_c("example") == 7UL, ""); static_assert(strlen_c("another\0example") == 7UL, ""); } namespace test_rvalue_references { template < int N > struct answer { static constexpr int value = N; }; answer<1> f(int&) { return answer<1>(); } answer<2> f(const int&) { return answer<2>(); } answer<3> f(int&&) { return answer<3>(); } void test() { int i = 0; const int c = 0; static_assert(decltype(f(i))::value == 1, ""); static_assert(decltype(f(c))::value == 2, ""); static_assert(decltype(f(0))::value == 3, ""); } } namespace test_uniform_initialization { struct test { static const int zero {}; static const int one {1}; }; static_assert(test::zero == 0, ""); static_assert(test::one == 1, ""); } namespace test_lambdas { void test1() { auto lambda1 = [](){}; auto lambda2 = lambda1; lambda1(); lambda2(); } int test2() { auto a = [](int i, int j){ return i + j; }(1, 2); auto b = []() -> int { return '0'; }(); auto c = [=](){ return a + b; }(); auto d = [&](){ return c; }(); auto e = [a, &b](int x) mutable { const auto identity = [](int y){ return y; }; for (auto i = 0; i < a; ++i) a += b--; return x + identity(a + b); }(0); return a + b + c + d + e; } int test3() { const auto nullary = [](){ return 0; }; const auto unary = [](int x){ return x; }; using nullary_t = decltype(nullary); using unary_t = decltype(unary); const auto higher1st = [](nullary_t f){ return f(); }; const auto higher2nd = [unary](nullary_t f1){ return [unary, f1](unary_t f2){ return f2(unary(f1())); }; }; return higher1st(nullary) + higher2nd(nullary)(unary); } } namespace test_variadic_templates { template struct sum; template struct sum { static constexpr auto value = N0 + sum::value; }; template <> struct sum<> { static constexpr auto value = 0; }; static_assert(sum<>::value == 0, ""); static_assert(sum<1>::value == 1, ""); static_assert(sum<23>::value == 23, ""); static_assert(sum<1, 2>::value == 3, ""); static_assert(sum<5, 5, 11>::value == 21, ""); static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); } // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function // because of this. namespace test_template_alias_sfinae { struct foo {}; template using member = typename T::member_type; template void func(...) {} template void func(member*) {} void test(); void test() { func(0); } } } // namespace cxx11 #endif // __cplusplus >= 201103L _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ax_cv_cxx_compile_cxx11=yes else ax_cv_cxx_compile_cxx11=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx11" >&5 $as_echo "$ax_cv_cxx_compile_cxx11" >&6; } if test x$ax_cv_cxx_compile_cxx11 = xyes; then ac_success=yes fi if test x$ac_success = xno; then for switch in -std=c++11 -std=c++0x +std=c++11 "-h std=c++11"; do cachevar=`$as_echo "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5 $as_echo_n "checking whether $CXX supports C++11 features with $switch... " >&6; } if eval \${$cachevar+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS $switch" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ // If the compiler admits that it is not ready for C++11, why torture it? // Hopefully, this will speed up the test. #ifndef __cplusplus #error "This is not a C++ compiler" #elif __cplusplus < 201103L #error "This is not a C++11 compiler" #else namespace cxx11 { namespace test_static_assert { template struct check { static_assert(sizeof(int) <= sizeof(T), "not big enough"); }; } namespace test_final_override { struct Base { virtual void f() {} }; struct Derived : public Base { virtual void f() override {} }; } namespace test_double_right_angle_brackets { template < typename T > struct check {}; typedef check single_type; typedef check> double_type; typedef check>> triple_type; typedef check>>> quadruple_type; } namespace test_decltype { int f() { int a = 1; decltype(a) b = 2; return a + b; } } namespace test_type_deduction { template < typename T1, typename T2 > struct is_same { static const bool value = false; }; template < typename T > struct is_same { static const bool value = true; }; template < typename T1, typename T2 > auto add(T1 a1, T2 a2) -> decltype(a1 + a2) { return a1 + a2; } int test(const int c, volatile int v) { static_assert(is_same::value == true, ""); static_assert(is_same::value == false, ""); static_assert(is_same::value == false, ""); auto ac = c; auto av = v; auto sumi = ac + av + 'x'; auto sumf = ac + av + 1.0; static_assert(is_same::value == true, ""); static_assert(is_same::value == true, ""); static_assert(is_same::value == true, ""); static_assert(is_same::value == false, ""); static_assert(is_same::value == true, ""); return (sumf > 0.0) ? sumi : add(c, v); } } namespace test_noexcept { int f() { return 0; } int g() noexcept { return 0; } static_assert(noexcept(f()) == false, ""); static_assert(noexcept(g()) == true, ""); } namespace test_constexpr { template < typename CharT > unsigned long constexpr strlen_c_r(const CharT *const s, const unsigned long acc) noexcept { return *s ? strlen_c_r(s + 1, acc + 1) : acc; } template < typename CharT > unsigned long constexpr strlen_c(const CharT *const s) noexcept { return strlen_c_r(s, 0UL); } static_assert(strlen_c("") == 0UL, ""); static_assert(strlen_c("1") == 1UL, ""); static_assert(strlen_c("example") == 7UL, ""); static_assert(strlen_c("another\0example") == 7UL, ""); } namespace test_rvalue_references { template < int N > struct answer { static constexpr int value = N; }; answer<1> f(int&) { return answer<1>(); } answer<2> f(const int&) { return answer<2>(); } answer<3> f(int&&) { return answer<3>(); } void test() { int i = 0; const int c = 0; static_assert(decltype(f(i))::value == 1, ""); static_assert(decltype(f(c))::value == 2, ""); static_assert(decltype(f(0))::value == 3, ""); } } namespace test_uniform_initialization { struct test { static const int zero {}; static const int one {1}; }; static_assert(test::zero == 0, ""); static_assert(test::one == 1, ""); } namespace test_lambdas { void test1() { auto lambda1 = [](){}; auto lambda2 = lambda1; lambda1(); lambda2(); } int test2() { auto a = [](int i, int j){ return i + j; }(1, 2); auto b = []() -> int { return '0'; }(); auto c = [=](){ return a + b; }(); auto d = [&](){ return c; }(); auto e = [a, &b](int x) mutable { const auto identity = [](int y){ return y; }; for (auto i = 0; i < a; ++i) a += b--; return x + identity(a + b); }(0); return a + b + c + d + e; } int test3() { const auto nullary = [](){ return 0; }; const auto unary = [](int x){ return x; }; using nullary_t = decltype(nullary); using unary_t = decltype(unary); const auto higher1st = [](nullary_t f){ return f(); }; const auto higher2nd = [unary](nullary_t f1){ return [unary, f1](unary_t f2){ return f2(unary(f1())); }; }; return higher1st(nullary) + higher2nd(nullary)(unary); } } namespace test_variadic_templates { template struct sum; template struct sum { static constexpr auto value = N0 + sum::value; }; template <> struct sum<> { static constexpr auto value = 0; }; static_assert(sum<>::value == 0, ""); static_assert(sum<1>::value == 1, ""); static_assert(sum<23>::value == 23, ""); static_assert(sum<1, 2>::value == 3, ""); static_assert(sum<5, 5, 11>::value == 21, ""); static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); } // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function // because of this. namespace test_template_alias_sfinae { struct foo {}; template using member = typename T::member_type; template void func(...) {} template void func(member*) {} void test(); void test() { func(0); } } } // namespace cxx11 #endif // __cplusplus >= 201103L _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : eval $cachevar=yes else eval $cachevar=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CXXFLAGS="$ac_save_CXXFLAGS" fi eval ac_res=\$$cachevar { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test x\$$cachevar = xyes; then CXXFLAGS="$CXXFLAGS $switch" ac_success=yes break fi done fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test x$ax_cxx_compile_cxx11_required = xtrue; then if test x$ac_success = xno; then as_fn_error $? "*** A compiler with support for C++11 language features is required." "$LINENO" 5 fi else if test x$ac_success = xno; then HAVE_CXX11=0 { $as_echo "$as_me:${as_lineno-$LINENO}: No compiler with C++11 support was found" >&5 $as_echo "$as_me: No compiler with C++11 support was found" >&6;} else HAVE_CXX11=1 $as_echo "#define HAVE_CXX11 1" >>confdefs.h fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if --as-needed works" >&5 $as_echo_n "checking if --as-needed works... " >&6; } # Check whether --enable-as_needed was given. if test "${enable_as_needed+set}" = set; then : enableval=$enable_as_needed; case "${enableval}" in yes) as_needed="1";; no) as_needed="";; *) as_fn_error $? "bad value ${enableval} for --enable-as_needed" "$LINENO" 5;; esac else as_needed="unknown" fi if test x"${as_needed}" = x"unknown"; then ac_old_ldflags="${LDFLAGS}" LDFLAGS="-Wl,--as-needed" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : as_needed="1" else as_needed="" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="${ac_old_ldflags}" fi if test -n "$as_needed"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } LDFLAGS="${LDFLAGS} -Wl,--as-needed" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lrt" >&5 $as_echo_n "checking for main in -lrt... " >&6; } if ${ac_cv_lib_rt_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lrt $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_rt_main=yes else ac_cv_lib_rt_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_main" >&5 $as_echo "$ac_cv_lib_rt_main" >&6; } if test "x$ac_cv_lib_rt_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBRT 1 _ACEOF LIBS="-lrt $LIBS" else as_fn_error $? "POSIX.1b RealTime Library Missing -lrt" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _init in -lgtkmm-2.4" >&5 $as_echo_n "checking for _init in -lgtkmm-2.4... " >&6; } if ${ac_cv_lib_gtkmm_2_4__init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgtkmm-2.4 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char _init (); int main () { return _init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_gtkmm_2_4__init=yes else ac_cv_lib_gtkmm_2_4__init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gtkmm_2_4__init" >&5 $as_echo "$ac_cv_lib_gtkmm_2_4__init" >&6; } if test "x$ac_cv_lib_gtkmm_2_4__init" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBGTKMM_2_4 1 _ACEOF LIBS="-lgtkmm-2.4 $LIBS" else as_fn_error $? "Essential library libgtkmm-2.4 not found" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lsigc-2.0" >&5 $as_echo_n "checking for main in -lsigc-2.0... " >&6; } if ${ac_cv_lib_sigc_2_0_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsigc-2.0 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_sigc_2_0_main=yes else ac_cv_lib_sigc_2_0_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sigc_2_0_main" >&5 $as_echo "$ac_cv_lib_sigc_2_0_main" >&6; } if test "x$ac_cv_lib_sigc_2_0_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSIGC_2_0 1 _ACEOF LIBS="-lsigc-2.0 $LIBS" else as_fn_error $? "Essential library libsigc++-2.0 not found" "$LINENO" 5 fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #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)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in getopt.h do : ac_fn_c_check_header_mongrel "$LINENO" "getopt.h" "ac_cv_header_getopt_h" "$ac_includes_default" if test "x$ac_cv_header_getopt_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GETOPT_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this sort of thing. */ char tx; char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi alsa_save_CFLAGS="$CFLAGS" alsa_save_LDFLAGS="$LDFLAGS" alsa_save_LIBS="$LIBS" alsa_found=yes # Check whether --with-alsa-prefix was given. if test "${with_alsa_prefix+set}" = set; then : withval=$with_alsa_prefix; alsa_prefix="$withval" else alsa_prefix="" fi # Check whether --with-alsa-inc-prefix was given. if test "${with_alsa_inc_prefix+set}" = set; then : withval=$with_alsa_inc_prefix; alsa_inc_prefix="$withval" else alsa_inc_prefix="" fi # Check whether --enable-alsatest was given. if test "${enable_alsatest+set}" = set; then : enableval=$enable_alsatest; enable_alsatest="$enableval" else enable_alsatest=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ALSA CFLAGS" >&5 $as_echo_n "checking for ALSA CFLAGS... " >&6; } if test "$alsa_inc_prefix" != "" ; then ALSA_CFLAGS="$ALSA_CFLAGS -I$alsa_inc_prefix" CFLAGS="$CFLAGS -I$alsa_inc_prefix" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ALSA_CFLAGS" >&5 $as_echo "$ALSA_CFLAGS" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ALSA LDFLAGS" >&5 $as_echo_n "checking for ALSA LDFLAGS... " >&6; } if test "$alsa_prefix" != "" ; then ALSA_LIBS="$ALSA_LIBS -L$alsa_prefix" LDFLAGS="$LDFLAGS $ALSA_LIBS" fi ALSA_LIBS="$ALSA_LIBS -lasound -lm -ldl -lpthread" LIBS="$ALSA_LIBS $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ALSA_LIBS" >&5 $as_echo "$ALSA_LIBS" >&6; } if test "x$enable_alsatest" = "xyes"; then min_alsa_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libasound headers version >= $min_alsa_version" >&5 $as_echo_n "checking for libasound headers version >= $min_alsa_version... " >&6; } no_alsa="" alsa_min_major_version=`echo $min_alsa_version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` alsa_min_minor_version=`echo $min_alsa_version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` alsa_min_micro_version=`echo $min_alsa_version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { /* ensure backward compatibility */ #if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR) #define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR #endif #if !defined(SND_LIB_MINOR) && defined(SOUNDLIB_VERSION_MINOR) #define SND_LIB_MINOR SOUNDLIB_VERSION_MINOR #endif #if !defined(SND_LIB_SUBMINOR) && defined(SOUNDLIB_VERSION_SUBMINOR) #define SND_LIB_SUBMINOR SOUNDLIB_VERSION_SUBMINOR #endif # if(SND_LIB_MAJOR > $alsa_min_major_version) exit(0); # else # if(SND_LIB_MAJOR < $alsa_min_major_version) # error not present # endif # if(SND_LIB_MINOR > $alsa_min_minor_version) exit(0); # else # if(SND_LIB_MINOR < $alsa_min_minor_version) # error not present # endif # if(SND_LIB_SUBMINOR < $alsa_min_micro_version) # error not present # endif # endif # endif exit(0); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: found." >&5 $as_echo "found." >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not present." >&5 $as_echo "not present." >&6; } as_fn_error $? "Sufficiently new version of libasound not found." "$LINENO" 5 alsa_found=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi if test "x$enable_alsatest" = "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for snd_ctl_open in -lasound" >&5 $as_echo_n "checking for snd_ctl_open in -lasound... " >&6; } if ${ac_cv_lib_asound_snd_ctl_open+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lasound $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char snd_ctl_open (); int main () { return snd_ctl_open (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_asound_snd_ctl_open=yes else ac_cv_lib_asound_snd_ctl_open=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_asound_snd_ctl_open" >&5 $as_echo "$ac_cv_lib_asound_snd_ctl_open" >&6; } if test "x$ac_cv_lib_asound_snd_ctl_open" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBASOUND 1 _ACEOF LIBS="-lasound $LIBS" else as_fn_error $? "No linkable libasound was found." "$LINENO" 5 alsa_found=no fi fi if test "x$alsa_found" = "xyes" ; then : LIBS=`echo $LIBS | sed 's/-lasound//g'` LIBS=`echo $LIBS | sed 's/ //'` LIBS="-lasound $LIBS" fi if test "x$alsa_found" = "xno" ; then : CFLAGS="$alsa_save_CFLAGS" LDFLAGS="$alsa_save_LDFLAGS" LIBS="$alsa_save_LIBS" ALSA_CFLAGS="" ALSA_LIBS="" fi if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTKMM" >&5 $as_echo_n "checking for GTKMM... " >&6; } if test -n "$GTKMM_CFLAGS"; then pkg_cv_GTKMM_CFLAGS="$GTKMM_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtkmm-2.4 >= 2.4.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "gtkmm-2.4 >= 2.4.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GTKMM_CFLAGS=`$PKG_CONFIG --cflags "gtkmm-2.4 >= 2.4.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GTKMM_LIBS"; then pkg_cv_GTKMM_LIBS="$GTKMM_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtkmm-2.4 >= 2.4.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "gtkmm-2.4 >= 2.4.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GTKMM_LIBS=`$PKG_CONFIG --libs "gtkmm-2.4 >= 2.4.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GTKMM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gtkmm-2.4 >= 2.4.0" 2>&1` else GTKMM_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gtkmm-2.4 >= 2.4.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GTKMM_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (gtkmm-2.4 >= 2.4.0) were not met: $GTKMM_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables GTKMM_CFLAGS and GTKMM_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables GTKMM_CFLAGS and GTKMM_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else GTKMM_CFLAGS=$pkg_cv_GTKMM_CFLAGS GTKMM_LIBS=$pkg_cv_GTKMM_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi # Check whether --enable-jack was given. if test "${enable_jack+set}" = set; then : enableval=$enable_jack; jack=$enableval else jack=yes fi # Check whether --enable-jack-session was given. if test "${enable_jack_session+set}" = set; then : enableval=$enable_jack_session; jack_session=$enableval else jack_session=yes fi if test "$jack" != "no"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JACK" >&5 $as_echo_n "checking for JACK... " >&6; } if test -n "$JACK_CFLAGS"; then pkg_cv_JACK_CFLAGS="$JACK_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"jack >= 0.90.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "jack >= 0.90.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_JACK_CFLAGS=`$PKG_CONFIG --cflags "jack >= 0.90.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$JACK_LIBS"; then pkg_cv_JACK_LIBS="$JACK_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"jack >= 0.90.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "jack >= 0.90.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_JACK_LIBS=`$PKG_CONFIG --libs "jack >= 0.90.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then JACK_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "jack >= 0.90.0" 2>&1` else JACK_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "jack >= 0.90.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$JACK_PKG_ERRORS" >&5 jack_found="no" elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } jack_found="no" else JACK_CFLAGS=$pkg_cv_JACK_CFLAGS JACK_LIBS=$pkg_cv_JACK_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } jack_found="yes" fi if test "$jack_found" = "yes"; then $as_echo "#define JACK_SUPPORT 1" >>confdefs.h if test "$jack_session" != "no"; then ac_fn_c_check_header_mongrel "$LINENO" "jack/session.h" "ac_cv_header_jack_session_h" "$ac_includes_default" if test "x$ac_cv_header_jack_session_h" = xyes; then : jack_session_found="yes" else jack_session_found="no" fi if test "$jack_session_found" = "yes"; then $as_echo "#define JACK_SESSION 1" >>confdefs.h fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Could not find JACK library, disabling JACK support" >&5 $as_echo "$as_me: WARNING: *** Could not find JACK library, disabling JACK support" >&2;} fi else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** JACK support not enabled." >&5 $as_echo "$as_me: WARNING: *** JACK support not enabled." >&2;}; fi # Check whether --enable-lash was given. if test "${enable_lash+set}" = set; then : enableval=$enable_lash; lash=$enableval else lash=yes fi if test "$lash" != "no"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LASH" >&5 $as_echo_n "checking for LASH... " >&6; } if test -n "$LASH_CFLAGS"; then pkg_cv_LASH_CFLAGS="$LASH_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lash-1.0 >= 0.5.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "lash-1.0 >= 0.5.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LASH_CFLAGS=`$PKG_CONFIG --cflags "lash-1.0 >= 0.5.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LASH_LIBS"; then pkg_cv_LASH_LIBS="$LASH_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lash-1.0 >= 0.5.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "lash-1.0 >= 0.5.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LASH_LIBS=`$PKG_CONFIG --libs "lash-1.0 >= 0.5.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LASH_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "lash-1.0 >= 0.5.0" 2>&1` else LASH_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "lash-1.0 >= 0.5.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LASH_PKG_ERRORS" >&5 lash_found="no" elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } lash_found="no" else LASH_CFLAGS=$pkg_cv_LASH_CFLAGS LASH_LIBS=$pkg_cv_LASH_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } lash_found="yes" fi if test "$lash_found" = "yes"; then $as_echo "#define LASH_SUPPORT 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** LASH not found, session support will not be built." >&5 $as_echo "$as_me: WARNING: *** LASH not found, session support will not be built." >&2;} fi else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** LASH support not enabled." >&5 $as_echo "$as_me: WARNING: *** LASH support not enabled." >&2;}; fi ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF # 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, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # 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. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by seq24 $as_me 0.9.3, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ seq24 config.status 0.9.3 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #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. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi seq24-0.9.3/README0000644000175000017500000000074211721751132010265 00000000000000seq24 README ------------ How to install? read INSTALL. How to use seq24? Documentation on using seq24 is in the SEQ24 file. Information on modifying, copying? This software is free, and released under the GPL. This is available in the COPYING file. Who wrote this? Read AUTHORS. Why did they write this? Again, Read SEQ24 What to do with a fresh repository checkout? Apply "autoreconf -i" to get a configure script, then read INSTALL. seq24-0.9.3/man/0000755000175000017500000000000012651206575010246 500000000000000seq24-0.9.3/man/seq24.10000644000175000017500000000407011473011056011174 00000000000000.TH Seq24 1 "November 20 2010" "Version 0.9.2" "Seq24 Manual Page" .SH NAME Seq24 - Real time MIDI sequencer .SH SYNOPSIS .B seq24 [\fIOPTIONS\fP] [\fIFILENAME\fP] .SH DESCRIPTION .PP \fISeq24\fP is a real-time midi sequencer. It was created to provide a very simple interface for editing and playing midi 'loops'. .SH OPTIONS Seq24 accepts the following options: .TP 8 .B \-\-help Display a list of all commandline options .TP 8 .B \-\-version Display the program version .TP 8 .B \-\-file \fI\fP Load MIDI file on startup .TP 8 .B \-\-manual_alsa_ports Seq24 won't attach alsa ports .TP 8 .B \-\-showmidi Dumps incoming midi to screen .TP 8 .B \-\-priority Runs higher priority with FIFO scheduler .TP 8 .B \-\-pass_sysex Passes any incoming sysex messages to all outputs .TP 8 .B \-\-ignore \fI\fP Ignore ALSA device .TP 8 .B \-\-show_keys Prints pressed key value .TP 8 .B \-\-interaction_method \fI\fP Select mouse interaction method (0 = seq24) (default) (1 = fruity loops method) .TP 8 .B \-\-jack_transport seq24 will sync to JACK transport .TP 8 .B \-\-jack_master seq24 will try to be JACK master .TP 8 .B \-\-jack_master_cond JACK master will fail if there is already a master .TP 8 .B \-\-jack_start_mode \fI\fP When seq24 is synced to JACK, the following play modes are available: (0 = live mode) (1 = song mode) (default) .TP 8 .B \-\-stats Print statistics on commandline while running .TP 8 .B \-\-jack_session_uuid \fI\fP Set uuid for jack session .SH FILES \fB$HOME\fP/.seq24rc stores the user settings for seq24. .SH SUGGESTIONS AND BUG REPORTS Any bugs found should be reported to the upstream author and/or package maintainer. .SH OTHER INFO The old project homepage is at http://www.filter24.org/seq24/ the new one is at https://edge.launchpad.net/seq24/. It is released under the GNU GPL license. .SH AUTHOR Seq24 was written by Rob C. Buse and the Seq24team. This manual page was written by Dana Olson with additions from Guido Scholz . seq24-0.9.3/man/Module.am0000644000175000017500000000006612321053573011724 00000000000000# Makefile.am for seq24 dist_man_MANS = man/seq24.1 seq24-0.9.3/missing0000755000175000017500000001533112321053731011001 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2012-06-26.16; # UTC # Copyright (C) 1996-2013 Free Software Foundation, Inc. # Originally written 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, see . # 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 case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'automa4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: seq24-0.9.3/aclocal.m40000644000175000017500000014553312651206572011263 00000000000000# generated automatically by aclocal 1.14.1 -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) dnl Configure Paths for Alsa dnl Some modifications by Richard Boulton dnl Christopher Lansdown dnl Jaroslav Kysela dnl Last modification: $Id: alsa.m4,v 1.24 2004/09/15 18:48:07 tiwai Exp $ dnl AM_PATH_ALSA([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for libasound, and define ALSA_CFLAGS and ALSA_LIBS as appropriate. dnl enables arguments --with-alsa-prefix= dnl --with-alsa-enc-prefix= dnl --disable-alsatest dnl dnl For backwards compatibility, if ACTION_IF_NOT_FOUND is not specified, dnl and the alsa libraries are not found, a fatal AC_MSG_ERROR() will result. dnl AC_DEFUN([AM_PATH_ALSA], [dnl Save the original CFLAGS, LDFLAGS, and LIBS alsa_save_CFLAGS="$CFLAGS" alsa_save_LDFLAGS="$LDFLAGS" alsa_save_LIBS="$LIBS" alsa_found=yes dnl dnl Get the cflags and libraries for alsa dnl AC_ARG_WITH(alsa-prefix, [ --with-alsa-prefix=PFX Prefix where Alsa library is installed(optional)], [alsa_prefix="$withval"], [alsa_prefix=""]) AC_ARG_WITH(alsa-inc-prefix, [ --with-alsa-inc-prefix=PFX Prefix where include libraries are (optional)], [alsa_inc_prefix="$withval"], [alsa_inc_prefix=""]) dnl FIXME: this is not yet implemented AC_ARG_ENABLE(alsatest, [ --disable-alsatest Do not try to compile and run a test Alsa program], [enable_alsatest="$enableval"], [enable_alsatest=yes]) dnl Add any special include directories AC_MSG_CHECKING(for ALSA CFLAGS) if test "$alsa_inc_prefix" != "" ; then ALSA_CFLAGS="$ALSA_CFLAGS -I$alsa_inc_prefix" CFLAGS="$CFLAGS -I$alsa_inc_prefix" fi AC_MSG_RESULT($ALSA_CFLAGS) dnl add any special lib dirs AC_MSG_CHECKING(for ALSA LDFLAGS) if test "$alsa_prefix" != "" ; then ALSA_LIBS="$ALSA_LIBS -L$alsa_prefix" LDFLAGS="$LDFLAGS $ALSA_LIBS" fi dnl add the alsa library ALSA_LIBS="$ALSA_LIBS -lasound -lm -ldl -lpthread" LIBS="$ALSA_LIBS $LIBS" AC_MSG_RESULT($ALSA_LIBS) dnl Check for a working version of libasound that is of the right version. if test "x$enable_alsatest" = "xyes"; then min_alsa_version=ifelse([$1], ,0.1.1,$1) AC_MSG_CHECKING(for libasound headers version >= $min_alsa_version) no_alsa="" alsa_min_major_version=`echo $min_alsa_version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` alsa_min_minor_version=`echo $min_alsa_version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` alsa_min_micro_version=`echo $min_alsa_version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` AC_LANG_SAVE AC_LANG_C AC_TRY_COMPILE([ #include ], [ /* ensure backward compatibility */ #if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR) #define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR #endif #if !defined(SND_LIB_MINOR) && defined(SOUNDLIB_VERSION_MINOR) #define SND_LIB_MINOR SOUNDLIB_VERSION_MINOR #endif #if !defined(SND_LIB_SUBMINOR) && defined(SOUNDLIB_VERSION_SUBMINOR) #define SND_LIB_SUBMINOR SOUNDLIB_VERSION_SUBMINOR #endif # if(SND_LIB_MAJOR > $alsa_min_major_version) exit(0); # else # if(SND_LIB_MAJOR < $alsa_min_major_version) # error not present # endif # if(SND_LIB_MINOR > $alsa_min_minor_version) exit(0); # else # if(SND_LIB_MINOR < $alsa_min_minor_version) # error not present # endif # if(SND_LIB_SUBMINOR < $alsa_min_micro_version) # error not present # endif # endif # endif exit(0); ], [AC_MSG_RESULT(found.)], [AC_MSG_RESULT(not present.) ifelse([$3], , [AC_MSG_ERROR(Sufficiently new version of libasound not found.)]) alsa_found=no] ) AC_LANG_RESTORE fi dnl Now that we know that we have the right version, let's see if we have the library and not just the headers. if test "x$enable_alsatest" = "xyes"; then AC_CHECK_LIB([asound], [snd_ctl_open],, [ifelse([$3], , [AC_MSG_ERROR(No linkable libasound was found.)]) alsa_found=no] ) fi if test "x$alsa_found" = "xyes" ; then ifelse([$2], , :, [$2]) LIBS=`echo $LIBS | sed 's/-lasound//g'` LIBS=`echo $LIBS | sed 's/ //'` LIBS="-lasound $LIBS" fi if test "x$alsa_found" = "xno" ; then ifelse([$3], , :, [$3]) CFLAGS="$alsa_save_CFLAGS" LDFLAGS="$alsa_save_LDFLAGS" LIBS="$alsa_save_LIBS" ALSA_CFLAGS="" ALSA_LIBS="" fi dnl That should be it. Now just export out symbols: AC_SUBST(ALSA_CFLAGS) AC_SUBST(ALSA_LIBS) ]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 1 (pkg-config-0.24) # # Copyright © 2004 Scott James Remnant . # # 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. # # 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. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) # only at the first occurence in configure.ac, so if the first place # it's called might be skipped (such as if it is within an "if", you # have to call PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac # # # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])# PKG_CHECK_MODULES # Copyright (C) 2002-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.14' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.14.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.14.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/ax_cxx_compile_stdcxx.m4]) m4_include([m4/ax_cxx_compile_stdcxx_11.m4]) seq24-0.9.3/src/0000755000175000017500000000000012651206575010262 500000000000000seq24-0.9.3/src/options.h0000644000175000017500000000545112651156360012047 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #pragma once #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "globals.h" #include "perform.h" using namespace Gtk; class options : public Gtk::Dialog { private: #if GTK_MINOR_VERSION < 12 Tooltips *m_tooltips; #endif perform *m_perf; Button *m_button_ok; Label* interaction_method_label; Label* interaction_method_desc_label; Table *m_table; Notebook *m_notebook; enum button { e_jack_transport, e_jack_master, e_jack_master_cond, e_jack_start_mode_live, e_jack_start_mode_song, e_jack_connect, e_jack_disconnect }; void clock_callback_off( int a_bus, RadioButton *a_button ); void clock_callback_on ( int a_bus, RadioButton *a_button ); void clock_callback_mod( int a_bus, RadioButton *a_button ); void clock_mod_callback( Adjustment *adj ); void input_callback( int a_bus, Button *a_button ); void transport_callback( button a_type, Button *a_button ); void mouse_seq24_callback(Gtk::RadioButton*); void mouse_fruity_callback(Gtk::RadioButton*); /*notebook pages*/ void add_midi_clock_page(); void add_midi_input_page(); void add_keyboard_page(); void add_mouse_page(); void add_jack_sync_page(); public: options( Gtk::Window &parent, perform *a_p ); }; seq24-0.9.3/src/perfroll_input.cpp0000644000175000017500000004400611465300367013752 00000000000000#include "perform.h" #include "perfroll_input.h" #include "perfroll.h" void FruityPerfInput::updateMousePtr( perfroll& ths ) { // context sensitive mouse long drop_tick; int drop_sequence; ths.convert_xy( m_current_x, m_current_y, &drop_tick, &drop_sequence ); if (ths.m_mainperf->is_active( drop_sequence )) { long start, end; if (ths.m_mainperf->get_sequence(drop_sequence)->intersectTriggers( drop_tick, start, end )) { if (start <= drop_tick && drop_tick <= start + (c_perfroll_size_box_click_w * c_perf_scale_x) && (m_current_y % c_names_y) <= c_perfroll_size_box_click_w + 1) { ths.get_window()->set_cursor( Gdk::Cursor( Gdk::RIGHT_PTR )); } else if (end - (c_perfroll_size_box_click_w * c_perf_scale_x) <= drop_tick && drop_tick <= end && (m_current_y % c_names_y) >= c_names_y - c_perfroll_size_box_click_w - 1) { ths.get_window()->set_cursor( Gdk::Cursor( Gdk::LEFT_PTR )); } else { ths.get_window()->set_cursor( Gdk::Cursor( Gdk::CENTER_PTR )); } } else { ths.get_window()->set_cursor( Gdk::Cursor( Gdk::PENCIL )); } } else { ths.get_window()->set_cursor( Gdk::Cursor( Gdk::CROSSHAIR )); } } bool FruityPerfInput::on_button_press_event(GdkEventButton* a_ev, perfroll& ths) { ths.grab_focus( ); if ( ths.m_mainperf->is_active( ths.m_drop_sequence )) { ths.m_mainperf->get_sequence( ths.m_drop_sequence )->unselect_triggers( ); ths.draw_background_on( ths.m_pixmap, ths.m_drop_sequence ); ths.draw_sequence_on( ths.m_pixmap, ths.m_drop_sequence ); ths.draw_drawable_row( ths.m_window, ths.m_pixmap, ths.m_drop_y); } ths.m_drop_x = (int) a_ev->x; ths.m_drop_y = (int) a_ev->y; m_current_x = (int) a_ev->x; m_current_y = (int) a_ev->y; ths.convert_xy( ths.m_drop_x, ths.m_drop_y, &ths.m_drop_tick, &ths.m_drop_sequence ); /* left mouse button */ if ( a_ev->button == 1) { on_left_button_pressed(a_ev, ths); } /* right mouse button */ if ( a_ev->button == 3 ) { on_right_button_pressed(a_ev, ths); } /* left-ctrl, or middle: split */ if ( a_ev->button == 2 ) { if ( ths.m_mainperf->is_active( ths.m_drop_sequence )){ bool state = ths.m_mainperf->get_sequence( ths.m_drop_sequence )->get_trigger_state( ths.m_drop_tick ); if ( state ) { ths.split_trigger(ths.m_drop_sequence, ths.m_drop_tick); } } } updateMousePtr( ths ); return true; } void FruityPerfInput::on_left_button_pressed(GdkEventButton* a_ev, perfroll& ths) { if ( a_ev->state & GDK_CONTROL_MASK ) { if ( ths.m_mainperf->is_active( ths.m_drop_sequence )) { bool state = ths.m_mainperf->get_sequence( ths.m_drop_sequence )->get_trigger_state( ths.m_drop_tick ); if ( state ) { ths.split_trigger(ths.m_drop_sequence, ths.m_drop_tick); } } } else { long tick = ths.m_drop_tick; /* add a new note if we didnt select anything */ //if (m_adding) { m_adding_pressed = true; if ( ths.m_mainperf->is_active( ths.m_drop_sequence )){ long seq_length = ths.m_mainperf->get_sequence( ths.m_drop_sequence )->get_length( ); bool state = ths.m_mainperf->get_sequence( ths.m_drop_sequence )->get_trigger_state( tick ); // resize the event, or move it, depending on where clicked. if ( state ) { //m_adding = false; m_adding_pressed = false; ths.m_mainperf->push_trigger_undo(); ths.m_mainperf->get_sequence( ths.m_drop_sequence )->select_trigger( tick ); long start_tick = ths.m_mainperf->get_sequence( ths.m_drop_sequence )->get_selected_trigger_start_tick(); long end_tick = ths.m_mainperf->get_sequence( ths.m_drop_sequence )->get_selected_trigger_end_tick(); if ( tick >= start_tick && tick <= start_tick + (c_perfroll_size_box_click_w * c_perf_scale_x) && (ths.m_drop_y % c_names_y) <= c_perfroll_size_box_click_w + 1 ) { // clicked left side: begin a grow/shrink for the left side ths.m_growing = true; ths.m_grow_direction = true; ths.m_drop_tick_trigger_offset = ths.m_drop_tick - ths.m_mainperf->get_sequence( ths.m_drop_sequence )-> get_selected_trigger_start_tick( ); } else if ( tick >= end_tick - (c_perfroll_size_box_click_w * c_perf_scale_x) && tick <= end_tick && (ths.m_drop_y % c_names_y) >= c_names_y - c_perfroll_size_box_click_w - 1 ) { // clicked right side: grow/shrink the right side ths.m_growing = true; ths.m_grow_direction = false; ths.m_drop_tick_trigger_offset = ths.m_drop_tick - ths.m_mainperf->get_sequence( ths.m_drop_sequence )->get_selected_trigger_end_tick( ); } else { // clicked in the middle - move it ths.m_moving = true; ths.m_drop_tick_trigger_offset = ths.m_drop_tick - ths.m_mainperf->get_sequence( ths.m_drop_sequence )-> get_selected_trigger_start_tick( ); } ths.draw_background_on( ths.m_pixmap, ths.m_drop_sequence ); ths.draw_sequence_on( ths.m_pixmap, ths.m_drop_sequence ); ths.draw_drawable_row( ths.m_window, ths.m_pixmap, ths.m_drop_y); } // add an event: else { // snap to length of sequence tick = tick - (tick % seq_length); ths.m_mainperf->push_trigger_undo(); ths.m_mainperf->get_sequence( ths.m_drop_sequence )->add_trigger( tick, seq_length ); ths.draw_background_on( ths.m_pixmap, ths.m_drop_sequence ); ths.draw_sequence_on( ths.m_pixmap, ths.m_drop_sequence ); ths.draw_drawable_row( ths.m_window, ths.m_pixmap, ths.m_drop_y); //m_drop_tick_last = (m_drop_tick + seq_length - 1); } } } } } void FruityPerfInput::on_right_button_pressed(GdkEventButton* a_ev, perfroll& ths) { //set_adding( false ); long tick = ths.m_drop_tick; if ( ths.m_mainperf->is_active( ths.m_drop_sequence )){ //long seq_length = ths.m_mainperf->get_sequence( ths.m_drop_sequence )->get_length(); bool state = ths.m_mainperf->get_sequence( ths.m_drop_sequence )->get_trigger_state( tick ); if ( state ) { ths.m_mainperf->push_trigger_undo(); ths.m_mainperf->get_sequence( ths.m_drop_sequence )->del_trigger( tick ); } } } bool FruityPerfInput::on_button_release_event(GdkEventButton* a_ev, perfroll& ths) { m_current_x = (int) a_ev->x; m_current_y = (int) a_ev->y; if ( a_ev->button == 1 || a_ev->button == 3 ) { m_adding_pressed = false; } ths.m_moving = false; ths.m_growing = false; m_adding_pressed = false; if ( ths.m_mainperf->is_active( ths.m_drop_sequence )){ ths.draw_background_on( ths.m_pixmap, ths.m_drop_sequence ); ths.draw_sequence_on( ths.m_pixmap, ths.m_drop_sequence ); ths.draw_drawable_row( ths.m_window, ths.m_pixmap, ths.m_drop_y ); } updateMousePtr( ths ); return true; } bool FruityPerfInput::on_motion_notify_event(GdkEventMotion* a_ev, perfroll& ths) { long tick; int x = (int) a_ev->x; m_current_x = (int) a_ev->x; m_current_y = (int) a_ev->y; if ( m_adding_pressed ){ ths.convert_x( x, &tick ); if ( ths.m_mainperf->is_active( ths.m_drop_sequence )){ long seq_length = ths.m_mainperf->get_sequence( ths.m_drop_sequence )->get_length( ); tick = tick - (tick % seq_length); /*long min_tick = (tick < m_drop_tick) ? tick : m_drop_tick;*/ long length = seq_length; ths.m_mainperf->get_sequence( ths.m_drop_sequence ) ->grow_trigger( ths.m_drop_tick, tick, length); ths.draw_background_on( ths.m_pixmap, ths.m_drop_sequence ); ths.draw_sequence_on( ths.m_pixmap, ths.m_drop_sequence ); ths.draw_drawable_row( ths.m_window, ths.m_pixmap, ths.m_drop_y); } } else if ( ths.m_moving || ths.m_growing ) { if ( ths.m_mainperf->is_active( ths.m_drop_sequence)) { ths.convert_x( x, &tick ); tick -= ths.m_drop_tick_trigger_offset; tick = tick - tick % ths.m_snap; if ( ths.m_moving ) { ths.m_mainperf->get_sequence( ths.m_drop_sequence ) ->move_selected_triggers_to( tick, true ); } if ( ths.m_growing ) { if ( ths.m_grow_direction ) ths.m_mainperf->get_sequence( ths.m_drop_sequence ) ->move_selected_triggers_to( tick, false, 0 ); else ths.m_mainperf->get_sequence( ths.m_drop_sequence ) ->move_selected_triggers_to( tick-1, false, 1 ); } ths.draw_background_on( ths.m_pixmap, ths.m_drop_sequence ); ths.draw_sequence_on( ths.m_pixmap, ths.m_drop_sequence ); ths.draw_drawable_row( ths.m_window, ths.m_pixmap, ths.m_drop_y); } } updateMousePtr( ths ); return true; } /* popup menu calls this */ void Seq24PerfInput::set_adding( bool a_adding, perfroll& ths ) { if ( a_adding ) { ths.get_window()->set_cursor( Gdk::Cursor( Gdk::PENCIL )); m_adding = true; } else { ths.get_window()->set_cursor( Gdk::Cursor( Gdk::LEFT_PTR )); m_adding = false; } } bool Seq24PerfInput::on_button_press_event(GdkEventButton* a_ev, perfroll& ths) { ths.grab_focus( ); if ( ths.m_mainperf->is_active( ths.m_drop_sequence )) { ths.m_mainperf->get_sequence( ths.m_drop_sequence )->unselect_triggers( ); ths.draw_background_on( ths.m_pixmap, ths.m_drop_sequence ); ths.draw_sequence_on( ths.m_pixmap, ths.m_drop_sequence ); ths.draw_drawable_row( ths.m_window, ths.m_pixmap, ths.m_drop_y); } ths.m_drop_x = (int) a_ev->x; ths.m_drop_y = (int) a_ev->y; ths.convert_xy( ths.m_drop_x, ths.m_drop_y, &ths.m_drop_tick, &ths.m_drop_sequence ); /* left mouse button */ if ( a_ev->button == 1 ){ long tick = ths.m_drop_tick; /* add a new note if we didnt select anything */ if ( m_adding ){ m_adding_pressed = true; if ( ths.m_mainperf->is_active( ths.m_drop_sequence )){ long seq_length = ths.m_mainperf->get_sequence( ths.m_drop_sequence )->get_length( ); bool state = ths.m_mainperf->get_sequence( ths.m_drop_sequence )->get_trigger_state( tick ); if ( state ) { ths.m_mainperf->push_trigger_undo(); ths.m_mainperf->get_sequence( ths.m_drop_sequence )->del_trigger( tick ); } else { // snap to length of sequence tick = tick - (tick % seq_length); //m_adding_pressed_state = true; ths.m_mainperf->push_trigger_undo(); ths.m_mainperf->get_sequence( ths.m_drop_sequence )->add_trigger( tick, seq_length ); ths.draw_background_on( ths.m_pixmap, ths.m_drop_sequence ); ths.draw_sequence_on( ths.m_pixmap, ths.m_drop_sequence ); ths.draw_drawable_row( ths.m_window, ths.m_pixmap, ths.m_drop_y); //m_drop_tick_last = (m_drop_tick + seq_length - 1); } } } else { if ( ths.m_mainperf->is_active( ths.m_drop_sequence )){ ths.m_mainperf->push_trigger_undo(); ths.m_mainperf->get_sequence( ths.m_drop_sequence )->select_trigger( tick ); long start_tick = ths.m_mainperf->get_sequence( ths.m_drop_sequence )->get_selected_trigger_start_tick(); long end_tick = ths.m_mainperf->get_sequence( ths.m_drop_sequence )->get_selected_trigger_end_tick(); if ( tick >= start_tick && tick <= start_tick + (c_perfroll_size_box_click_w * c_perf_scale_x) && (ths.m_drop_y % c_names_y) <= c_perfroll_size_box_click_w + 1 ) { ths.m_growing = true; ths.m_grow_direction = true; ths.m_drop_tick_trigger_offset = ths.m_drop_tick - ths.m_mainperf->get_sequence( ths.m_drop_sequence )-> get_selected_trigger_start_tick( ); } else if ( tick >= end_tick - (c_perfroll_size_box_click_w * c_perf_scale_x) && tick <= end_tick && (ths.m_drop_y % c_names_y) >= c_names_y - c_perfroll_size_box_click_w - 1 ) { ths.m_growing = true; ths.m_grow_direction = false; ths.m_drop_tick_trigger_offset = ths.m_drop_tick - ths.m_mainperf->get_sequence( ths.m_drop_sequence )->get_selected_trigger_end_tick( ); } else { ths.m_moving = true; ths.m_drop_tick_trigger_offset = ths.m_drop_tick - ths.m_mainperf->get_sequence( ths.m_drop_sequence )-> get_selected_trigger_start_tick( ); } ths.draw_background_on( ths.m_pixmap, ths.m_drop_sequence ); ths.draw_sequence_on( ths.m_pixmap, ths.m_drop_sequence ); ths.draw_drawable_row( ths.m_window, ths.m_pixmap, ths.m_drop_y); } } } /* right mouse button */ if ( a_ev->button == 3 ){ set_adding( true, ths ); } /* middle, split */ if ( a_ev->button == 2 ) { if ( ths.m_mainperf->is_active( ths.m_drop_sequence )){ bool state = ths.m_mainperf->get_sequence( ths.m_drop_sequence )->get_trigger_state( ths.m_drop_tick ); if ( state ) { ths.split_trigger(ths.m_drop_sequence, ths.m_drop_tick); } } } return true; } bool Seq24PerfInput::on_button_release_event(GdkEventButton* a_ev, perfroll& ths) { if ( a_ev->button == 1 ){ if ( m_adding ){ m_adding_pressed = false; } } if ( a_ev->button == 3 ){ m_adding_pressed = false; set_adding( false, ths ); } ths.m_moving = false; ths.m_growing = false; m_adding_pressed = false; if ( ths.m_mainperf->is_active( ths.m_drop_sequence )){ ths.draw_background_on( ths.m_pixmap, ths.m_drop_sequence ); ths.draw_sequence_on( ths.m_pixmap, ths.m_drop_sequence ); ths.draw_drawable_row( ths.m_window, ths.m_pixmap, ths.m_drop_y ); } return true; } bool Seq24PerfInput::on_motion_notify_event(GdkEventMotion* a_ev, perfroll& ths) { long tick; int x = (int) a_ev->x; if ( m_adding && m_adding_pressed ){ ths.convert_x( x, &tick ); if ( ths.m_mainperf->is_active( ths.m_drop_sequence )){ long seq_length = ths.m_mainperf->get_sequence( ths.m_drop_sequence )->get_length( ); tick = tick - (tick % seq_length); /*long min_tick = (tick < m_drop_tick) ? tick : m_drop_tick;*/ long length = seq_length; ths.m_mainperf->get_sequence( ths.m_drop_sequence ) ->grow_trigger( ths.m_drop_tick, tick, length); ths.draw_background_on( ths.m_pixmap, ths.m_drop_sequence ); ths.draw_sequence_on( ths.m_pixmap, ths.m_drop_sequence ); ths.draw_drawable_row( ths.m_window, ths.m_pixmap, ths.m_drop_y); } } else if ( ths.m_moving || ths.m_growing ){ if ( ths.m_mainperf->is_active( ths.m_drop_sequence)){ ths.convert_x( x, &tick ); tick -= ths.m_drop_tick_trigger_offset; tick = tick - tick % ths.m_snap; if ( ths.m_moving ) { ths.m_mainperf->get_sequence( ths.m_drop_sequence ) ->move_selected_triggers_to( tick, true ); } if ( ths.m_growing ) { if ( ths.m_grow_direction ) ths.m_mainperf->get_sequence( ths.m_drop_sequence ) ->move_selected_triggers_to( tick, false, 0 ); else ths.m_mainperf->get_sequence( ths.m_drop_sequence ) ->move_selected_triggers_to( tick-1, false, 1 ); } ths.draw_background_on( ths.m_pixmap, ths.m_drop_sequence ); ths.draw_sequence_on( ths.m_pixmap, ths.m_drop_sequence ); ths.draw_drawable_row( ths.m_window, ths.m_pixmap, ths.m_drop_y); } } return true; } seq24-0.9.3/src/maintime.cpp0000644000175000017500000000530511473026247012511 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #include "maintime.h" maintime::maintime( ): m_black(Gdk::Color("black")), m_white(Gdk::Color("white")), m_grey(Gdk::Color("grey")), m_tick(0) { // in the construor you can only allocate colors, // get_window() returns 0 because we have not be realized Glib::RefPtr colormap = get_default_colormap(); colormap->alloc_color( m_black ); colormap->alloc_color( m_white ); colormap->alloc_color( m_grey ); } void maintime::on_realize() { // we need to do the default realize Gtk::DrawingArea::on_realize(); // Now we can allocate any additional resources we need m_window = get_window(); m_gc = Gdk::GC::create( m_window ); m_window->clear(); /* set default size */ set_size_request( c_maintime_x , c_maintime_y ); } int maintime::idle_progress( long a_ticks ) { m_tick = a_ticks; m_window->clear(); m_gc->set_foreground(m_black); m_window->draw_rectangle(m_gc,false, 0, 0, c_maintime_x - 1, c_maintime_y - 1 ); int width = c_maintime_x - 1 - c_pill_width; int tick_x = ((m_tick % c_ppqn) * (c_maintime_x - 1) ) / c_ppqn ; int beat_x = (((m_tick / 4) % c_ppqn) * width) / c_ppqn ; int bar_x = (((m_tick / 16) % c_ppqn) * width) / c_ppqn ; if ( tick_x <= (c_maintime_x / 4 )){ m_gc->set_foreground(m_grey); m_window->draw_rectangle(m_gc,true, 2, //tick_x + 2, 2, c_maintime_x - 4, c_maintime_y - 4 ); } m_gc->set_foreground(m_black); m_window->draw_rectangle(m_gc,true, beat_x + 2, 2, c_pill_width, c_maintime_y - 4 ); m_window->draw_rectangle(m_gc,true, bar_x + 2, 2, c_pill_width, c_maintime_y - 4 ); return true; } bool maintime::on_expose_event(GdkEventExpose* a_e) { idle_progress( m_tick ); return true; } seq24-0.9.3/src/sequence.cpp0000644000175000017500000022351312651156360012520 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #include "sequence.h" #include "seqedit.h" #include list < event > sequence::m_list_clipboard; sequence::sequence( ) : m_midi_channel(0), m_bus(0), m_song_mute(false), m_masterbus(NULL), m_was_playing(false), m_playing(false), m_recording(false), m_quanized_rec(false), m_thru(false), m_queued(false), m_trigger_copied(false), m_dirty_main(true), m_dirty_edit(true), m_dirty_perf(true), m_dirty_names(true), m_editing(false), m_raise(false), m_name(c_dummy), m_last_tick(0), m_queued_tick(0), m_trigger_offset(0), m_length(4 * c_ppqn), m_snap_tick(c_ppqn / 4), m_time_beats_per_measure(4), m_time_beat_width(4), m_rec_vol(0) //m_tag(0), { /* no notes are playing */ for (int i=0; i< c_midi_notes; i++ ) m_playing_notes[i] = 0; } void sequence::push_undo() { lock(); m_list_undo.push( m_list_event ); unlock(); } void sequence::pop_undo() { lock(); if (m_list_undo.size() > 0 ){ m_list_redo.push( m_list_event ); m_list_event = m_list_undo.top(); m_list_undo.pop(); verify_and_link(); unselect(); } unlock(); } void sequence::pop_redo() { lock(); if (m_list_redo.size() > 0 ){ m_list_undo.push( m_list_event ); m_list_event = m_list_redo.top(); m_list_redo.pop(); verify_and_link(); unselect(); } unlock(); } void sequence::push_trigger_undo() { lock(); m_list_trigger_undo.push( m_list_trigger ); list::iterator i; for ( i = m_list_trigger_undo.top().begin(); i != m_list_trigger_undo.top().end(); i++ ){ (*i).m_selected = false; } unlock(); } void sequence::pop_trigger_undo() { lock(); if (m_list_trigger_undo.size() > 0 ){ m_list_trigger_redo.push( m_list_trigger ); m_list_trigger = m_list_trigger_undo.top(); m_list_trigger_undo.pop(); } unlock(); } void sequence::set_master_midi_bus( mastermidibus *a_mmb ) { lock(); m_masterbus = a_mmb; unlock(); } void sequence::set_song_mute( bool a_mute ) { m_song_mute = a_mute; } bool sequence::get_song_mute() { return m_song_mute; } void sequence::set_bpm( long a_beats_per_measure ) { lock(); m_time_beats_per_measure = a_beats_per_measure; set_dirty_mp(); unlock(); } long sequence::get_bpm() { return m_time_beats_per_measure; } void sequence::set_bw( long a_beat_width ) { lock(); m_time_beat_width = a_beat_width; set_dirty_mp(); unlock(); } void sequence::set_rec_vol( long a_rec_vol ) { lock(); m_rec_vol = a_rec_vol; unlock(); } long sequence::get_bw() { return m_time_beat_width; } sequence::~sequence() { } /* adds event in sorted manner */ void sequence::add_event( const event *a_e ) { lock(); m_list_event.push_front( *a_e ); m_list_event.sort( ); reset_draw_marker(); set_dirty(); unlock(); } void sequence::set_orig_tick( long a_tick ) { lock(); m_last_tick = a_tick; unlock(); } void sequence::toggle_queued() { lock(); set_dirty_mp(); m_queued = !m_queued; m_queued_tick = m_last_tick - (m_last_tick % m_length) + m_length; unlock(); } void sequence::off_queued() { lock(); set_dirty_mp(); m_queued = false; unlock(); } bool sequence::get_queued() { return m_queued; } long sequence::get_queued_tick() { return m_queued_tick; } /* tick comes in as global tick */ void sequence::play( long a_tick, bool a_playback_mode ) { lock(); //printf( "a_tick[%ld] a_playback[%d]\n", a_tick, a_playback_mode ); /* turns sequence off after we play in this frame */ bool trigger_turning_off = false; long times_played = m_last_tick / m_length; long offset_base = times_played * m_length; long start_tick = m_last_tick; long end_tick = a_tick; long trigger_offset = 0; if ( m_song_mute ) { set_playing(false); } else { /* if we are using our in sequence on/off triggers */ if ( a_playback_mode ){ bool trigger_state = false; long trigger_tick = 0; list::iterator i = m_list_trigger.begin(); while ( i != m_list_trigger.end()){ if ( (*i).m_tick_start <= end_tick ){ trigger_state = true; trigger_tick = (*i).m_tick_start; trigger_offset = (*i).m_offset; } if ( (*i).m_tick_end <= end_tick ){ trigger_state = false; trigger_tick = (*i).m_tick_end; trigger_offset = (*i).m_offset; } if ( (*i).m_tick_start > end_tick || (*i).m_tick_end > end_tick ) { break; } i++; } /* we had triggers in our slice and its not equal to current state */ if ( trigger_state != m_playing ){ //printf( "trigger %d\n", trigger_state ); /* we are turning on */ if ( trigger_state ){ if ( trigger_tick < m_last_tick ) start_tick = m_last_tick; else start_tick = trigger_tick; set_playing( true ); } else { /* we are on and turning off */ end_tick = trigger_tick; trigger_turning_off = true; } } if( m_list_trigger.size() == 0 && m_playing ){ set_playing(false); } } } set_trigger_offset(trigger_offset); long start_tick_offset = (start_tick + m_length - m_trigger_offset); long end_tick_offset = (end_tick + m_length - m_trigger_offset); /* play the notes in our frame */ if ( m_playing ){ list::iterator e = m_list_event.begin(); while ( e != m_list_event.end()){ //printf ( "s[%ld] -> t[%ld] ", start_tick, end_tick ); (*e).print(); if ( ((*e).get_timestamp() + offset_base ) >= (start_tick_offset) && ((*e).get_timestamp() + offset_base ) <= (end_tick_offset) ){ put_event_on_bus( &(*e) ); //printf( "bus: ");(*e).print(); } else if ( ((*e).get_timestamp() + offset_base) > end_tick_offset ){ break; } /* advance */ e++; /* did we hit the end ? */ if ( e == m_list_event.end() ){ e = m_list_event.begin(); offset_base += m_length; } } } /* if our triggers said we should turn off */ if ( trigger_turning_off ){ set_playing( false ); } /* update for next frame */ m_last_tick = end_tick + 1; m_was_playing = m_playing; unlock(); } void sequence::zero_markers() { lock(); m_last_tick = 0; //m_masterbus->flush( ); unlock(); } /* verfies state, all noteons have an off, links noteoffs with their ons */ void sequence::verify_and_link() { list::iterator i; list::iterator on; list::iterator off; bool end_found = false; lock(); for ( i = m_list_event.begin(); i != m_list_event.end(); i++ ){ (*i).clear_link(); (*i).unmark(); } on = m_list_event.begin(); /* pair ons and offs */ while ( on != m_list_event.end() ){ /* check for a note on, then look for its note off */ if ( (*on).is_note_on() ){ /* get next possible off node */ off = on; off++; end_found = false; while ( off != m_list_event.end() ){ /* is a off event, == notes, and isnt markeded */ if ( (*off).is_note_off() && (*off).get_note() == (*on).get_note() && ! (*off).is_marked() ){ /* link + mark */ (*on).link( &(*off) ); (*off).link( &(*on) ); (*on).mark( ); (*off).mark( ); end_found = true; break; } off++; } if (!end_found) { off = m_list_event.begin(); while ( off != on){ if ( (*off).is_note_off() && (*off).get_note() == (*on).get_note() && ! (*off).is_marked() ){ /* link + mark */ (*on).link( &(*off) ); (*off).link( &(*on) ); (*on).mark( ); (*off).mark( ); end_found = true; break; } off++; } } } on++; } /* unmark all */ for ( i = m_list_event.begin(); i != m_list_event.end(); i++ ){ (*i).unmark(); } /* kill those not in range */ for ( i = m_list_event.begin(); i != m_list_event.end(); i++ ){ /* if our current time stamp is greater then the length */ if ( (*i).get_timestamp() >= m_length || (*i).get_timestamp() < 0 ){ /* we have to prune it */ (*i).mark(); if ( (*i).is_linked() ) (*i).get_linked()->mark(); } } remove_marked( ); unlock(); } void sequence::link_new( ) { list::iterator on; list::iterator off; bool end_found = false; lock(); on = m_list_event.begin(); /* pair ons and offs */ while ( on != m_list_event.end()){ /* check for a note on, then look for its note off */ if ( (*on).is_note_on() && ! (*on).is_linked() ){ /* get next element */ off = on; off++; end_found = false; while ( off != m_list_event.end()){ /* is a off event, == notes, and isnt selected */ if ( (*off).is_note_off() && (*off).get_note() == (*on).get_note() && ! (*off).is_linked() ){ /* link */ (*on).link( &(*off) ); (*off).link( &(*on) ); end_found = true; break; } off++; } if (!end_found) { off = m_list_event.begin(); while ( off != on){ /* is a off event, == notes, and isnt selected */ if ( (*off).is_note_off() && (*off).get_note() == (*on).get_note() && ! (*off).is_linked() ){ /* link */ (*on).link( &(*off) ); (*off).link( &(*on) ); end_found = true; break; } off++; } } } on++; } unlock(); } // helper function, does not lock/unlock, unsafe to call without them // supply iterator from m_list_event... // lock(); remove(); reset_draw_marker(); unlock() void sequence::remove(list::iterator i) { /* if its a note off, and that note is currently playing, send a note off */ if ( (*i).is_note_off() && m_playing_notes[ (*i).get_note()] > 0 ){ m_masterbus->play( m_bus, &(*i), m_midi_channel ); m_playing_notes[(*i).get_note()]--; } m_list_event.erase(i); } // helper function, does not lock/unlock, unsafe to call without them // supply iterator from m_list_event... // lock(); remove(); reset_draw_marker(); unlock() // finds e in m_list_event, removes the first iterator matching that. void sequence::remove( event* e ) { list::iterator i = m_list_event.begin(); while( i != m_list_event.end() ) { if (e == &(*i)) { remove( i ); return; } ++i; } } void sequence::remove_marked() { list::iterator i, t; lock(); i = m_list_event.begin(); while( i != m_list_event.end() ){ if ((*i).is_marked()){ t = i; t++; remove( i ); i = t; } else { i++; } } reset_draw_marker(); unlock(); } void sequence::mark_selected( ) { list::iterator i, t; lock(); i = m_list_event.begin(); while( i != m_list_event.end() ){ if ((*i).is_selected()){ (*i).mark(); } ++i; } reset_draw_marker(); unlock(); } void sequence::unpaint_all( ) { list::iterator i; lock(); i = m_list_event.begin(); while( i != m_list_event.end() ){ (*i).unpaint(); i++; } unlock(); } /* returns the 'box' of the selected items */ void sequence::get_selected_box( long *a_tick_s, int *a_note_h, long *a_tick_f, int *a_note_l ) { list::iterator i; *a_tick_s = c_maxbeats * c_ppqn; *a_tick_f = 0; *a_note_h = 0; *a_note_l = 128; long time; int note; lock(); for ( i = m_list_event.begin(); i != m_list_event.end(); i++ ){ if( (*i).is_selected() ){ time = (*i).get_timestamp(); // can't check on/off here. screws up seqevent // selection which has no "off" if ( time < *a_tick_s ) *a_tick_s = time; if ( time > *a_tick_f ) *a_tick_f = time; note = (*i).get_note(); if ( note < *a_note_l ) *a_note_l = note; if ( note > *a_note_h ) *a_note_h = note; } } unlock(); } void sequence::get_clipboard_box( long *a_tick_s, int *a_note_h, long *a_tick_f, int *a_note_l ) { list::iterator i; *a_tick_s = c_maxbeats * c_ppqn; *a_tick_f = 0; *a_note_h = 0; *a_note_l = 128; long time; int note; lock(); if ( m_list_clipboard.size() == 0 ) { *a_tick_s = *a_tick_f = *a_note_h = *a_note_l = 0; } for ( i = m_list_clipboard.begin(); i != m_list_clipboard.end(); i++ ){ time = (*i).get_timestamp(); if ( time < *a_tick_s ) *a_tick_s = time; if ( time > *a_tick_f ) *a_tick_f = time; note = (*i).get_note(); if ( note < *a_note_l ) *a_note_l = note; if ( note > *a_note_h ) *a_note_h = note; } unlock(); } int sequence::get_num_selected_notes( ) { int ret = 0; list::iterator i; lock(); for ( i = m_list_event.begin(); i != m_list_event.end(); i++ ){ if( (*i).is_note_on() && (*i).is_selected() ){ ret++; } } unlock(); return ret; } int sequence::get_num_selected_events( unsigned char a_status, unsigned char a_cc ) { int ret = 0; list::iterator i; lock(); for ( i = m_list_event.begin(); i != m_list_event.end(); i++ ){ if( (*i).get_status() == a_status ){ unsigned char d0,d1; (*i).get_data( &d0, &d1 ); if ( (a_status == EVENT_CONTROL_CHANGE && d0 == a_cc ) || (a_status != EVENT_CONTROL_CHANGE) ){ if ( (*i).is_selected( )) ret++; } } } unlock(); return ret; } /* selects events in range.. tick start, note high, tick end note low */ int sequence::select_note_events( long a_tick_s, int a_note_h, long a_tick_f, int a_note_l, select_action_e a_action) { int ret=0; long tick_s = 0; long tick_f = 0; list::iterator i; lock(); for ( i = m_list_event.begin(); i != m_list_event.end(); i++ ) { if( (*i).get_note() <= a_note_h && (*i).get_note() >= a_note_l ) { if ( (*i).is_linked() ) { event *ev = (*i).get_linked(); if ( (*i).is_note_off() ) { tick_s = ev->get_timestamp(); tick_f = (*i).get_timestamp(); } if ( (*i).is_note_on() ) { tick_f = ev->get_timestamp(); tick_s = (*i).get_timestamp(); } if ( ( (tick_s <= tick_f) && ((tick_s <= a_tick_f) && (tick_f >= a_tick_s)) ) || ( (tick_s > tick_f) && ((tick_s <= a_tick_f) || (tick_f >= a_tick_s)) ) ) { if ( a_action == e_select || a_action == e_select_one ) { (*i).select( ); ev->select( ); ret++; if ( a_action == e_select_one ) break; } if ( a_action == e_is_selected ) { if ( (*i).is_selected()) { ret = 1; break; } } if ( a_action == e_would_select ) { ret = 1; break; } if ( a_action == e_deselect ) { ret = 0; (*i).unselect( ); ev->unselect(); //break; } if ( a_action == e_toggle_selection && (*i).is_note_on()) // don't toggle twice { if ((*i).is_selected()) { (*i).unselect( ); ev->unselect(); ret ++; } else { (*i).select(); ev->select(); ret ++; } } if ( a_action == e_remove_one ) { remove( &(*i) ); remove( ev ); reset_draw_marker(); ret++; break; } } } else { tick_s = tick_f = (*i).get_timestamp(); if ( tick_s >= a_tick_s - 16 && tick_f <= a_tick_f) { if ( a_action == e_select || a_action == e_select_one ) { (*i).select( ); ret++; if ( a_action == e_select_one ) break; } if ( a_action == e_is_selected ) { if ( (*i).is_selected()) { ret = 1; break; } } if ( a_action == e_would_select ) { ret = 1; break; } if ( a_action == e_deselect ) { ret = 0; (*i).unselect(); } if ( a_action == e_toggle_selection ) { if ((*i).is_selected()) { (*i).unselect(); ret ++; } else { (*i).select(); ret ++; } } if ( a_action == e_remove_one ) { remove( &(*i) ); reset_draw_marker(); ret++; break; } } } } } unlock(); return ret; } /* select events in range, returns number selected */ int sequence::select_events( long a_tick_s, long a_tick_f, unsigned char a_status, unsigned char a_cc, select_action_e a_action) { int ret=0; list::iterator i; lock(); for ( i = m_list_event.begin(); i != m_list_event.end(); i++ ){ if( (*i).get_status() == a_status && (*i).get_timestamp() >= a_tick_s && (*i).get_timestamp() <= a_tick_f ){ unsigned char d0,d1; (*i).get_data( &d0, &d1 ); if ( (a_status == EVENT_CONTROL_CHANGE && d0 == a_cc ) || (a_status != EVENT_CONTROL_CHANGE) ){ if ( a_action == e_select || a_action == e_select_one ) { (*i).select( ); ret++; if ( a_action == e_select_one ) break; } if ( a_action == e_is_selected ) { if ( (*i).is_selected()) { ret = 1; break; } } if ( a_action == e_would_select ) { ret = 1; break; } if ( a_action == e_toggle_selection ) { if ( (*i).is_selected()) { (*i).unselect( ); } else { (*i).select( ); } } if ( a_action == e_deselect ) { (*i).unselect( ); } if ( a_action == e_remove_one ) { remove( &(*i) ); reset_draw_marker(); ret++; break; } } } } unlock(); return ret; } void sequence::select_all() { lock(); list::iterator i; for ( i = m_list_event.begin(); i != m_list_event.end(); i++ ) (*i).select( ); unlock(); } /* unselects every event */ void sequence::unselect() { lock(); list::iterator i; for ( i = m_list_event.begin(); i != m_list_event.end(); i++ ) (*i).unselect(); unlock(); } /* removes and adds readds selected in position */ void sequence::move_selected_notes( long a_delta_tick, int a_delta_note ) { event e; bool noteon=false; long timestamp=0; lock(); mark_selected(); list::iterator i; for ( i = m_list_event.begin(); i != m_list_event.end(); i++ ){ /* is it being moved ? */ if ( (*i).is_marked() ){ /* copy event */ e = (*i); e.unmark(); if ( (e.get_note() + a_delta_note) >= 0 && (e.get_note() + a_delta_note) < c_num_keys ){ noteon = e.is_note_on(); timestamp = e.get_timestamp() + a_delta_tick; if (timestamp > m_length) { timestamp = timestamp - m_length; } if (timestamp < 0) { timestamp = m_length + timestamp; } if ((timestamp==0) && !noteon) { timestamp = m_length-2; } if ((timestamp==m_length) && noteon) { timestamp = 0; } e.set_timestamp( timestamp ); e.set_note( e.get_note() + a_delta_note ); e.select(); add_event( &e ); } } } remove_marked(); verify_and_link(); unlock(); } /* stretch */ void sequence::stretch_selected( long a_delta_tick ) { event *e, new_e; lock(); list::iterator i; int old_len = 0, new_len = 0; int first_ev = 0x7fffffff; int last_ev = 0x00000000; for ( i = m_list_event.begin(); i != m_list_event.end(); i++ ){ if ( (*i).is_selected() ) { e = &(*i); if (e->get_timestamp() < first_ev) { first_ev = e->get_timestamp(); } if (e->get_timestamp() > last_ev) { last_ev = e->get_timestamp(); } } } old_len = last_ev - first_ev; new_len = old_len + a_delta_tick; float ratio = float(new_len)/float(old_len); if( new_len > 1) { mark_selected(); for ( i = m_list_event.begin(); i != m_list_event.end(); i++ ){ if ( (*i).is_marked() ){ e = &(*i); /* copy & scale event */ new_e = *e; new_e.set_timestamp( long((e->get_timestamp() - first_ev) * ratio) + first_ev ); new_e.unmark(); add_event( &new_e ); } } remove_marked(); verify_and_link(); } unlock(); #if 0 event *on, *off, new_on, new_off; lock(); list::iterator i; int old_len = 0, new_len = 0; int first_ev = 0x7fffffff; int last_ev = 0x00000000; for ( i = m_list_event.begin(); i != m_list_event.end(); i++ ){ if ( (*i).is_selected() && (*i).is_note_on() && (*i).is_linked() ){ on = &(*i); off = (*i).get_linked(); if (on->get_timestamp() < first_ev) { first_ev = on->get_timestamp(); } if (off->get_timestamp() > last_ev) { last_ev = off->get_timestamp(); } } } old_len = last_ev - first_ev; new_len = old_len + a_delta_tick; float ratio = float(new_len)/float(old_len); if( new_len > 1) { mark_selected(); for ( i = m_list_event.begin(); i != m_list_event.end(); i++ ){ if ( (*i).is_marked() && (*i).is_note_on() && (*i).is_linked() ){ on = &(*i); off = (*i).get_linked(); /* copy & scale event */ new_on = *on; new_on.set_timestamp( long((on->get_timestamp() - first_ev) * ratio) + first_ev ); new_off = *off; new_off.set_timestamp( long((off->get_timestamp() - first_ev) * ratio) + first_ev ); new_on.unmark(); new_off.unmark(); add_event( &new_on ); add_event( &new_off ); } } remove_marked(); verify_and_link(); } unlock(); #endif } /* moves note off event */ void sequence::grow_selected( long a_delta_tick ) { event *on, *off, e; lock(); list::iterator i; mark_selected(); for ( i = m_list_event.begin(); i != m_list_event.end(); i++ ){ if ( (*i).is_marked() && (*i).is_note_on() && (*i).is_linked() ){ on = &(*i); off = (*i).get_linked(); long length = off->get_timestamp() + a_delta_tick; //If timestamp + delta is greater that m_length we do round robbin magic if (length > m_length) { length = length - m_length; } if (length < 0) { length = m_length + length; } if (length==0) { length = m_length-2; } on->unmark(); /* copy event */ e = *off; e.unmark(); e.set_timestamp( length ); add_event( &e ); } } remove_marked(); verify_and_link(); unlock(); } void sequence::increment_selected( unsigned char a_status, unsigned char a_control ) { lock(); list::iterator i; for ( i = m_list_event.begin(); i != m_list_event.end(); i++ ){ if ( (*i).is_selected() && (*i).get_status() == a_status ){ if ( a_status == EVENT_NOTE_ON || a_status == EVENT_NOTE_OFF || a_status == EVENT_AFTERTOUCH || a_status == EVENT_CONTROL_CHANGE || a_status == EVENT_PITCH_WHEEL ){ (*i).increment_data2(); } if ( a_status == EVENT_PROGRAM_CHANGE || a_status == EVENT_CHANNEL_PRESSURE ){ (*i).increment_data1(); } } } unlock(); } void sequence::decrement_selected(unsigned char a_status, unsigned char a_control ) { lock(); list::iterator i; for ( i = m_list_event.begin(); i != m_list_event.end(); i++ ){ if ( (*i).is_selected() && (*i).get_status() == a_status ){ if ( a_status == EVENT_NOTE_ON || a_status == EVENT_NOTE_OFF || a_status == EVENT_AFTERTOUCH || a_status == EVENT_CONTROL_CHANGE || a_status == EVENT_PITCH_WHEEL ){ (*i).decrement_data2(); } if ( a_status == EVENT_PROGRAM_CHANGE || a_status == EVENT_CHANNEL_PRESSURE ){ (*i).decrement_data1(); } } } unlock(); } void sequence::copy_selected() { list::iterator i; lock(); m_list_clipboard.clear( ); for ( i = m_list_event.begin(); i != m_list_event.end(); i++ ){ if ( (*i).is_selected() ){ m_list_clipboard.push_back( (*i) ); } } long first_tick = (*m_list_clipboard.begin()).get_timestamp(); for ( i = m_list_clipboard.begin(); i != m_list_clipboard.end(); i++ ){ (*i).set_timestamp((*i).get_timestamp() - first_tick ); } unlock(); } void sequence::paste_selected( long a_tick, int a_note ) { list::iterator i; int highest_note = 0; lock(); list clipboard = m_list_clipboard; for ( i = clipboard.begin(); i != clipboard.end(); i++ ){ (*i).set_timestamp((*i).get_timestamp() + a_tick ); } if ((*clipboard.begin()).is_note_on() || (*clipboard.begin()).is_note_off() ){ for ( i = clipboard.begin(); i != clipboard.end(); i++ ) if ( (*i).get_note( ) > highest_note ) highest_note = (*i).get_note(); for ( i = clipboard.begin(); i != clipboard.end(); i++ ){ (*i).set_note( (*i).get_note( ) - (highest_note - a_note) ); } } m_list_event.merge( clipboard ); m_list_event.sort(); verify_and_link(); reset_draw_marker(); unlock(); } /* change */ void sequence::change_event_data_range( long a_tick_s, long a_tick_f, unsigned char a_status, unsigned char a_cc, int a_data_s, int a_data_f ) { lock(); unsigned char d0, d1; list::iterator i; /* change only selected events, if any */ bool have_selection = false; if( get_num_selected_events(a_status, a_cc) ) have_selection = true; for ( i = m_list_event.begin(); i != m_list_event.end(); i++ ){ /* initially false */ bool set = false; (*i).get_data( &d0, &d1 ); /* correct status and not CC */ if ( a_status != EVENT_CONTROL_CHANGE && (*i).get_status() == a_status ) set = true; /* correct status and correct cc */ if ( a_status == EVENT_CONTROL_CHANGE && (*i).get_status() == a_status && d0 == a_cc ) set = true; /* in range? */ if ( !((*i).get_timestamp() >= a_tick_s && (*i).get_timestamp() <= a_tick_f )) set = false; /* in selection? */ if ( have_selection && (!(*i).is_selected()) ) set = false; if ( set ){ //float weight; /* no divide by 0 */ if( a_tick_f == a_tick_s ) a_tick_f = a_tick_s + 1; /* ratio of v1 to v2 */ /* weight = (float)( (*i).get_timestamp() - a_tick_s ) / (float)( a_tick_f - a_tick_s ); int newdata = (int) ((weight * (float) a_data_f ) + ((1.0f - weight) * (float) a_data_s )); */ int tick = (*i).get_timestamp(); //printf("ticks: %d %d %d\n", a_tick_s, tick, a_tick_f); //printf("datas: %d %d\n", a_data_s, a_data_f); int newdata = ((tick-a_tick_s)*a_data_f + (a_tick_f-tick)*a_data_s) /(a_tick_f - a_tick_s); if ( newdata < 0 ) newdata = 0; if ( newdata > 127 ) newdata = 127; if ( a_status == EVENT_NOTE_ON ) d1 = newdata; if ( a_status == EVENT_NOTE_OFF ) d1 = newdata; if ( a_status == EVENT_AFTERTOUCH ) d1 = newdata; if ( a_status == EVENT_CONTROL_CHANGE ) d1 = newdata; if ( a_status == EVENT_PROGRAM_CHANGE ) d0 = newdata; /* d0 == new patch */ if ( a_status == EVENT_CHANNEL_PRESSURE ) d0 = newdata; /* d0 == pressure */ if ( a_status == EVENT_PITCH_WHEEL ) d1 = newdata; (*i).set_data( d0, d1 ); } } unlock(); } void sequence::add_note( long a_tick, long a_length, int a_note, bool a_paint) { lock(); event e; bool ignore = false; if ( a_tick >= 0 && a_note >= 0 && a_note < c_num_keys ){ /* if we care about the painted, run though * our events, delete the painted ones that * overlap the one we want to add */ if ( a_paint ) { list::iterator i,t; for ( i = m_list_event.begin(); i != m_list_event.end(); i++ ){ if ( (*i).is_painted() && (*i).is_note_on() && (*i).get_timestamp() == a_tick ) { if ((*i).get_note() == a_note ) { ignore = true; break; } (*i).mark(); if ( (*i).is_linked()) { (*i).get_linked()->mark(); } set_dirty(); } } remove_marked(); } if ( !ignore ) { if ( a_paint ) e.paint(); e.set_status( EVENT_NOTE_ON ); e.set_data( a_note, 100 ); e.set_timestamp( a_tick ); add_event( &e ); e.set_status( EVENT_NOTE_OFF ); e.set_data( a_note, 100 ); e.set_timestamp( a_tick + a_length ); add_event( &e ); } } verify_and_link(); unlock(); } void sequence::add_event( long a_tick, unsigned char a_status, unsigned char a_d0, unsigned char a_d1, bool a_paint) { lock(); if ( a_tick >= 0 ){ event e; /* if we care about the painted, run though * our events, delete the painted ones that * overlap the one we want to add */ if ( a_paint ) { list::iterator i,t; for ( i = m_list_event.begin(); i != m_list_event.end(); i++ ){ if ( (*i).is_painted() && (*i).get_timestamp() == a_tick ) { (*i).mark(); if ( (*i).is_linked()) { (*i).get_linked()->mark(); } set_dirty(); } } remove_marked(); } if ( a_paint ) e.paint(); e.set_status( a_status ); e.set_data( a_d0, a_d1 ); e.set_timestamp( a_tick ); add_event( &e ); } verify_and_link(); unlock(); } void sequence::stream_event( event *a_ev ) { lock(); /* adjust tick */ a_ev->mod_timestamp( m_length ); if ( m_recording ) { if ( is_pattern_playing ) { add_event( a_ev ); set_dirty(); } else { if ( a_ev->is_note_on() ) { push_undo(); add_note( m_last_tick % m_length, m_snap_tick - 2, a_ev->get_note(), false ); set_dirty(); m_notes_on++; } if (a_ev->is_note_off()) m_notes_on--; if (m_notes_on <= 0) m_last_tick += m_snap_tick; } } if ( m_thru ) { put_event_on_bus( a_ev ); } link_new(); if ( m_quanized_rec && is_pattern_playing){ if (a_ev->is_note_off()) { select_note_events( a_ev->get_timestamp(), a_ev->get_note(), a_ev->get_timestamp(), a_ev->get_note(), e_select); quanize_events( EVENT_NOTE_ON, 0, m_snap_tick, 1 , true ); } } /* update view */ unlock(); } void sequence::set_dirty_mp() { //printf( "set_dirtymp\n" ); m_dirty_names = m_dirty_main = m_dirty_perf = true; } void sequence::set_dirty() { //printf( "set_dirty\n" ); m_dirty_names = m_dirty_main = m_dirty_perf = m_dirty_edit = true; } bool sequence::is_dirty_names( ) { lock(); bool ret = m_dirty_names; m_dirty_names = false; unlock(); return ret; } bool sequence::is_dirty_main( ) { lock(); bool ret = m_dirty_main; m_dirty_main = false; unlock(); return ret; } bool sequence::is_dirty_perf( ) { lock(); bool ret = m_dirty_perf; m_dirty_perf = false; unlock(); return ret; } bool sequence::is_dirty_edit( ) { lock(); bool ret = m_dirty_edit; m_dirty_edit = false; unlock(); return ret; } /* plays a note from the paino roll */ void sequence::play_note_on( int a_note ) { lock(); event e; e.set_status( EVENT_NOTE_ON ); e.set_data( a_note, 127 ); m_masterbus->play( m_bus, &e, m_midi_channel ); m_masterbus->flush(); unlock(); } /* plays a note from the paino roll */ void sequence::play_note_off( int a_note ) { lock(); event e; e.set_status( EVENT_NOTE_OFF ); e.set_data( a_note, 127 ); m_masterbus->play( m_bus, &e, m_midi_channel ); m_masterbus->flush(); unlock(); } void sequence::clear_triggers() { lock(); m_list_trigger.clear(); unlock(); } /* adds trigger, a_state = true, range is on. a_state = false, range is off is ie < >< >< > es ee < > XX es ee < > <> es ee < > < > es ee < > < > */ void sequence::add_trigger( long a_tick, long a_length, long a_offset, bool a_adjust_offset ) { lock(); trigger e; if ( a_adjust_offset ) e.m_offset = adjust_offset(a_offset); else e.m_offset = a_offset; e.m_selected = false; e.m_tick_start = a_tick; e.m_tick_end = a_tick + a_length - 1; list::iterator i = m_list_trigger.begin(); while ( i != m_list_trigger.end() ){ // Is it inside the new one ? erase if ((*i).m_tick_start >= e.m_tick_start && (*i).m_tick_end <= e.m_tick_end ) { //printf ( "erase start[%d] end[%d]\n", (*i).m_tick_start, (*i).m_tick_end ); m_list_trigger.erase(i); i = m_list_trigger.begin(); continue; } // Is the e's end inside ? else if ( (*i).m_tick_end >= e.m_tick_end && (*i).m_tick_start <= e.m_tick_end ) { (*i).m_tick_start = e.m_tick_end + 1; //printf ( "mvstart start[%d] end[%d]\n", (*i).m_tick_start, (*i).m_tick_end ); } // Is the last start inside the new end ? else if ((*i).m_tick_end >= e.m_tick_start && (*i).m_tick_start <= e.m_tick_start ) { (*i).m_tick_end = e.m_tick_start - 1; //printf ( "mvend start[%d] end[%d]\n", (*i).m_tick_start, (*i).m_tick_end ); } ++i; } m_list_trigger.push_front( e ); m_list_trigger.sort(); unlock(); } bool sequence::intersectTriggers( long position, long& start, long& end ) { lock(); list::iterator i = m_list_trigger.begin(); while ( i != m_list_trigger.end() ) { if ((*i).m_tick_start <= position && position <= (*i).m_tick_end) { start = (*i).m_tick_start; end = (*i).m_tick_end; unlock(); return true; } ++i; } unlock(); return false; } bool sequence::intersectNotes( long position, long position_note, long& start, long& end, long& note ) { lock(); list::iterator on = m_list_event.begin(); list::iterator off = m_list_event.begin(); while ( on != m_list_event.end() ) { if (position_note == (*on).get_note() && (*on).is_note_on()) { // find next "off" event for the note off = on; ++off; while (off != m_list_event.end() && ((*on).get_note() != (*off).get_note() || (*off).is_note_on())) { ++off; } if ((*on).get_note() == (*off).get_note() && (*off).is_note_off() && (*on).get_timestamp() <= position && position <= (*off).get_timestamp()) { start = (*on).get_timestamp(); end = (*off).get_timestamp(); note = (*on).get_note(); unlock(); return true; } } ++on; } unlock(); return false; } bool sequence::intersectEvents( long posstart, long posend, long status, long& start ) { lock(); list::iterator on = m_list_event.begin(); while ( on != m_list_event.end() ) { //printf( "intersect looking for:%ld found:%ld\n", status, (*on).get_status() ); if (status == (*on).get_status()) { if ((*on).get_timestamp() <= posstart && posstart <= ((*on).get_timestamp()+(posend-posstart))) { start = (*on).get_timestamp(); unlock(); return true; } } ++on; } unlock(); return false; } void sequence::grow_trigger (long a_tick_from, long a_tick_to, long a_length) { lock(); list::iterator i = m_list_trigger.begin(); while ( i != m_list_trigger.end() ){ // Find our pair if ((*i).m_tick_start <= a_tick_from && (*i).m_tick_end >= a_tick_from ) { long start = (*i).m_tick_start; long end = (*i).m_tick_end; if ( a_tick_to < start ) { start = a_tick_to; } if ( (a_tick_to + a_length - 1) > end ) { end = (a_tick_to + a_length - 1); } add_trigger( start, end - start + 1, (*i).m_offset ); break; } ++i; } unlock(); } void sequence::del_trigger( long a_tick ) { lock(); list::iterator i = m_list_trigger.begin(); while ( i != m_list_trigger.end() ){ if ((*i).m_tick_start <= a_tick && (*i).m_tick_end >= a_tick ){ m_list_trigger.erase(i); break; } ++i; } unlock(); } void sequence::set_trigger_offset( long a_trigger_offset ) { lock(); m_trigger_offset = (a_trigger_offset % m_length); m_trigger_offset += m_length; m_trigger_offset %= m_length; unlock(); } long sequence::get_trigger_offset() { return m_trigger_offset; } void sequence::split_trigger( trigger &trig, long a_split_tick) { lock(); long new_tick_end = trig.m_tick_end; long new_tick_start = a_split_tick; trig.m_tick_end = a_split_tick - 1; long length = new_tick_end - new_tick_start; if ( length > 1 ) add_trigger( new_tick_start, length + 1, trig.m_offset ); unlock(); } #if 0 /* |...|...|...|...|...|...|... 0123456789abcdef0123456789abcdef [ ][ ][ ][ ][ ][ [ ][ ][ ][][][][][ ] [ ][ ] 0 4 4 0 7 4 2 0 6 2 0 4 4 0 1 4 6 0 2 6 inverse offset [ ][ ][ ] [ ][ ][ ][][][][][ ] [ ][ ] 0 c 4 0 f c a 8 e a 0 4 c 0 1 4 6 8 2 6 inverse offset [ ][ [ ][ ][ ][][][][][ ] [ ][ ] k g f c a 8 0 4 c g h k m n inverse offset 0123456789abcdefghijklmonpq ponmlkjihgfedcba9876543210 0fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210 */ #endif void sequence::adjust_trigger_offsets_to_legnth( long a_new_len ) { lock(); // for all triggers, and undo triggers list::iterator i = m_list_trigger.begin(); while ( i != m_list_trigger.end() ){ i->m_offset = adjust_offset( i->m_offset ); i->m_offset = m_length - i->m_offset; // flip long inverse_offset = m_length - (i->m_tick_start % m_length); long local_offset = (inverse_offset - i->m_offset); local_offset %= m_length; long inverse_offset_new = a_new_len - (i->m_tick_start % a_new_len); long new_offset = inverse_offset_new - local_offset; i->m_offset = (new_offset % a_new_len); i->m_offset = a_new_len - i->m_offset; ++i; } unlock(); } #if 0 ... a [ ][ ] ... ... a ... 5 7 play 3 offset 8 10 play X...X...X...X...X...X...X...X...X...X... L R [ ] [ ] [] orig [ ] << [ ] [ ][ ] [] split on the R marker, shift first [ ] [ ] delete middle [ ][ ] [] move ticks [ ][ ] L R [ ][ ] [ ] [] split on L [ ][ ] [ ] [ ] [ ] [] increase all after L [ ] [ ] #endif void sequence::copy_triggers( long a_start_tick, long a_distance ) { long from_start_tick = a_start_tick + a_distance; long from_end_tick = from_start_tick + a_distance - 1; lock(); move_triggers( a_start_tick, a_distance, true ); list::iterator i = m_list_trigger.begin(); while( i != m_list_trigger.end() ){ if ( (*i).m_tick_start >= from_start_tick && (*i).m_tick_start <= from_end_tick ) { trigger e; e.m_offset = (*i).m_offset; e.m_selected = false; e.m_tick_start = (*i).m_tick_start - a_distance; if ((*i).m_tick_end <= from_end_tick ) { e.m_tick_end = (*i).m_tick_end - a_distance; } if ((*i).m_tick_end > from_end_tick ) { e.m_tick_end = from_start_tick -1; } e.m_offset += (m_length - (a_distance % m_length)); e.m_offset %= m_length; if ( e.m_offset < 0 ) e.m_offset += m_length; m_list_trigger.push_front( e ); } ++i; } m_list_trigger.sort(); unlock(); } void sequence::split_trigger( long a_tick ) { lock(); list::iterator i = m_list_trigger.begin(); while( i != m_list_trigger.end() ){ // trigger greater than L and R if ( (*i).m_tick_start <= a_tick && (*i).m_tick_end >= a_tick ) { //printf( "split trigger %ld %ld\n", (*i).m_tick_start, (*i).m_tick_end ); { long tick = (*i).m_tick_end - (*i).m_tick_start; tick += 1; tick /= 2; split_trigger(*i, (*i).m_tick_start + tick); break; } } ++i; } unlock(); } void sequence::move_triggers( long a_start_tick, long a_distance, bool a_direction ) { long a_end_tick = a_start_tick + a_distance; //printf( "move_triggers() a_start_tick[%d] a_distance[%d] a_direction[%d]\n", // a_start_tick, a_distance, a_direction ); lock(); list::iterator i = m_list_trigger.begin(); while( i != m_list_trigger.end() ){ // trigger greater than L and R if ( (*i).m_tick_start < a_start_tick && (*i).m_tick_end > a_start_tick ) { if ( a_direction ) // forward { split_trigger(*i,a_start_tick); } else // back { split_trigger(*i,a_end_tick); } } // triggers on L if ( (*i).m_tick_start < a_start_tick && (*i).m_tick_end > a_start_tick ) { if ( a_direction ) // forward { split_trigger(*i,a_start_tick); } else // back { (*i).m_tick_end = a_start_tick - 1; } } // In betweens if ( (*i).m_tick_start >= a_start_tick && (*i).m_tick_end <= a_end_tick && !a_direction ) { m_list_trigger.erase(i); i = m_list_trigger.begin(); } // triggers on R if ( (*i).m_tick_start < a_end_tick && (*i).m_tick_end > a_end_tick ) { if ( !a_direction ) // forward { (*i).m_tick_start = a_end_tick; } } ++i; } i = m_list_trigger.begin(); while( i != m_list_trigger.end() ){ if ( a_direction ) // forward { if ( (*i).m_tick_start >= a_start_tick ){ (*i).m_tick_start += a_distance; (*i).m_tick_end += a_distance; (*i).m_offset += a_distance; (*i).m_offset %= m_length; } } else // back { if ( (*i).m_tick_start >= a_end_tick ){ (*i).m_tick_start -= a_distance; (*i).m_tick_end -= a_distance; (*i).m_offset += (m_length - (a_distance % m_length)); (*i).m_offset %= m_length; } } (*i).m_offset = adjust_offset( (*i).m_offset ); ++i; } unlock(); } long sequence::get_selected_trigger_start_tick() { long ret = -1; lock(); list::iterator i = m_list_trigger.begin(); while( i != m_list_trigger.end() ){ if ( i->m_selected ){ ret = i->m_tick_start; } ++i; } unlock(); return ret; } long sequence::get_selected_trigger_end_tick() { long ret = -1; lock(); list::iterator i = m_list_trigger.begin(); while( i != m_list_trigger.end() ){ if ( i->m_selected ){ ret = i->m_tick_end; } ++i; } unlock(); return ret; } void sequence::move_selected_triggers_to( long a_tick, bool a_adjust_offset, int a_which ) { lock(); long min_tick = 0; long max_tick = 0x7ffffff; list::iterator i = m_list_trigger.begin(); list::iterator s = m_list_trigger.begin(); // min_tick][0 1][max_tick // 2 while( i != m_list_trigger.end() ){ if ( i->m_selected ){ s = i; if ( i != m_list_trigger.end() && ++i != m_list_trigger.end()) { max_tick = (*i).m_tick_start - 1; } // if we are moving the 0, use first as offset // if we are moving the 1, use the last as the offset // if we are moving both (2), use first as offset long a_delta_tick = 0; if ( a_which == 1 ) { a_delta_tick = a_tick - s->m_tick_end; if ( a_delta_tick > 0 && (a_delta_tick + s->m_tick_end) > max_tick ) { a_delta_tick = ((max_tick) - s->m_tick_end); } // not past first if ( a_delta_tick < 0 && (a_delta_tick + s->m_tick_end <= (s->m_tick_start + c_ppqn / 8 ))) { a_delta_tick = ((s->m_tick_start + c_ppqn / 8 ) - s->m_tick_end); } } if ( a_which == 0 ) { a_delta_tick = a_tick - s->m_tick_start; if ( a_delta_tick < 0 && (a_delta_tick + s->m_tick_start) < min_tick ) { a_delta_tick = ((min_tick) - s->m_tick_start); } // not past last if ( a_delta_tick > 0 && (a_delta_tick + s->m_tick_start >= (s->m_tick_end - c_ppqn / 8 ))) { a_delta_tick = ((s->m_tick_end - c_ppqn / 8 ) - s->m_tick_start); } } if ( a_which == 2 ) { a_delta_tick = a_tick - s->m_tick_start; if ( a_delta_tick < 0 && (a_delta_tick + s->m_tick_start) < min_tick ) { a_delta_tick = ((min_tick) - s->m_tick_start); } if ( a_delta_tick > 0 && (a_delta_tick + s->m_tick_end) > max_tick ) { a_delta_tick = ((max_tick) - s->m_tick_end); } } if ( a_which == 0 || a_which == 2 ) s->m_tick_start += a_delta_tick; if ( a_which == 1 || a_which == 2 ) s->m_tick_end += a_delta_tick; if ( a_adjust_offset ){ s->m_offset += a_delta_tick; s->m_offset = adjust_offset( s->m_offset ); } break; } else { min_tick = (*i).m_tick_end + 1; } ++i; } unlock(); } long sequence::get_max_trigger() { lock(); long ret; if ( m_list_trigger.size() > 0 ) ret = m_list_trigger.back().m_tick_end; else ret = 0; unlock(); return ret; } long sequence::adjust_offset( long a_offset ) { a_offset %= m_length; if ( a_offset < 0 ) a_offset += m_length; return a_offset; } bool sequence::get_trigger_state( long a_tick ) { lock(); bool ret = false; list::iterator i; for ( i = m_list_trigger.begin(); i != m_list_trigger.end(); i++ ){ if ( (*i).m_tick_start <= a_tick && (*i).m_tick_end >= a_tick){ ret = true; break; } } unlock(); return ret; } bool sequence::select_trigger( long a_tick ) { lock(); bool ret = false; list::iterator i; for ( i = m_list_trigger.begin(); i != m_list_trigger.end(); i++ ){ if ( (*i).m_tick_start <= a_tick && (*i).m_tick_end >= a_tick){ (*i).m_selected = true; ret = true; } } unlock(); return ret; } bool sequence::unselect_triggers() { lock(); bool ret = false; list::iterator i; for ( i = m_list_trigger.begin(); i != m_list_trigger.end(); i++ ){ (*i).m_selected = false; } unlock(); return ret; } void sequence::del_selected_trigger() { lock(); list::iterator i; for ( i = m_list_trigger.begin(); i != m_list_trigger.end(); i++ ){ if ( i->m_selected ){ m_list_trigger.erase(i); break; } } unlock(); } void sequence::cut_selected_trigger() { copy_selected_trigger(); del_selected_trigger(); } void sequence::copy_selected_trigger() { lock(); list::iterator i; for ( i = m_list_trigger.begin(); i != m_list_trigger.end(); i++ ){ if ( i->m_selected ){ m_trigger_clipboard = *i; m_trigger_copied = true; break; } } unlock(); } void sequence::paste_trigger() { if ( m_trigger_copied ){ long length = m_trigger_clipboard.m_tick_end - m_trigger_clipboard.m_tick_start + 1; // paste at copy end add_trigger( m_trigger_clipboard.m_tick_end + 1, length, m_trigger_clipboard.m_offset + length ); m_trigger_clipboard.m_tick_start = m_trigger_clipboard.m_tick_end +1; m_trigger_clipboard.m_tick_end = m_trigger_clipboard.m_tick_start + length - 1; m_trigger_clipboard.m_offset += length; m_trigger_clipboard.m_offset = adjust_offset(m_trigger_clipboard.m_offset); } } /* this refreshes the play marker to the LastTick */ void sequence::reset_draw_marker() { lock(); m_iterator_draw = m_list_event.begin(); unlock(); } void sequence::reset_draw_trigger_marker() { lock(); m_iterator_draw_trigger = m_list_trigger.begin(); unlock(); } int sequence::get_lowest_note_event() { lock(); int ret = 127; list::iterator i; for ( i = m_list_event.begin(); i != m_list_event.end(); i++ ){ if ( (*i).is_note_on() || (*i).is_note_off() ) if ( (*i).get_note() < ret ) ret = (*i).get_note(); } unlock(); return ret; } int sequence::get_highest_note_event() { lock(); int ret = 0; list::iterator i; for ( i = m_list_event.begin(); i != m_list_event.end(); i++ ){ if ( (*i).is_note_on() || (*i).is_note_off() ) if ( (*i).get_note() > ret ) ret = (*i).get_note(); } unlock(); return ret; } draw_type sequence::get_next_note_event( long *a_tick_s, long *a_tick_f, int *a_note, bool *a_selected, int *a_velocity ) { draw_type ret = DRAW_FIN; *a_tick_f = 0; while ( m_iterator_draw != m_list_event.end() ) { *a_tick_s = (*m_iterator_draw).get_timestamp(); *a_note = (*m_iterator_draw).get_note(); *a_selected = (*m_iterator_draw).is_selected(); *a_velocity = (*m_iterator_draw).get_note_velocity(); /* note on, so its linked */ if( (*m_iterator_draw).is_note_on() && (*m_iterator_draw).is_linked() ){ *a_tick_f = (*m_iterator_draw).get_linked()->get_timestamp(); ret = DRAW_NORMAL_LINKED; m_iterator_draw++; return ret; } else if( (*m_iterator_draw).is_note_on() && (! (*m_iterator_draw).is_linked()) ){ ret = DRAW_NOTE_ON; m_iterator_draw++; return ret; } else if( (*m_iterator_draw).is_note_off() && (! (*m_iterator_draw).is_linked()) ){ ret = DRAW_NOTE_OFF; m_iterator_draw++; return ret; } /* keep going until we hit null or find a NoteOn */ m_iterator_draw++; } return DRAW_FIN; } bool sequence::get_next_event( unsigned char *a_status, unsigned char *a_cc) { unsigned char j; while ( m_iterator_draw != m_list_event.end() ){ *a_status = (*m_iterator_draw).get_status(); (*m_iterator_draw).get_data( a_cc, &j ); /* we have a good one */ /* update and return */ m_iterator_draw++; return true; } return false; } bool sequence::get_next_event( unsigned char a_status, unsigned char a_cc, long *a_tick, unsigned char *a_D0, unsigned char *a_D1, bool *a_selected ) { while ( m_iterator_draw != m_list_event.end() ){ /* note on, so its linked */ if( (*m_iterator_draw).get_status() == a_status ){ (*m_iterator_draw).get_data( a_D0, a_D1 ); *a_tick = (*m_iterator_draw).get_timestamp(); *a_selected = (*m_iterator_draw).is_selected(); /* either we have a control chage with the right CC or its a different type of event */ if ( (a_status == EVENT_CONTROL_CHANGE && *a_D0 == a_cc ) || (a_status != EVENT_CONTROL_CHANGE) ){ /* we have a good one */ /* update and return */ m_iterator_draw++; return true; } } /* keep going until we hit null or find a NoteOn */ m_iterator_draw++; } return false; } bool sequence::get_next_trigger( long *a_tick_on, long *a_tick_off, bool *a_selected, long *a_offset ) { while ( m_iterator_draw_trigger != m_list_trigger.end() ){ *a_tick_on = (*m_iterator_draw_trigger).m_tick_start; *a_selected = (*m_iterator_draw_trigger).m_selected; *a_offset = (*m_iterator_draw_trigger).m_offset; *a_tick_off = (*m_iterator_draw_trigger).m_tick_end; m_iterator_draw_trigger++; return true; } return false; } void sequence::remove_all() { lock(); m_list_event.clear(); unlock(); } sequence& sequence::operator= (const sequence& a_rhs) { lock(); /* dont copy to self */ if (this != &a_rhs){ m_list_event = a_rhs.m_list_event; m_list_trigger = a_rhs.m_list_trigger; m_midi_channel = a_rhs.m_midi_channel; m_masterbus = a_rhs.m_masterbus; m_bus = a_rhs.m_bus; m_name = a_rhs.m_name; m_length = a_rhs.m_length; m_time_beats_per_measure = a_rhs.m_time_beats_per_measure; m_time_beat_width = a_rhs.m_time_beat_width; m_playing = false; /* no notes are playing */ for (int i=0; i< c_midi_notes; i++ ) m_playing_notes[i] = 0; /* reset */ zero_markers( ); } verify_and_link(); unlock(); return *this; } void sequence::lock( ) { m_mutex.lock(); } void sequence::unlock( ) { m_mutex.unlock(); } const char* sequence::get_name() { return m_name.c_str(); } long sequence::get_last_tick( ) { return (m_last_tick + (m_length - m_trigger_offset)) % m_length; } void sequence::set_midi_bus( char a_mb ) { lock(); /* off notes except initial */ off_playing_notes( ); this->m_bus = a_mb; set_dirty(); unlock(); } char sequence::get_midi_bus( ) { return this->m_bus; } void sequence::set_length( long a_len, bool a_adjust_triggers ) { lock(); bool was_playing = get_playing(); /* turn everything off */ set_playing( false ); if ( a_len < (c_ppqn / 4) ) a_len = (c_ppqn /4); if ( a_adjust_triggers ) adjust_trigger_offsets_to_legnth( a_len ); m_length = a_len; verify_and_link(); reset_draw_marker(); /* start up and refresh */ if ( was_playing ) set_playing( true ); unlock(); } long sequence::get_length( ) { return m_length; } void sequence::set_playing( bool a_p ) { lock(); if ( a_p != get_playing() ) { if (a_p){ /* turn on */ m_playing = true; } else { /* turn off */ m_playing = false; off_playing_notes(); } //printf( "set_dirty\n"); set_dirty(); } m_queued = false; unlock(); } void sequence::toggle_playing() { set_playing( ! get_playing() ); } bool sequence::get_playing( ) { return m_playing; } void sequence::set_recording( bool a_r ) { lock(); m_recording = a_r; m_notes_on = 0; unlock(); } bool sequence::get_recording( ) { return m_recording; } void sequence::set_snap_tick( int a_st ) { lock(); m_snap_tick = a_st; unlock(); } void sequence::set_quanized_rec( bool a_qr ) { lock(); m_quanized_rec = a_qr; unlock(); } bool sequence::get_quanidez_rec( ) { return m_quanized_rec; } void sequence::set_thru( bool a_r ) { lock(); m_thru = a_r; unlock(); } bool sequence::get_thru( ) { return m_thru; } /* sets sequence name */ void sequence::set_name( char *a_name ) { m_name = a_name; set_dirty_mp(); } void sequence::set_name( string a_name ) { m_name = a_name; set_dirty_mp(); } void sequence::set_midi_channel( unsigned char a_ch ) { lock(); off_playing_notes( ); m_midi_channel = a_ch; set_dirty(); unlock(); } unsigned char sequence::get_midi_channel( ) { return m_midi_channel; } void sequence::print() { printf("[%s]\n", m_name.c_str() ); for( list::iterator i = m_list_event.begin(); i != m_list_event.end(); i++ ) (*i).print(); printf("events[%zd]\n\n",m_list_event.size()); } void sequence::print_triggers() { printf("[%s]\n", m_name.c_str() ); for( list::iterator i = m_list_trigger.begin(); i != m_list_trigger.end(); i++ ){ /*long d= c_ppqn / 8;*/ printf (" tick_start[%ld] tick_end[%ld] off[%ld]\n", (*i).m_tick_start, (*i).m_tick_end, (*i).m_offset ); } } void sequence::put_event_on_bus( event *a_e ) { lock(); unsigned char note = a_e->get_note(); bool skip = false; if ( a_e->is_note_on() ){ m_playing_notes[note]++; } if ( a_e->is_note_off() ){ if ( m_playing_notes[note] <= 0 ){ skip = true; } else { m_playing_notes[note]--; } } if ( !skip ){ m_masterbus->play( m_bus, a_e, m_midi_channel ); } m_masterbus->flush(); unlock(); } void sequence::off_playing_notes() { lock(); event e; for ( int x=0; x< c_midi_notes; x++ ){ while( m_playing_notes[x] > 0 ){ e.set_status( EVENT_NOTE_OFF ); e.set_data( x, 0 ); m_masterbus->play( m_bus, &e, m_midi_channel ); m_playing_notes[x]--; } } m_masterbus->flush(); unlock(); } /* change */ void sequence::select_events( unsigned char a_status, unsigned char a_cc, bool a_inverse ) { lock(); unsigned char d0, d1; list::iterator i; for ( i = m_list_event.begin(); i != m_list_event.end(); i++ ){ /* initially false */ bool set = false; (*i).get_data( &d0, &d1 ); /* correct status and not CC */ if ( a_status != EVENT_CONTROL_CHANGE && (*i).get_status() == a_status ) set = true; /* correct status and correct cc */ if ( a_status == EVENT_CONTROL_CHANGE && (*i).get_status() == a_status && d0 == a_cc ) set = true; if ( set ){ if ( a_inverse ){ if ( !(*i).is_selected( ) ) (*i).select( ); else (*i).unselect( ); } else (*i).select( ); } } unlock(); } void sequence::transpose_notes( int a_steps, int a_scale ) { event e; list transposed_events; lock(); mark_selected(); list::iterator i; const int *transpose_table = NULL; if ( a_steps < 0 ){ transpose_table = &c_scales_transpose_dn[a_scale][0]; a_steps *= -1; } else { transpose_table = &c_scales_transpose_up[a_scale][0]; } for ( i = m_list_event.begin(); i != m_list_event.end(); i++ ){ /* is it being moved ? */ if ( ((*i).get_status() == EVENT_NOTE_ON || (*i).get_status() == EVENT_NOTE_OFF) && (*i).is_marked() ){ e = (*i); e.unmark(); int note = e.get_note(); bool off_scale = false; if ( transpose_table[note % 12] == 0 ){ off_scale = true; note -= 1; } for( int x=0; x::iterator i; list quantized_events; mark_selected(); for ( i = m_list_event.begin(); i != m_list_event.end(); i++ ){ /* initially false */ bool set = false; (*i).get_data( &d0, &d1 ); /* correct status and not CC */ if ( a_status != EVENT_CONTROL_CHANGE && (*i).get_status() == a_status ) set = true; /* correct status and correct cc */ if ( a_status == EVENT_CONTROL_CHANGE && (*i).get_status() == a_status && d0 == a_cc ) set = true; if( !(*i).is_marked() ) set = false; if ( set ){ /* copy event */ e = (*i); (*i).select(); e.unmark(); long timestamp = e.get_timestamp(); long timestamp_remander = (timestamp % a_snap_tick); long timestamp_delta = 0; if ( timestamp_remander < a_snap_tick/2 ){ timestamp_delta = - (timestamp_remander / a_divide ); } else { timestamp_delta = (a_snap_tick - timestamp_remander) / a_divide; } if ((timestamp_delta + timestamp) >= m_length) { timestamp_delta = - e.get_timestamp() ; } e.set_timestamp( e.get_timestamp() + timestamp_delta ); quantized_events.push_front(e); if ( (*i).is_linked() && a_linked ){ f = *(*i).get_linked(); f.unmark(); (*i).get_linked()->select(); f.set_timestamp( f.get_timestamp() + timestamp_delta ); quantized_events.push_front(f); } } } remove_marked(); quantized_events.sort(); m_list_event.merge(quantized_events); verify_and_link(); unlock(); } void addListVar( list *a_list, long a_var ) { long buffer; buffer = a_var & 0x7F; /* we shift it right 7, if there is still set bits, encode into buffer in reverse order */ while ( ( a_var >>= 7) ){ buffer <<= 8; buffer |= ((a_var & 0x7F) | 0x80); } while (true){ a_list->push_front( (char) buffer & 0xFF ); if (buffer & 0x80) buffer >>= 8; else break; } } void addLongList( list *a_list, long a_x ) { a_list->push_front( (a_x & 0xFF000000) >> 24 ); a_list->push_front( (a_x & 0x00FF0000) >> 16 ); a_list->push_front( (a_x & 0x0000FF00) >> 8 ); a_list->push_front( (a_x & 0x000000FF) ); } void sequence::fill_list( list *a_list, int a_pos ) { lock(); /* clear list */ *a_list = list(); /* sequence number */ addListVar( a_list, 0 ); a_list->push_front( 0xFF ); a_list->push_front( 0x00 ); a_list->push_front( 0x02 ); a_list->push_front( (a_pos & 0xFF00) >> 8 ); a_list->push_front( (a_pos & 0x00FF) ); /* name */ addListVar( a_list, 0 ); a_list->push_front( 0xFF ); a_list->push_front( 0x03 ); int length = m_name.length(); if ( length > 0x7F ) length = 0x7f; a_list->push_front( length ); for ( int i=0; i< length; i++ ) a_list->push_front( m_name.c_str()[i] ); long timestamp = 0, delta_time = 0, prev_timestamp = 0; list::iterator i; for ( i = m_list_event.begin(); i != m_list_event.end(); i++ ){ event e = (*i); timestamp = e.get_timestamp(); delta_time = timestamp - prev_timestamp; prev_timestamp = timestamp; /* encode delta_time */ addListVar( a_list, delta_time ); /* now that the timestamp is encoded, do the status and data */ a_list->push_front( e.m_status | m_midi_channel ); switch( e.m_status & 0xF0 ){ case 0x80: case 0x90: case 0xA0: case 0xB0: case 0xE0: a_list->push_front( e.m_data[0] ); a_list->push_front( e.m_data[1] ); //printf ( "- d[%2X %2X]\n" , e.m_data[0], e.m_data[1] ); break; case 0xC0: case 0xD0: a_list->push_front( e.m_data[0] ); //printf ( "- d[%2X]\n" , e.m_data[0] ); break; default: break; } } int num_triggers = m_list_trigger.size(); list::iterator t = m_list_trigger.begin(); list::iterator p; addListVar( a_list, 0 ); a_list->push_front( 0xFF ); a_list->push_front( 0x7F ); addListVar( a_list, (num_triggers * 3 * 4) + 4); addLongList( a_list, c_triggers_new ); //printf( "num_triggers[%d]\n", num_triggers ); for ( int i=0; i start[%d] end[%d] offset[%d]\n", // (*t).m_tick_start, (*t).m_tick_end, (*t).m_offset ); addLongList( a_list, (*t).m_tick_start ); addLongList( a_list, (*t).m_tick_end ); addLongList( a_list, (*t).m_offset ); t++; } /* bus */ addListVar( a_list, 0 ); a_list->push_front( 0xFF ); a_list->push_front( 0x7F ); a_list->push_front( 0x05 ); addLongList( a_list, c_midibus ); a_list->push_front( m_bus ); /* timesig */ addListVar( a_list, 0 ); a_list->push_front( 0xFF ); a_list->push_front( 0x7F ); a_list->push_front( 0x06 ); addLongList( a_list, c_timesig ); a_list->push_front( m_time_beats_per_measure ); a_list->push_front( m_time_beat_width ); /* channel */ addListVar( a_list, 0 ); a_list->push_front( 0xFF ); a_list->push_front( 0x7F ); a_list->push_front( 0x05 ); addLongList( a_list, c_midich ); a_list->push_front( m_midi_channel ); delta_time = m_length - prev_timestamp; /* meta track end */ addListVar( a_list, delta_time ); a_list->push_front( 0xFF ); a_list->push_front( 0x2F ); a_list->push_front( 0x00 ); unlock(); } // list triggers; // /* triggers */ // list::iterator t; // for ( t = m_list_trigger.begin(); t != m_list_trigger.end(); t++ ){ // addLongList( &triggers, (*t).m_tick ); // printf ( "[%ld]\n", (*t).m_tick ); // } // addListVar( a_list, 0 ); // a_list->push_front( 0xFF ); // a_list->push_front( 0x7F ); // a_list->push_front( 0x05 ); // addLongList( a_list, c_triggersmidibus ); seq24-0.9.3/src/midibus_portmidi.h0000644000175000017500000001123212651156360013711 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #pragma once class midibus; class mastermidibus; #ifdef __WIN32__ #include #include "portmidi.h" #include "event.h" #include "sequence.h" #include "mutex.h" #include "globals.h" const int c_midibus_output_size = 0x100000; const int c_midibus_input_size = 0x100000; const int c_midibus_sysex_chunk = 0x100; enum clock_e { e_clock_off, e_clock_pos, e_clock_mod }; class midibus { private: char m_id; char m_pm_num; clock_e m_clock_type; bool m_inputing; static int m_clock_mod; /* name of bus */ string m_name; /* last tick */ long m_lasttick; /* locking */ mutex m_mutex; /* mutex */ void lock(); void unlock(); PortMidiStream* m_pms; public: midibus( char a_id, char a_pm_num, const char *a_client_name ); ~midibus(); bool init_out( ); bool init_in( ); void print(); string get_name(); int get_id(); /* puts an event in the queue */ void play( event *a_e24, unsigned char a_channel ); void sysex( event *a_e24 ); int poll_for_midi( ); /* clock */ void start(); void stop(); void clock( long a_tick ); void continue_from( long a_tick ); void init_clock( long a_tick ); void set_clock( clock_e a_clocking ); clock_e get_clock( ); void set_input( bool a_inputing ); bool get_input( ); void flush(); //void remove_queued_on_events( int a_tag ); /* master midi bus sets up the bus */ friend class mastermidibus; /* address of client */ #if HAVE_LIBASOUND int get_client(void) { return m_dest_addr_client; }; int get_port(void) { return m_dest_addr_port; }; #endif static void set_clock_mod( int a_clock_mod ); static int get_clock_mod(); }; class mastermidibus { private: /* sequencer client handle */ #if HAVE_LIBASOUND snd_seq_t *m_alsa_seq; #endif int m_num_out_buses; int m_num_in_buses; midibus *m_buses_out[c_maxBuses]; midibus *m_buses_in[c_maxBuses]; midibus *m_bus_announce; bool m_buses_out_active[c_maxBuses]; bool m_buses_in_active[c_maxBuses]; bool m_buses_out_init[c_maxBuses]; bool m_buses_in_init[c_maxBuses]; clock_e m_init_clock[c_maxBuses]; bool m_init_input[c_maxBuses]; /* id of queue */ int m_queue; int m_ppqn; int m_bpm; int m_num_poll_descriptors; struct pollfd *m_poll_descriptors; /* for dumping midi input to sequence for recording */ bool m_dumping_input; sequence *m_seq; /* locking */ mutex m_mutex; /* mutex */ void lock(); void unlock(); public: mastermidibus(); ~mastermidibus(); //midibus *get_default_bus(); //midibus *get_bus( int a_bus ); void init(); int get_num_out_buses(); int get_num_in_buses(); void set_bpm(int a_bpm); void set_ppqn(int a_ppqn); int get_bpm(){ return m_bpm;} int get_ppqn(){ return m_ppqn;} string get_midi_out_bus_name( int a_bus ); string get_midi_in_bus_name( int a_bus ); void print(); void flush(); void start(); void stop(); void clock( long a_tick ); void continue_from( long a_tick ); void init_clock( long a_tick ); int poll_for_midi( ); bool is_more_input( ); bool get_midi_event( event *a_in ); void set_sequence_input( bool a_state, sequence *a_seq ); bool is_dumping( ) { return m_dumping_input; } sequence* get_sequence( ) { return m_seq; } void sysex( event *a_event ); void play( unsigned char a_bus, event *a_e24, unsigned char a_channel ); void set_clock( unsigned char a_bus, clock_e a_clock_type ); clock_e get_clock( unsigned char a_bus ); void set_input( unsigned char a_bus, bool a_inputing ); bool get_input( unsigned char a_bus ); }; #endif seq24-0.9.3/src/mainwid.cpp0000644000175000017500000003626712651156360012350 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #include "mainwid.h" #include "seqedit.h" #include "font.h" const char mainwid::m_seq_to_char[c_seqs_in_set] = { '1', 'Q', 'A', 'Z', '2', 'W', 'S', 'X', '3', 'E', 'D', 'C', '4', 'R', 'F', 'V', '5', 'T', 'G', 'B', '6', 'Y', 'H', 'N', '7', 'U', 'J', 'M', '8', 'I', 'K', ',' }; // Constructor mainwid::mainwid( perform *a_p ): seqmenu( a_p ), m_black(Gdk::Color("black")), m_white(Gdk::Color("white")), m_grey (Gdk::Color("grey")), m_screenset(0), m_mainperf(a_p), m_window_x(c_mainwid_x), m_window_y(c_mainwid_y), m_button_down(false), m_moving(false) { using namespace Menu_Helpers; Glib::RefPtr colormap = get_default_colormap(); colormap->alloc_color( m_black ); colormap->alloc_color( m_white ); colormap->alloc_color( m_grey ); set_size_request( c_mainwid_x, c_mainwid_y ); add_events( Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK | Gdk::KEY_PRESS_MASK | Gdk::BUTTON_MOTION_MASK | Gdk::FOCUS_CHANGE_MASK ); set_double_buffered( false ); } // GTK, on realize of window, init shiz void mainwid::on_realize() { // we need to do the default realize Gtk::DrawingArea::on_realize(); set_flags( Gtk::CAN_FOCUS ); // Now we can allocate any additional resources we need m_window = get_window(); m_gc = Gdk::GC::create( m_window ); m_window->clear(); p_font_renderer->init( m_window ); m_pixmap = Gdk::Pixmap::create(m_window, c_mainwid_x, c_mainwid_y, -1 ); fill_background_window(); draw_sequences_on_pixmap(); } // Fills Pixmap void mainwid::draw_sequences_on_pixmap() { for ( int i=0; i< c_mainwnd_rows * c_mainwnd_cols; i++ ){ draw_sequence_on_pixmap( i + (m_screenset * c_mainwnd_rows * c_mainwnd_cols )); m_last_tick_x[ i + (m_screenset * c_mainwnd_rows * c_mainwnd_cols) ] = 0; } } // updates background void mainwid::fill_background_window() { /* clear background */ m_pixmap->draw_rectangle(this->get_style()->get_bg_gc(Gtk::STATE_NORMAL), true, 0, 0, m_window_x, m_window_y ); } int mainwid::timeout() { return true; } // Draws a specific sequence on the Pixmap void mainwid::draw_sequence_on_pixmap( int a_seq ) { if ( a_seq >= (m_screenset * c_mainwnd_rows * c_mainwnd_cols ) && a_seq < ((m_screenset+1) * c_mainwnd_rows * c_mainwnd_cols )){ int i = (a_seq / c_mainwnd_rows) % c_mainwnd_cols; int j = a_seq % c_mainwnd_rows; int base_x = (c_mainwid_border + (c_seqarea_x + c_mainwid_spacing) * i); int base_y = (c_mainwid_border + (c_seqarea_y + c_mainwid_spacing) * j); /*int local_seq = a_seq % c_seqs_in_set;*/ m_gc->set_foreground(m_black); m_pixmap->draw_rectangle(m_gc, true, base_x, base_y, c_seqarea_x, c_seqarea_y ); if ( m_mainperf->is_active( a_seq )){ sequence *seq = m_mainperf->get_sequence( a_seq ); if ( seq->get_playing() ){ m_last_playing[a_seq] = true; m_background = m_black; m_foreground = m_white; } else { m_last_playing[a_seq] = false; m_background = m_white; m_foreground = m_black; } m_gc->set_foreground(m_background); m_pixmap->draw_rectangle(m_gc,true, base_x + 1, base_y + 1, c_seqarea_x - 2, c_seqarea_y - 2 ); m_gc->set_foreground(m_foreground); char name[20]; snprintf( name, sizeof name, "%.13s", seq->get_name() ); font::Color col = font::BLACK;; if ( m_foreground == m_black ){ col = font::BLACK; } if ( m_foreground == m_white ){ col = font::WHITE; } p_font_renderer->render_string_on_drawable( m_gc, base_x + c_text_x, base_y + 4, m_pixmap, name, col); /* midi channel + key + timesig */ /*char key = m_seq_to_char[local_seq];*/ char str[20]; if (m_mainperf->show_ui_sequence_key()) { snprintf( str, sizeof str, "%c", (char)m_mainperf->lookup_keyevent_key( a_seq ) ); p_font_renderer->render_string_on_drawable(m_gc, base_x + c_seqarea_x - 7, base_y + c_text_y * 4 - 2, m_pixmap, str, col ); } snprintf( str, sizeof str, "%d-%d %ld/%ld", seq->get_midi_bus(), seq->get_midi_channel()+1, seq->get_bpm(), seq->get_bw() ); p_font_renderer->render_string_on_drawable(m_gc, base_x + c_text_x, base_y + c_text_y * 4 - 2, m_pixmap, str, col ); int rectangle_x = base_x + c_text_x - 1; int rectangle_y = base_y + c_text_y + c_text_x - 1; if ( seq->get_queued() ){ m_gc->set_foreground(m_grey); m_pixmap->draw_rectangle(m_gc,true, rectangle_x - 2, rectangle_y - 1, c_seqarea_seq_x + 3, c_seqarea_seq_y + 3 ); m_foreground = m_black; } m_gc->set_foreground(m_foreground); m_pixmap->draw_rectangle(m_gc,false, rectangle_x - 2, rectangle_y - 1, c_seqarea_seq_x + 3, c_seqarea_seq_y + 3 ); int lowest_note = seq->get_lowest_note_event( ); int highest_note = seq->get_highest_note_event( ); int height = highest_note - lowest_note; height += 2; int length = seq->get_length( ); long tick_s; long tick_f; int note; bool selected; int velocity; draw_type dt; seq->reset_draw_marker(); while ( (dt = seq->get_next_note_event( &tick_s, &tick_f, ¬e, &selected, &velocity )) != DRAW_FIN ){ int note_y = c_seqarea_seq_y - (c_seqarea_seq_y * (note + 1 - lowest_note)) / height ; int tick_s_x = (tick_s * c_seqarea_seq_x) / length; int tick_f_x = (tick_f * c_seqarea_seq_x) / length; if ( dt == DRAW_NOTE_ON || dt == DRAW_NOTE_OFF ) tick_f_x = tick_s_x + 1; if ( tick_f_x <= tick_s_x ) tick_f_x = tick_s_x + 1; m_gc->set_foreground(m_foreground); m_pixmap->draw_line(m_gc, rectangle_x + tick_s_x, rectangle_y + note_y, rectangle_x + tick_f_x, rectangle_y + note_y ); } } else { /* not active */ m_gc->set_foreground(m_grey); m_pixmap->draw_rectangle( this->get_style()->get_bg_gc(Gtk::STATE_NORMAL), true, base_x + 4, base_y, c_seqarea_x - 8, c_seqarea_y ); m_pixmap->draw_rectangle( this->get_style()->get_bg_gc(Gtk::STATE_NORMAL), true, base_x + 1, base_y + 1, c_seqarea_x - 2, c_seqarea_y - 2 ); } } } void mainwid::draw_sequence_pixmap_on_window( int a_seq ) { if ( a_seq >= (m_screenset * c_mainwnd_rows * c_mainwnd_cols ) && a_seq < ((m_screenset+1) * c_mainwnd_rows * c_mainwnd_cols )){ int i = (a_seq / c_mainwnd_rows) % c_mainwnd_cols; int j = a_seq % c_mainwnd_rows; int base_x = (c_mainwid_border + (c_seqarea_x + c_mainwid_spacing) * i); int base_y = (c_mainwid_border + (c_seqarea_y + c_mainwid_spacing) * j); m_window->draw_drawable(m_gc, m_pixmap, base_x, base_y, base_x, base_y, c_seqarea_x, c_seqarea_y ); } } void mainwid::redraw( int a_sequence ) { draw_sequence_on_pixmap( a_sequence ); draw_sequence_pixmap_on_window( a_sequence ); } void mainwid::update_markers( int a_ticks ) { for ( int i=0; i< c_mainwnd_rows * c_mainwnd_cols; i++ ) draw_marker_on_sequence( i + (m_screenset * c_mainwnd_rows * c_mainwnd_cols ), a_ticks); } void mainwid::draw_marker_on_sequence( int a_seq, int a_tick ) { if ( m_mainperf->is_dirty_main(a_seq ) ){ update_sequence_on_window( a_seq ); } if ( m_mainperf->is_active( a_seq )){ sequence *seq = m_mainperf->get_sequence( a_seq ); int i = (a_seq / c_mainwnd_rows) % c_mainwnd_cols; int j = a_seq % c_mainwnd_rows; int base_x = (c_mainwid_border + (c_seqarea_x + c_mainwid_spacing) * i); int base_y = (c_mainwid_border + (c_seqarea_y + c_mainwid_spacing) * j); int rectangle_x = base_x + c_text_x - 1; int rectangle_y = base_y + c_text_y + c_text_x - 1; int length = seq->get_length( ); a_tick += (length - seq->get_trigger_offset( )); a_tick %= length; long tick_x = a_tick * c_seqarea_seq_x / length; m_window->draw_drawable(m_gc, m_pixmap, rectangle_x + m_last_tick_x[a_seq], rectangle_y + 1, rectangle_x + m_last_tick_x[a_seq], rectangle_y + 1, 1, c_seqarea_seq_y ); m_last_tick_x[a_seq] = tick_x; if ( seq->get_playing() ){ m_gc->set_foreground(m_white); } else { m_gc->set_foreground(m_black); } if ( seq->get_queued()){ m_gc->set_foreground(m_black); } m_window->draw_line(m_gc, rectangle_x + tick_x, rectangle_y + 1, rectangle_x + tick_x, rectangle_y + c_seqarea_seq_y ); //if ( seq->get_playing() ){ // //} } } void mainwid::update_sequences_on_window() { draw_sequences_on_pixmap( ); draw_pixmap_on_window(); } void mainwid::update_sequence_on_window( int a_seq ) { draw_sequence_on_pixmap( a_seq ); draw_sequence_pixmap_on_window( a_seq ); } // queues blit of pixmap to window void mainwid::draw_pixmap_on_window() { queue_draw(); } // GTK expose event bool mainwid::on_expose_event(GdkEventExpose* a_e) { m_window->draw_drawable(m_gc, m_pixmap, a_e->area.x, a_e->area.y, a_e->area.x, a_e->area.y, a_e->area.width, a_e->area.height ); return true; } // Translates XY corridinates to a sequence number int mainwid::seq_from_xy( int a_x, int a_y ) { /* adjust for border */ int x = a_x - c_mainwid_border; int y = a_y - c_mainwid_border; /* is it in the box ? */ if ( x < 0 || x >= ((c_seqarea_x + c_mainwid_spacing ) * c_mainwnd_cols ) || y < 0 || y >= ((c_seqarea_y + c_mainwid_spacing ) * c_mainwnd_rows )){ return -1; } /* gives us in box corrdinates */ int box_test_x = x % (c_seqarea_x + c_mainwid_spacing); int box_test_y = y % (c_seqarea_y + c_mainwid_spacing); /* right inactive side of area */ if ( box_test_x > c_seqarea_x || box_test_y > c_seqarea_y ){ return -1; } x /= (c_seqarea_x + c_mainwid_spacing); y /= (c_seqarea_y + c_mainwid_spacing); int sequence = ( (x * c_mainwnd_rows + y) + ( m_screenset * c_mainwnd_rows * c_mainwnd_cols )); return sequence; } // press a mouse button bool mainwid::on_button_press_event(GdkEventButton* a_p0) { grab_focus(); m_current_seq = seq_from_xy( (int) a_p0->x, (int) a_p0->y ); if ( m_current_seq != -1 && a_p0->button == 1 ){ m_button_down = true; } return true; } bool mainwid::on_button_release_event(GdkEventButton* a_p0) { m_current_seq = seq_from_xy( (int) a_p0->x, (int) a_p0->y ); m_button_down = false; /* it hit a sequence ? */ // toggle play mode of sequence (left button) if ( m_current_seq != -1 && a_p0->button == 1 && !m_moving ){ if ( m_mainperf->is_active( m_current_seq )){ //sequence *seq = m_mainperf->get_sequence( m_current_seq ); //seq->set_playing( !seq->get_playing() ); m_mainperf->sequence_playing_toggle( m_current_seq ); draw_sequence_on_pixmap( m_current_seq ); draw_sequence_pixmap_on_window( m_current_seq); } } if ( a_p0->button == 1 && m_moving ){ m_moving = false; if ( ! m_mainperf->is_active( m_current_seq ) && m_current_seq != -1 && !m_mainperf->is_sequence_in_edit( m_current_seq ) ){ m_mainperf->new_sequence( m_current_seq ); *(m_mainperf->get_sequence( m_current_seq )) = m_moving_seq; draw_sequence_on_pixmap( m_current_seq ); draw_sequence_pixmap_on_window( m_current_seq ); } else { m_mainperf->new_sequence( m_old_seq ); *(m_mainperf->get_sequence( m_old_seq )) = m_moving_seq; draw_sequence_on_pixmap( m_old_seq ); draw_sequence_pixmap_on_window( m_old_seq ); } } // launch menu (right button) if ( m_current_seq != -1 && a_p0->button == 3 ){ popup_menu(); } return true; } bool mainwid::on_motion_notify_event(GdkEventMotion* a_p0) { int seq = seq_from_xy( (int) a_p0->x, (int) a_p0->y ); if ( m_button_down ){ if ( seq != m_current_seq && !m_moving && !m_mainperf->is_sequence_in_edit( m_current_seq ) ){ if ( m_mainperf->is_active( m_current_seq )){ m_old_seq = m_current_seq; m_moving = true; m_moving_seq = *(m_mainperf->get_sequence( m_current_seq )); m_mainperf->delete_sequence( m_current_seq ); draw_sequence_on_pixmap( m_current_seq ); draw_sequence_pixmap_on_window( m_current_seq ); } } } return true; } // redraws everything, queues redraw void mainwid::reset( ) { draw_sequences_on_pixmap(); draw_pixmap_on_window(); } //int //mainwid::get_screenset( ) //{ // return m_screenset; //} void mainwid::set_screenset( int a_ss ) { m_screenset = a_ss; if ( m_screenset < 0 ) m_screenset = c_max_sets - 1; if ( m_screenset >= c_max_sets ) m_screenset = 0; m_mainperf->set_offset(m_screenset); reset(); } mainwid::~mainwid( ) { } bool mainwid::on_focus_in_event(GdkEventFocus*) { set_flags(Gtk::HAS_FOCUS); return false; } bool mainwid::on_focus_out_event(GdkEventFocus*) { unset_flags(Gtk::HAS_FOCUS); return false; } seq24-0.9.3/src/midifile.cpp0000644000175000017500000005163512321052410012457 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #include #include "midifile.h" midifile::midifile(const Glib::ustring& a_name) : m_pos(0), m_name(a_name) { } midifile::~midifile () { } unsigned long midifile::read_long () { unsigned long ret = 0; ret += (read_byte() << 24); ret += (read_byte() << 16); ret += (read_byte() << 8); ret += (read_byte()); return ret; } unsigned short midifile::read_short () { unsigned short ret = 0; ret += (read_byte() << 8); ret += (read_byte()); //printf( "read_short 0x%4x\n", ret ); return ret; } unsigned char midifile::read_byte () { return m_d[m_pos++]; } unsigned long midifile::read_var () { unsigned long ret = 0; unsigned char c; /* while bit #7 is set */ while (((c = read_byte()) & 0x80) != 0x00) { /* shift ret 7 bits */ ret <<= 7; /* add bits 0-6 */ ret += (c & 0x7F); } /* bit was clear */ ret <<= 7; ret += (c & 0x7F); return ret; } bool midifile::parse (perform * a_perf, int a_screen_set) { /* open binary file */ ifstream file(m_name.c_str(), ios::in | ios::binary | ios::ate); if (!file.is_open ()) { fprintf(stderr, "Error opening MIDI file\n"); return false; } int file_size = file.tellg (); /* run to start */ file.seekg (0, ios::beg); /* alloc data */ try { m_d.resize(file_size); } catch(std::bad_alloc& ex) { fprintf(stderr, "Memory allocation failed\n"); return false; } file.read ((char *) &m_d[0], file_size); file.close (); /* set position to 0 */ m_pos = 0; /* chunk info */ unsigned long ID; unsigned long TrackLength; /* time */ unsigned long Delta; unsigned long RunningTime; unsigned long CurrentTime; unsigned short Format; /* 0,1,2 */ unsigned short NumTracks; unsigned short ppqn; unsigned short perf; /* track name from file */ char TrackName[256]; /* used in small loops */ int i; /* sequence pointer */ sequence * seq; event e; /* read in header */ ID = read_long (); TrackLength = read_long (); Format = read_short (); NumTracks = read_short (); ppqn = read_short (); //printf( "[%8lX] len[%ld] fmt[%d] num[%d] ppqn[%d]\n", // ID, TrackLength, Format, NumTracks, ppqn ); /* magic number 'MThd' */ if (ID != 0x4D546864) { fprintf(stderr, "Invalid MIDI header detected: %8lX\n", ID); return false; } /* we are only supporting format 1 for now */ if (Format != 1) { fprintf(stderr, "Unsupported MIDI format detected: %d\n", Format); return false; } /* We should be good to load now */ /* for each Track in the midi file */ for (int curTrack = 0; curTrack < NumTracks; curTrack++) { /* done for each track */ bool done = false; perf = 0; /* events */ unsigned char status = 0, type, data[2], laststatus; long len; unsigned long proprietary = 0; /* Get ID + Length */ ID = read_long (); TrackLength = read_long (); //printf( "[%8lX] len[%8lX]\n", ID, TrackLength ); /* magic number 'MTrk' */ if (ID == 0x4D54726B) { /* we know we have a good track, so we can create a new sequence to dump it to */ seq = new sequence (); if (seq == NULL) { fprintf(stderr, "Memory allocation failed\n"); return false; } seq->set_master_midi_bus (&a_perf->m_master_bus); /* reset time */ RunningTime = 0; /* this gets each event in the Trk */ while (!done) { /* get time delta */ Delta = read_var (); /* get status */ laststatus = status; status = m_d[m_pos]; /* is it a status bit ? */ if ((status & 0x80) == 0x00) { /* no, its a running status */ status = laststatus; } else { /* its a status, increment */ m_pos++; } /* set the members in event */ e.set_status (status); RunningTime += Delta; /* current time is ppqn according to the file, we have to adjust it to our own ppqn. PPQN / ppqn gives us the ratio */ CurrentTime = (RunningTime * c_ppqn) / ppqn; //printf( "D[%6ld] [%6ld] %02X\n", Delta, CurrentTime, status); e.set_timestamp (CurrentTime); /* switch on the channelless status */ switch (status & 0xF0) { /* case for those with 2 data bytes */ case EVENT_NOTE_OFF: case EVENT_NOTE_ON: case EVENT_AFTERTOUCH: case EVENT_CONTROL_CHANGE: case EVENT_PITCH_WHEEL: data[0] = read_byte(); data[1] = read_byte(); // some files have vel=0 as note off if ((status & 0xF0) == EVENT_NOTE_ON && data[1] == 0) { e.set_status (EVENT_NOTE_OFF); } //printf( "%02X %02X\n", data[0], data[1] ); /* set data and add */ e.set_data (data[0], data[1]); seq->add_event (&e); /* set midi channel */ seq->set_midi_channel (status & 0x0F); break; /* one data item */ case EVENT_PROGRAM_CHANGE: case EVENT_CHANNEL_PRESSURE: data[0] = read_byte(); //printf( "%02X\n", data[0] ); /* set data and add */ e.set_data (data[0]); seq->add_event (&e); /* set midi channel */ seq->set_midi_channel (status & 0x0F); break; /* meta midi events --- this should be FF !!!!! */ case 0xF0: if (status == 0xFF) { /* get meta type */ type = read_byte(); len = read_var (); //printf( "%02X %08X ", type, (int) len ); switch (type) { /* proprietary */ case 0x7f: /* FF 7F len data */ if (len > 4) { proprietary = read_long (); len -= 4; } if (proprietary == c_midibus) { seq->set_midi_bus (read_byte()); len--; } else if (proprietary == c_midich) { seq->set_midi_channel (read_byte()); len--; } else if (proprietary == c_timesig) { seq->set_bpm (read_byte()); seq->set_bw (read_byte()); len -= 2; } else if (proprietary == c_triggers) { int num_triggers = len / 4; for (int i = 0; i < num_triggers; i += 2) { unsigned long on = read_long (); unsigned long length = (read_long () - on); len -= 8; seq->add_trigger(on, length, 0, false); } } else if (proprietary == c_triggers_new) { int num_triggers = len / 12; //printf( "num_triggers[%d]\n", num_triggers ); for (int i = 0; i < num_triggers; i++) { unsigned long on = read_long (); unsigned long off = read_long (); unsigned long length = off - on + 1; unsigned long offset = read_long (); //printf( "< start[%d] end[%d] offset[%d]\n", // on, off, offset ); len -= 12; seq->add_trigger (on, length, offset, false); } } /* eat the rest */ m_pos += len; break; /* Trk Done */ case 0x2f: // If delta is 0, then another event happened at the same time // as the track end. the sequence class will discard the last // note. This is a fix for that. Native Seq24 file will always // have a Delta >= 1 if ( Delta == 0 ){ CurrentTime += 1; } seq->set_length (CurrentTime, false); seq->zero_markers (); done = true; break; /* Track name */ case 0x03: for (i = 0; i < len; i++) { TrackName[i] = read_byte(); } TrackName[i] = '\0'; //printf("[%s]\n", TrackName ); seq->set_name (TrackName); break; /* sequence number */ case 0x00: if (len == 0x00) perf = 0; else perf = read_short (); //printf ( "perf %d\n", perf ); break; default: for (i = 0; i < len; i++) { read_byte(); } break; } } else if(status == 0xF0) { /* sysex */ len = read_var (); /* skip it */ m_pos += len; fprintf(stderr, "Warning, no support for SYSEX messages, discarding.\n"); } else { fprintf(stderr, "Unexpected system event : 0x%.2X", status); return false; } break; default: fprintf(stderr, "Unsupported MIDI event: %hhu\n", status); return false; break; } } /* while ( !done loading Trk chunk */ /* the sequence has been filled, add it */ //printf ( "add_sequence( %d )\n", perf + (a_screen_set * c_seqs_in_set)); a_perf->add_sequence (seq, perf + (a_screen_set * c_seqs_in_set)); } /* dont know what kind of chunk */ else { /* its not a MTrk, we dont know how to deal with it, so we just eat it */ fprintf(stderr, "Unsupported MIDI header detected: %8lX\n", ID); m_pos += TrackLength; done = true; } } /* for(eachtrack) */ //printf ( "file_size[%d] m_pos[%d]\n", file_size, m_pos ); if ((file_size - m_pos) > (int) sizeof (unsigned long)) { ID = read_long (); if (ID == c_midictrl) { unsigned long seqs = read_long (); for (unsigned int i = 0; i < seqs; i++) { a_perf->get_midi_control_toggle (i)->m_active = read_byte(); a_perf->get_midi_control_toggle (i)->m_inverse_active = read_byte(); a_perf->get_midi_control_toggle (i)->m_status = read_byte(); a_perf->get_midi_control_toggle (i)->m_data = read_byte(); a_perf->get_midi_control_toggle (i)->m_min_value = read_byte(); a_perf->get_midi_control_toggle (i)->m_max_value = read_byte(); a_perf->get_midi_control_on (i)->m_active = read_byte(); a_perf->get_midi_control_on (i)->m_inverse_active = read_byte(); a_perf->get_midi_control_on (i)->m_status = read_byte(); a_perf->get_midi_control_on (i)->m_data = read_byte(); a_perf->get_midi_control_on (i)->m_min_value = read_byte(); a_perf->get_midi_control_on (i)->m_max_value = read_byte(); a_perf->get_midi_control_off (i)->m_active = read_byte(); a_perf->get_midi_control_off (i)->m_inverse_active = read_byte(); a_perf->get_midi_control_off (i)->m_status = read_byte(); a_perf->get_midi_control_off (i)->m_data = read_byte(); a_perf->get_midi_control_off (i)->m_min_value = read_byte(); a_perf->get_midi_control_off (i)->m_max_value = read_byte(); } } /* Get ID + Length */ ID = read_long (); if (ID == c_midiclocks) { TrackLength = read_long (); /* TrackLength is nyumber of buses */ for (unsigned int x = 0; x < TrackLength; x++) { int bus_on = read_byte(); a_perf->get_master_midi_bus ()->set_clock (x, (clock_e) bus_on); } } } if ((file_size - m_pos) > (int) sizeof (unsigned long)) { /* Get ID + Length */ ID = read_long (); if (ID == c_notes) { unsigned int screen_sets = read_short (); for (unsigned int x = 0; x < screen_sets; x++) { /* get the length of the string */ unsigned int len = read_short (); string notess; for (unsigned int i = 0; i < len; i++) notess += read_byte(); a_perf->set_screen_set_notepad (x, ¬ess); } } } if ((file_size - m_pos) > (int) sizeof (unsigned int)) { /* Get ID + Length */ ID = read_long (); if (ID == c_bpmtag) { long bpm = read_long (); a_perf->set_bpm (bpm); } } // read in the mute group info. if ((file_size - m_pos) > (int) sizeof (unsigned long)) { ID = read_long (); if (ID == c_mutegroups) { long length = read_long (); if (c_gmute_tracks != length) { printf( "corrupt data in mutegroup section\n" ); } for (int i = 0; i < c_seqs_in_set; i++) { a_perf->select_group_mute(read_long ()); for (int k = 0; k < c_seqs_in_set; ++k) { a_perf->set_group_mute_state(k, read_long ()); } } } } // *** ADD NEW TAGS AT END **************/ return true; //printf ( "done\n"); } void midifile::write_long (unsigned long a_x) { write_byte ((a_x & 0xFF000000) >> 24); write_byte ((a_x & 0x00FF0000) >> 16); write_byte ((a_x & 0x0000FF00) >> 8); write_byte ((a_x & 0x000000FF)); } void midifile::write_short (unsigned short a_x) { write_byte ((a_x & 0xFF00) >> 8); write_byte ((a_x & 0x00FF)); } void midifile::write_byte (unsigned char a_x) { m_l.push_back (a_x); } bool midifile::write (perform * a_perf) { int numtracks = 0; /* get number of tracks */ for (int i = 0; i < c_max_sequence; i++) { if (a_perf->is_active (i)) numtracks++; } //printf ("numtracks[%d]\n", numtracks ); /* write header */ /* 'MThd' and length of 6 */ write_long (0x4D546864); write_long (0x00000006); /* format 1, number of tracks, ppqn */ write_short (0x0001); write_short (numtracks); write_short (c_ppqn); /* We should be good to load now */ /* for each Track in the midi file */ for (int curTrack = 0; curTrack < c_max_sequence; curTrack++) { if (a_perf->is_active (curTrack)) { /* sequence pointer */ sequence * seq = a_perf->get_sequence (curTrack); //printf ("track[%d]\n", curTrack ); list l; seq->fill_list (&l, curTrack); /* magic number 'MTrk' */ write_long (0x4D54726B); write_long (l.size ()); //printf("MTrk len[%d]\n", l.size()); while (l.size () > 0) { write_byte (l.back ()); l.pop_back (); } } } /* midi control */ write_long (c_midictrl); write_long (0); /* bus mute/unmute data */ write_long (c_midiclocks); write_long (0); /* notepad data */ write_long (c_notes); write_short (c_max_sets); for (int i = 0; i < c_max_sets; i++) { string * note = a_perf->get_screen_set_notepad (i); write_short (note->length ()); for (unsigned int j = 0; j < note->length (); j++) write_byte ((*note)[j]); } /* bpm */ write_long (c_bpmtag); write_long (a_perf->get_bpm ()); /* write out the mute groups */ write_long (c_mutegroups); write_long (c_gmute_tracks); for (int j=0; j < c_seqs_in_set; ++j) { a_perf->select_group_mute(j); write_long(j); for (int i=0; i < c_seqs_in_set; ++i) { write_long( a_perf->get_group_mute_state(i) ); } } /* open binary file */ ofstream file (m_name.c_str (), ios::out | ios::binary | ios::trunc); if (!file.is_open ()) return false; /* enable bufferization */ char file_buffer[1024]; file.rdbuf()->pubsetbuf(file_buffer, sizeof file_buffer); for (list < unsigned char >::iterator i = m_l.begin (); i != m_l.end (); i++) { char c = *i; file.write(&c, 1); } m_l.clear (); return true; } seq24-0.9.3/src/controllers.h0000644000175000017500000000704512651156360012723 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #pragma once string c_controller_names[128] = { "0 Bank Select", "1 Modulation Wheel ", "2 Breath controller ", "3 ", "4 Foot Pedal ", "5 Portamento Time ", "6 Data Entry ", "7 Volume ", "8 Balance ", "9 ", "10 Pan position", "11 Expression ", "12 Effect Control 1 ", "13 Effect Control 2 ", "14 ", "15 ", "16 General Purpose Slider 1", "17 General Purpose Slider 2", "18 General Purpose Slider 3", "19 General Purpose Slider 4", "20 ", "21 ", "22 ", "23 ", "24 ", "25 ", "26 ", "27 ", "28 ", "29 ", "30 ", "31 ", "32 Bank Select (fine)", "33 Modulation Wheel (fine)", "34 Breath controller (fine)", "35 ", "36 Foot Pedal (fine)", "37 Portamento Time (fine)", "38 Data Entry (fine)", "39 Volume (fine)", "40 Balance (fine)", "41 ", "42 Pan position (fine)", "43 Expression (fine)", "44 Effect Control 1 (fine)", "45 Effect Control 2 (fine)", "46 ", "47 ", "48 ", "49 ", "50 ", "51 ", "52 ", "53 ", "54 ", "55 ", "56 ", "57 ", "58 ", "59 ", "60 ", "61 ", "62 ", "63 ", "64 Hold Pedal (on/off)", "65 Portamento (on/off)", "66 Sustenuto Pedal (on/off)", "67 Soft Pedal (on/off)", "68 Legato Pedal (on/off)", "69 Hold 2 Pedal (on/off)", "70 Sound Variation", "71 Sound Timbre", "72 Sound Release Time", "73 Sound Attack Time", "74 Sound Brightness", "75 Sound Control 6", "76 Sound Control 7", "77 Sound Control 8", "78 Sound Control 9", "79 Sound Control 10", "80 General Purpose Button 1 (on/off)", "81 General Purpose Button 2 (on/off)", "82 General Purpose Button 3 (on/off)", "83 General Purpose Button 4 (on/off)", "84 ", "85 ", "86 ", "87 ", "88 ", "89 ", "90 ", "91 Effects Level", "92 Tremulo Level", "93 Chorus Level", "94 Celeste Level", "95 Phaser Level", "96 Data Button increment", "97 Data Button decrement", "98 Non-registered Parameter (fine)", "99 Non-registered Parameter (coarse)", "100 Registered Parameter (fine)", "101 Registered Parameter (coarse)", "102 ", "103 ", "104 ", "105 ", "106 ", "107 ", "108 ", "109 ", "110 ", "111 ", "112 ", "113 ", "114 ", "115 ", "116 ", "117 ", "118 ", "119 ", "120 All Sound Off", "121 All Controllers Off", "122 Local Keyboard (on/off)", "123 All Notes Off", "124 Omni Mode Off", "125 Omni Mode On", "126 Mono Operation", "127 Poly Operation" }; seq24-0.9.3/src/mainwnd.h0000644000175000017500000000625712651156360012016 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #include "mainwid.h" #include "perform.h" #include "sequence.h" #include "event.h" #include "maintime.h" #include "perfedit.h" #include "options.h" #pragma once #include #include #include #include "globals.h" using namespace Gtk; using namespace Menu_Helpers; class mainwnd : public Gtk::Window, public performcallback { /* notification handler for learn mode toggle */ virtual void on_grouplearnchange(bool state); private: perform *m_mainperf; bool m_modified; static int m_sigpipe[2]; #if GTK_MINOR_VERSION < 12 Tooltips *m_tooltips; #endif MenuBar *m_menubar; Menu *m_menu_file; Menu *m_menu_view; Menu *m_menu_help; mainwid *m_main_wid; maintime *m_main_time; perfedit *m_perf_edit; options *m_options; Gdk::Cursor m_main_cursor; Button *m_button_learn; Button *m_button_stop; Button *m_button_play; Button *m_button_perfedit; SpinButton *m_spinbutton_bpm; Adjustment *m_adjust_bpm; SpinButton *m_spinbutton_ss; Adjustment *m_adjust_ss; SpinButton *m_spinbutton_load_offset; Adjustment *m_adjust_load_offset; Entry *m_entry_notes; sigc::connection m_timeout_connect; void file_import_dialog(); void options_dialog(); void about_dialog(); void adj_callback_ss( ); void adj_callback_bpm( ); void edit_callback_notepad( ); bool timer_callback( ); void start_playing(); void stop_playing(); void learn_toggle(); void open_performance_edit( ); void sequence_key( int a_seq ); void update_window_title(); void toLower(basic_string&); bool is_modified(); void file_new(); void file_open(); void file_save(); void file_save_as(); void file_exit(); void new_file(); bool save_file(); void choose_file(); int query_save_changes(); bool is_save(); static void handle_signal(int sig); bool install_signal_handlers(); bool signal_action(Glib::IOCondition condition); public: mainwnd(perform *a_p); ~mainwnd(); void open_file(const Glib::ustring&); bool on_delete_event(GdkEventAny *a_e); bool on_key_press_event(GdkEventKey* a_ev); bool on_key_release_event(GdkEventKey* a_ev); }; seq24-0.9.3/src/seq24.cpp0000644000175000017500000002275011721750605011645 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #include #include #include #ifdef __WIN32__ # include "configwin32.h" #else # include "config.h" #endif #include "font.h" #ifdef LASH_SUPPORT # include "lash.h" #endif #include "mainwnd.h" #include "midifile.h" #include "optionsfile.h" #include "perform.h" #include "userfile.h" /* struct for command parsing */ static struct option long_options[] = { {"help", 0, 0, 'h'}, {"showmidi", 0, 0, 's'}, {"show_keys", 0, 0, 'k'}, {"stats", 0, 0, 'S'}, {"priority", 0, 0, 'p'}, {"ignore", required_argument, 0, 'i'}, {"interaction_method", required_argument, 0, 'x'}, {"jack_transport",0, 0, 'j'}, {"jack_master",0, 0, 'J'}, {"jack_master_cond", 0, 0, 'C'}, {"jack_start_mode", required_argument, 0, 'M'}, {"jack_session_uuid", required_argument, 0, 'U'}, {"manual_alsa_ports", 0, 0, 'm'}, {"pass_sysex", 0, 0, 'P'}, {"version", 0, 0, 'V'}, {0, 0, 0, 0} }; static const char versiontext[] = PACKAGE " " VERSION "\n"; bool global_manual_alsa_ports = false; bool global_showmidi = false; bool global_priority = false; bool global_device_ignore = false; int global_device_ignore_num = 0; bool global_stats = false; bool global_pass_sysex = false; Glib::ustring global_filename = ""; Glib::ustring last_used_dir ="/"; std::string config_filename = ".seq24rc"; std::string user_filename = ".seq24usr"; bool global_print_keys = false; interaction_method_e global_interactionmethod = e_seq24_interaction; bool global_with_jack_transport = false; bool global_with_jack_master = false; bool global_with_jack_master_cond = false; bool global_jack_start_mode = true; Glib::ustring global_jack_session_uuid = ""; user_midi_bus_definition global_user_midi_bus_definitions[c_maxBuses]; user_instrument_definition global_user_instrument_definitions[c_max_instruments]; font *p_font_renderer; #ifdef LASH_SUPPORT lash *lash_driver = NULL; #endif #ifdef __WIN32__ # define HOME "HOMEPATH" # define SLASH "\\" #else # define HOME "HOME" # define SLASH "/" #endif int main (int argc, char *argv[]) { /* Scan the argument vector and strip off all parameters known to * GTK+. */ Gtk::Main kit(argc, argv); /*prepare global MIDI definitions*/ for ( int i=0; i: ignore ALSA device\n" ); printf( " -k, --show_keys: prints pressed key value\n" ); printf( " -x, --interaction_method : see .seq24rc for methods to use\n" ); printf( " -j, --jack_transport: seq24 will sync to jack transport\n" ); printf( " -J, --jack_master: seq24 will try to be jack master\n" ); printf( " -C, --jack_master_cond: jack master will fail if there is already a master\n" ); printf( " -M, --jack_start_mode : when seq24 is synced to jack, the following play\n" ); printf( " modes are available (0 = live mode)\n"); printf( " (1 = song mode) (default)\n" ); printf( " -S, --stats: show statistics\n" ); printf( " -U, --jack_session_uuid : set uuid for jack session\n" ); printf( "\n\n\n" ); return EXIT_SUCCESS; break; case 'S': global_stats = true; break; case 's': global_showmidi = true; break; case 'p': global_priority = true; break; case 'P': global_pass_sysex = true; break; case 'k': global_print_keys = true; break; case 'j': global_with_jack_transport = true; break; case 'J': global_with_jack_master = true; break; case 'C': global_with_jack_master_cond = true; break; case 'M': if (atoi( optarg ) > 0) { global_jack_start_mode = true; } else { global_jack_start_mode = false; } break; case 'm': global_manual_alsa_ports = true; break; case 'i': /* ignore alsa device */ global_device_ignore = true; global_device_ignore_num = atoi( optarg ); break; case 'V': printf("%s", versiontext); return EXIT_SUCCESS; break; case 'U': global_jack_session_uuid = Glib::ustring(optarg); break; case 'x': global_interactionmethod = (interaction_method_e)atoi(optarg); break; default: break; } } /* end while */ p.init(); p.launch_input_thread(); p.launch_output_thread(); p.init_jack(); p_font_renderer = new font(); mainwnd seq24_window( &p ); if (optind < argc) { if (Glib::file_test(argv[optind], Glib::FILE_TEST_EXISTS)) seq24_window.open_file(argv[optind]); else printf("File not found: %s\n", argv[optind]); } /* connect to lash daemon and poll events*/ #ifdef LASH_SUPPORT lash_driver->start(&p); #endif kit.run(seq24_window); p.deinit_jack(); if ( getenv( HOME ) != NULL ) { string home( getenv( HOME )); Glib::ustring total_file = home + SLASH + config_filename; printf( "Writing [%s]\n", total_file.c_str()); optionsfile options( total_file ); if (!options.write( &p)) printf( "Error writing [%s]\n", total_file.c_str()); } else { printf( "Error calling getenv( \"%s\" )\n", HOME ); } #ifdef LASH_SUPPORT delete lash_driver; #endif return EXIT_SUCCESS; } seq24-0.9.3/src/keybindentry.cpp0000644000175000017500000000467611472552725013433 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- // GTK text edit widget for getting keyboard button values (for binding keys) // put cursor in text box, hit a key, something like 'a' (42) appears... // each keypress replaces the previous text. // also supports keyevent and keygroup maps in the perform class #include "keybindentry.h" #include "perform.h" KeyBindEntry::KeyBindEntry(type t, unsigned int* location_to_write, perform* p, long s): Entry(), m_key( location_to_write ), m_type( t ), m_perf( p ), m_slot( s ) { switch (m_type) { case location: if (m_key) set( *m_key ); break; case events: set( m_perf->lookup_keyevent_key( m_slot ) ); break; case groups: set( m_perf->lookup_keygroup_key( m_slot ) ); break; } } void KeyBindEntry::set( unsigned int val ) { char buf[256] = ""; char* special = gdk_keyval_name( val ); char* p_buf = &buf[strlen(buf)]; if (special) snprintf( p_buf, sizeof buf - (p_buf - buf), "%s", special ); else snprintf( p_buf, sizeof buf - (p_buf - buf), "'%c'", (char)val ); set_text( buf ); int width = strlen(buf)-1; set_width_chars( 1 <= width ? width : 1 ); } bool KeyBindEntry::on_key_press_event(GdkEventKey* event) { bool result = Entry::on_key_press_event( event ); set( event->keyval ); switch (m_type) { case location: if (m_key) *m_key = event->keyval; break; case events: m_perf->set_key_event( event->keyval, m_slot ); break; case groups: m_perf->set_key_group( event->keyval, m_slot ); break; } return result; } seq24-0.9.3/src/perfroll_input.h0000644000175000017500000000464312651156360013422 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- // #pragma once #include class perfroll; class AbstractPerfInput { public: virtual ~AbstractPerfInput() { }; virtual bool on_button_press_event(GdkEventButton* a_ev, perfroll& ths) = 0; virtual bool on_button_release_event(GdkEventButton* a_ev, perfroll& ths) = 0; virtual bool on_motion_notify_event(GdkEventMotion* a_ev, perfroll& ths) = 0; }; class FruityPerfInput : public AbstractPerfInput { public: FruityPerfInput() : m_adding_pressed( false ), m_current_x( 0 ), m_current_y( 0 ) {} bool on_button_press_event(GdkEventButton* a_ev, perfroll& ths); bool on_button_release_event(GdkEventButton* a_ev, perfroll& ths); bool on_motion_notify_event(GdkEventMotion* a_ev, perfroll& ths); private: void updateMousePtr(perfroll& ths); void on_left_button_pressed(GdkEventButton* a_ev, perfroll& ths); void on_right_button_pressed(GdkEventButton* a_ev, perfroll& ths); bool m_adding_pressed; long m_current_x, m_current_y; }; class Seq24PerfInput : public AbstractPerfInput { public: Seq24PerfInput() : m_adding( false ), m_adding_pressed( false ) {} bool on_button_press_event(GdkEventButton* a_ev, perfroll& ths); bool on_button_release_event(GdkEventButton* a_ev, perfroll& ths); bool on_motion_notify_event(GdkEventMotion* a_ev, perfroll& ths); private: void set_adding( bool a_adding, perfroll& ths ); bool m_adding; bool m_adding_pressed; }; seq24-0.9.3/src/seqmenu.h0000644000175000017500000000360012651156360012023 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #include "globals.h" #include "perform.h" class seqedit; #pragma once #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace Gtk; class seqmenu : public virtual Glib::ObjectBase { private: Menu *m_menu; perform *m_mainperf; sequence m_clipboard; void on_realize(); void seq_edit(); void seq_new(); void seq_copy(); void seq_cut(); void seq_paste(); void seq_clear_perf(); void set_bus_and_midi_channel( int a_bus, int a_ch ); void mute_all_tracks(); virtual void redraw( int a_sequence ) = 0; protected: int m_current_seq; void popup_menu(); public: seqmenu( perform *a_p ); virtual ~seqmenu( ){ }; }; seq24-0.9.3/src/userfile.cpp0000644000175000017500000002230312321052410012501 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #include "userfile.h" #include userfile::userfile( string a_name ) : configfile( a_name ) { } userfile::~userfile( ) { } bool userfile::parse( perform *a_perf ) { /* open binary file */ ifstream file ( m_name.c_str(), ios::in | ios::ate ); if( ! file.is_open() ) return false; /* run to start */ file.seekg( 0, ios::beg ); line_after( &file, "[user-midi-bus-definitions]" ); int buses = 0; sscanf( m_line, "%d", &buses ); char bus_num[4]; for ( int i=0; iget_midi_control_toggle(i)->m_active, &a_perf->get_midi_control_toggle(i)->m_inverse_active, &a_perf->get_midi_control_toggle(i)->m_status, &a_perf->get_midi_control_toggle(i)->m_data, &a_perf->get_midi_control_toggle(i)->m_min_value, &a_perf->get_midi_control_toggle(i)->m_max_value, &a_perf->get_midi_control_on(i)->m_active, &a_perf->get_midi_control_on(i)->m_inverse_active, &a_perf->get_midi_control_on(i)->m_status, &a_perf->get_midi_control_on(i)->m_data, &a_perf->get_midi_control_on(i)->m_min_value, &a_perf->get_midi_control_on(i)->m_max_value, &a_perf->get_midi_control_off(i)->m_active, &a_perf->get_midi_control_off(i)->m_inverse_active, &a_perf->get_midi_control_off(i)->m_status, &a_perf->get_midi_control_off(i)->m_data, &a_perf->get_midi_control_off(i)->m_min_value, &a_perf->get_midi_control_off(i)->m_max_value ); next_data_line( &file ); } /* group midi control */ line_after( &file, "[mute-group]"); int gtrack = 0; sscanf( m_line, "%d", >rack ); next_data_line( &file ); int mtx[c_seqs_in_set], j=0; for (int i=0; i< c_seqs_in_set; i++) { a_perf->select_group_mute(j); sscanf (m_line, "%d [%d %d %d %d %d %d %d %d] [%d %d %d %d %d %d %d %d] [%d %d %d %d %d %d %d %d] [%d %d %d %d %d %d %d %d]", &j, &mtx[0], &mtx[1], &mtx[2], &mtx[3], &mtx[4], &mtx[5], &mtx[6], &mtx[7], &mtx[8], &mtx[9], &mtx[10], &mtx[11], &mtx[12], &mtx[13], &mtx[14], &mtx[15], &mtx[16], &mtx[17], &mtx[18], &mtx[19], &mtx[20], &mtx[21], &mtx[22], &mtx[23], &mtx[24], &mtx[25], &mtx[26], &mtx[27], &mtx[28], &mtx[29], &mtx[30], &mtx[31]); for (int k=0; k< c_seqs_in_set; k++) { a_perf->set_group_mute_state(k, mtx[k]); } j++; next_data_line( &file ); } line_after( &file, "[midi-clock]" ); long buses = 0; sscanf( m_line, "%ld", &buses ); next_data_line( &file ); for ( int i=0; iget_master_midi_bus( )->set_clock( bus, (clock_e) bus_on ); next_data_line( &file ); } line_after( &file, "[keyboard-control]" ); long keys = 0; sscanf( m_line, "%ld", &keys ); next_data_line( &file ); a_perf->key_events.clear(); for ( int i=0; iset_key_event( key, seq ); next_data_line( &file ); } line_after( &file, "[keyboard-group]" ); long groups = 0; sscanf( m_line, "%ld", &groups ); next_data_line( &file ); a_perf->key_groups.clear(); for ( int i=0; iset_key_group( key, group ); next_data_line( &file ); } sscanf( m_line, "%u %u", &a_perf->m_key_bpm_up, &a_perf->m_key_bpm_dn ); next_data_line( &file ); sscanf( m_line, "%u %u %u", &a_perf->m_key_screenset_up, &a_perf->m_key_screenset_dn, &a_perf->m_key_set_playing_screenset); next_data_line( &file ); sscanf( m_line, "%u %u %u", &a_perf->m_key_group_on, &a_perf->m_key_group_off, &a_perf->m_key_group_learn); next_data_line( &file ); sscanf( m_line, "%u %u %u %u %u", &a_perf->m_key_replace, &a_perf->m_key_queue, &a_perf->m_key_snapshot_1, &a_perf->m_key_snapshot_2, &a_perf->m_key_keep_queue); next_data_line( &file ); sscanf( m_line, "%ld", &a_perf->m_show_ui_sequence_key ); next_data_line( &file ); sscanf( m_line, "%ld", &a_perf->m_key_start ); next_data_line( &file ); sscanf( m_line, "%ld", &a_perf->m_key_stop ); line_after( &file, "[jack-transport]" ); long flag = 0; sscanf( m_line, "%ld", &flag ); global_with_jack_transport = (bool) flag; next_data_line( &file ); sscanf( m_line, "%ld", &flag ); global_with_jack_master = (bool) flag; next_data_line( &file ); sscanf( m_line, "%ld", &flag ); global_with_jack_master_cond = (bool) flag; next_data_line( &file ); sscanf( m_line, "%ld", &flag ); global_jack_start_mode = (bool) flag; line_after( &file, "[midi-input]" ); buses = 0; sscanf( m_line, "%ld", &buses ); next_data_line( &file ); for ( int i=0; iget_master_midi_bus( )->set_input( bus, (bool) bus_on ); next_data_line( &file ); } /* midi clock mod */ long ticks = 64; line_after( &file, "[midi-clock-mod-ticks]" ); sscanf( m_line, "%ld", &ticks ); midibus::set_clock_mod(ticks); /* manual alsa ports */ line_after( &file, "[manual-alsa-ports]" ); sscanf( m_line, "%ld", &flag ); global_manual_alsa_ports = (bool) flag; /* last used dir */ line_after( &file, "[last-used-dir]" ); //FIXME: check for a valid path is missing if (m_line[0] == '/') last_used_dir.assign(m_line); /* interaction method */ long method = 0; line_after( &file, "[interaction-method]" ); sscanf( m_line, "%ld", &method ); global_interactionmethod = (interaction_method_e)method; #endif file.close(); return true; } bool userfile::write( perform *a_perf ) { return false; } seq24-0.9.3/src/configwin32.h0000644000175000017500000000227611205551300012471 00000000000000/* src/configwin32.h. Generated by configure. */ /* src/configwin32.h.in. Generated from configure.in by autoheader. */ /* Name of package */ #define PACKAGE "seq24" /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "seq24-devel@lists.sourceforge.net" /* Define to the full name of this package. */ #define PACKAGE_NAME "seq24" /* Define to the full name and version of this package. */ #define PACKAGE_STRING "seq24 0.9.1" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "seq24" /* Define to the version of this package. */ #define PACKAGE_VERSION "0.9.1" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Version number of package */ #define VERSION "0.9.1" /* gnu source */ #define _GNU_SOURCE 1 /* Define to 1 if you have the `asound' library (-lasound). */ #define HAVE_LIBASOUND 0 #undef HAVE_LIBASOUND /* Define to enable JACK driver */ #define JACK_SUPPORT 0 #undef JACK_SUPPORT /* Define to enable LASH support */ #define LASH_SUPPORT 0 #undef LASH_SUPPORT #define PTHREAD_SUPPORT 1 /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ seq24-0.9.3/src/midibus.cpp0000644000175000017500000010513212651156360012340 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #include "midibus.h" #ifdef HAVE_LIBASOUND # include #endif #ifdef LASH_SUPPORT # include "lash.h" #endif #ifdef HAVE_LIBASOUND midibus::midibus( int a_localclient, int a_destclient, int a_destport, snd_seq_t *a_seq, const char *a_client_name, const char *a_port_name, int a_id, int a_queue ) : m_id(a_id), m_clock_type(e_clock_off), m_inputing(false), m_seq(a_seq), m_dest_addr_client(a_destclient), m_dest_addr_port(a_destport), m_local_addr_client(a_localclient), m_local_addr_port(-1), m_queue(a_queue) { char name[60]; if ( global_user_midi_bus_definitions[m_id].alias.length() > 0 ) { snprintf(name, 59, "(%s)", global_user_midi_bus_definitions[m_id].alias.c_str()); } else { snprintf(name,59,"(%s)",a_port_name); } /* copy names */ char tmp[60]; snprintf( tmp, 59, "[%d] %d:%d %s", m_id, m_dest_addr_client, m_dest_addr_port, name ); m_name = tmp; } midibus::midibus( int a_localclient, snd_seq_t *a_seq, int a_id, int a_queue ) : m_id(a_id), m_clock_type(e_clock_off), m_inputing(false), m_seq(a_seq), m_dest_addr_client(-1), m_dest_addr_port(-1), m_local_addr_client(a_localclient), m_queue(a_queue) { /* set members */ /* copy names */ char tmp[60]; snprintf( tmp, 59, "[%d] seq24 %d", m_id, m_id ); m_name = tmp; } #endif #ifdef __WIN32__ midibus::midibus( char a_id, int a_queue ) { /* set members */ m_queue = a_queue; m_id = a_id; m_clock_type = e_clock_off; m_inputing = false; /* copy names */ char tmp[60]; snprintf( tmp, 59, "[%d] seq24 %d", m_id, m_id ); m_name = tmp; } #endif int midibus::m_clock_mod = 16 * 4; void midibus::lock( ) { m_mutex.lock(); } void midibus::unlock( ) { m_mutex.unlock(); } bool midibus::init_out( ) { #ifdef HAVE_LIBASOUND /* temp return */ int ret; /* create ports */ ret = snd_seq_create_simple_port(m_seq, m_name.c_str(), SND_SEQ_PORT_CAP_NO_EXPORT | SND_SEQ_PORT_CAP_READ, SND_SEQ_PORT_TYPE_MIDI_GENERIC | SND_SEQ_PORT_TYPE_APPLICATION ); m_local_addr_port = ret; if ( ret < 0 ){ printf( "snd_seq_create_simple_port(write) error\n"); return false; } /* connect to */ ret = snd_seq_connect_to( m_seq, m_local_addr_port, m_dest_addr_client, m_dest_addr_port ); if ( ret < 0 ){ printf( "snd_seq_connect_to(%d:%d) error\n", m_dest_addr_client, m_dest_addr_port); return false; } #endif return true; } bool midibus::init_out_sub( ) { #ifdef HAVE_LIBASOUND /* temp return */ int ret; /* create ports */ ret = snd_seq_create_simple_port(m_seq, m_name.c_str(), SND_SEQ_PORT_CAP_READ | SND_SEQ_PORT_CAP_SUBS_READ, SND_SEQ_PORT_TYPE_MIDI_GENERIC | SND_SEQ_PORT_TYPE_APPLICATION ); m_local_addr_port = ret; if ( ret < 0 ){ printf( "snd_seq_create_simple_port(write) error\n"); return false; } #endif return true; } bool midibus::init_in( ) { #ifdef HAVE_LIBASOUND /* temp return */ int ret; /* create ports */ ret = snd_seq_create_simple_port(m_seq, "seq24 in", SND_SEQ_PORT_CAP_NO_EXPORT | SND_SEQ_PORT_CAP_WRITE, SND_SEQ_PORT_TYPE_MIDI_GENERIC | SND_SEQ_PORT_TYPE_APPLICATION ); m_local_addr_port = ret; if ( ret < 0 ){ printf( "snd_seq_create_simple_port(read) error\n"); return false; } snd_seq_port_subscribe_t *subs; snd_seq_port_subscribe_alloca(&subs); snd_seq_addr_t sender, dest; /* the destinatino port is actually our local port */ sender.client = m_dest_addr_client; sender.port = m_dest_addr_port; dest.client = m_local_addr_client; dest.port = m_local_addr_port; /* set in and out ports */ snd_seq_port_subscribe_set_sender(subs, &sender); snd_seq_port_subscribe_set_dest(subs, &dest); /* use the master queue, and get ticks */ snd_seq_port_subscribe_set_queue(subs, m_queue); snd_seq_port_subscribe_set_time_update(subs, 1); /* subscribe */ ret = snd_seq_subscribe_port(m_seq, subs); if ( ret < 0 ){ printf( "snd_seq_connect_from(%d:%d) error\n", m_dest_addr_client, m_dest_addr_port); return false; } #endif return true; } bool midibus::init_in_sub( ) { #ifdef HAVE_LIBASOUND /* temp return */ int ret; /* create ports */ ret = snd_seq_create_simple_port(m_seq, "seq24 in", SND_SEQ_PORT_CAP_WRITE | SND_SEQ_PORT_CAP_SUBS_WRITE, SND_SEQ_PORT_TYPE_MIDI_GENERIC | SND_SEQ_PORT_TYPE_APPLICATION ); m_local_addr_port = ret; if ( ret < 0 ){ printf( "snd_seq_create_simple_port(write) error\n"); return false; } #endif return true; } bool midibus::deinit_in( ) { #ifdef HAVE_LIBASOUND /* temp return */ int ret; snd_seq_port_subscribe_t *subs; snd_seq_port_subscribe_alloca(&subs); snd_seq_addr_t sender, dest; /* the destinatino port is actually our local port */ sender.client = m_dest_addr_client; sender.port = m_dest_addr_port; dest.client = m_local_addr_client; dest.port = m_local_addr_port; /* set in and out ports */ snd_seq_port_subscribe_set_sender(subs, &sender); snd_seq_port_subscribe_set_dest(subs, &dest); /* use the master queue, and get ticks */ snd_seq_port_subscribe_set_queue(subs, m_queue); snd_seq_port_subscribe_set_time_update(subs, 1); /* subscribe */ ret = snd_seq_unsubscribe_port(m_seq, subs); if ( ret < 0 ){ printf( "snd_seq_unsubscribe_port(%d:%d) error\n", m_dest_addr_client, m_dest_addr_port); return false; } #endif return true; } int midibus::get_id( ) { return m_id; } void midibus::print() { printf( "%s" , m_name.c_str() ); } string midibus::get_name() { return m_name; } midibus::~midibus() { } /* takes an native event, encodes to alsa event, puts it in the queue */ void midibus::play( event *a_e24, unsigned char a_channel ) { lock(); #ifdef HAVE_LIBASOUND snd_seq_event_t ev; /* alsa midi parser */ snd_midi_event_t *midi_ev; /* temp for midi data */ unsigned char buffer[3]; /* fill buffer and set midi channel */ buffer[0] = a_e24->get_status(); buffer[0] += (a_channel & 0x0F); a_e24->get_data( &buffer[1], &buffer[2] ); snd_midi_event_new( 10, &midi_ev ); /* clear event */ snd_seq_ev_clear( &ev ); snd_midi_event_encode( midi_ev, buffer, 3, &ev ); snd_midi_event_free( midi_ev ); /* set source */ snd_seq_ev_set_source(&ev, m_local_addr_port ); snd_seq_ev_set_subs(&ev); /* set tag unique to each sequence for removal purposes */ //ev.tag = a_tag; // its immediate snd_seq_ev_set_direct( &ev ); /* pump it into the queue */ snd_seq_event_output(m_seq, &ev); #endif unlock(); } inline long min ( long a, long b ){ if ( a < b ) return a; return b; } /* takes an native event, encodes to alsa event, puts it in the queue */ void midibus::sysex( event *a_e24 ) { lock(); #ifdef HAVE_LIBASOUND snd_seq_event_t ev; /* clear event */ snd_seq_ev_clear( &ev ); snd_seq_ev_set_priority( &ev, 1 ); /* set source */ snd_seq_ev_set_source(&ev, m_local_addr_port ); snd_seq_ev_set_subs(&ev); // its immediate snd_seq_ev_set_direct( &ev ); unsigned char *data = a_e24->get_sysex(); long data_size = a_e24->get_size(); for (long offset = 0; offset < data_size; offset += c_midibus_sysex_chunk) { long data_left = data_size - offset; snd_seq_ev_set_sysex( &ev, min( data_left, c_midibus_sysex_chunk), &data[offset] ); /* pump it into the queue */ snd_seq_event_output_direct(m_seq, &ev); usleep(80000); flush(); } #endif unlock(); } // flushes our local queue events out into ALSA void midibus::flush() { lock(); #ifdef HAVE_LIBASOUND snd_seq_drain_output( m_seq ); #endif unlock(); } void midibus::init_clock( long a_tick ) { #ifdef HAVE_LIBASOUND if ( m_clock_type == e_clock_pos && a_tick != 0) { continue_from( a_tick ); } else if ( m_clock_type == e_clock_mod || a_tick == 0) { start(); long clock_mod_ticks = (c_ppqn / 4) * m_clock_mod; long leftover = ( a_tick % clock_mod_ticks ); long starting_tick = a_tick - leftover; /* was there anything left?, then wait for next beat (16th note) to start clocking */ if ( leftover > 0) { starting_tick += clock_mod_ticks; } //printf ( "continue_from leftover[%ld] starting_tick[%ld]\n", leftover, starting_tick ); m_lasttick = starting_tick - 1; } #endif } void midibus::continue_from( long a_tick ) { #ifdef HAVE_LIBASOUND /* tell the device that we are going to start at a certain position */ long pp16th = (c_ppqn / 4); long leftover = ( a_tick % pp16th ); long beats = ( a_tick / pp16th ); long starting_tick = a_tick - leftover; /* was there anything left? Then wait for next beat (16th note) to start clocking */ if ( leftover > 0) { starting_tick += pp16th; } //printf ( "continue_from leftover[%ld] starting_tick[%ld]\n", leftover, starting_tick ); m_lasttick = starting_tick - 1; if ( m_clock_type != e_clock_off ) { //printf( "control value %ld\n", beats); snd_seq_event_t evc; snd_seq_event_t ev; ev.type = SND_SEQ_EVENT_CONTINUE; evc.type = SND_SEQ_EVENT_SONGPOS; evc.data.control.value = beats; snd_seq_ev_set_fixed( &ev ); snd_seq_ev_set_fixed( &evc ); snd_seq_ev_set_priority( &ev, 1 ); snd_seq_ev_set_priority( &evc, 1 ); /* set source */ snd_seq_ev_set_source(&evc, m_local_addr_port ); snd_seq_ev_set_subs(&evc); snd_seq_ev_set_source(&ev, m_local_addr_port ); snd_seq_ev_set_subs(&ev); // its immediate snd_seq_ev_set_direct( &ev ); snd_seq_ev_set_direct( &evc ); /* pump it into the queue */ snd_seq_event_output(m_seq, &evc); flush(); snd_seq_event_output(m_seq, &ev); } #endif } /* gets it a runnin */ void midibus::start() { #ifdef HAVE_LIBASOUND m_lasttick = -1; if ( m_clock_type != e_clock_off ){ snd_seq_event_t ev; ev.type = SND_SEQ_EVENT_START; snd_seq_ev_set_fixed( &ev ); snd_seq_ev_set_priority( &ev, 1 ); /* set source */ snd_seq_ev_set_source(&ev, m_local_addr_port ); snd_seq_ev_set_subs(&ev); // its immediate snd_seq_ev_set_direct( &ev ); /* pump it into the queue */ snd_seq_event_output(m_seq, &ev); } #endif } void midibus::set_clock( clock_e a_clock_type ) { m_clock_type = a_clock_type; } clock_e midibus::get_clock( ) { return m_clock_type; } void midibus::set_input( bool a_inputing ) { if ( m_inputing != a_inputing ){ m_inputing = a_inputing; if (m_inputing){ init_in(); } else { deinit_in(); } } } bool midibus::get_input( ) { return m_inputing; } void midibus::stop() { #ifdef HAVE_LIBASOUND m_lasttick = -1; if ( m_clock_type != e_clock_off ){ snd_seq_event_t ev; ev.type = SND_SEQ_EVENT_STOP; snd_seq_ev_set_fixed( &ev ); snd_seq_ev_set_priority( &ev, 1 ); /* set source */ snd_seq_ev_set_source(&ev, m_local_addr_port ); snd_seq_ev_set_subs(&ev); // its immediate snd_seq_ev_set_direct( &ev ); /* pump it into the queue */ snd_seq_event_output(m_seq, &ev); } #endif } // generates midi clock void midibus::clock( long a_tick ) { lock(); #ifdef HAVE_LIBASOUND if ( m_clock_type != e_clock_off ){ bool done = false; long uptotick = a_tick; if ( m_lasttick >= uptotick ) done = true; while ( !done ){ m_lasttick++; if ( m_lasttick >= uptotick ) done = true; /* tick time? */ if ( m_lasttick % ( c_ppqn / 24 ) == 0 ){ snd_seq_event_t ev; ev.type = SND_SEQ_EVENT_CLOCK; /* set tag to 127 so the sequences wont remove it */ ev.tag = 127; snd_seq_ev_set_fixed( &ev ); snd_seq_ev_set_priority( &ev, 1 ); /* set source */ snd_seq_ev_set_source(&ev, m_local_addr_port ); snd_seq_ev_set_subs(&ev); // its immediate snd_seq_ev_set_direct( &ev ); /* pump it into the queue */ snd_seq_event_output(m_seq, &ev); } } /* and send out */ flush(); } #endif unlock(); } /* deletes events in queue */ /*void midibus::remove_queued_on_events( int a_tag ) { lock(); snd_seq_remove_events_t *remove_events; snd_seq_remove_events_malloc( &remove_events ); snd_seq_remove_events_set_condition( remove_events, SND_SEQ_REMOVE_OUTPUT | SND_SEQ_REMOVE_TAG_MATCH | SND_SEQ_REMOVE_IGNORE_OFF ); snd_seq_remove_events_set_tag( remove_events, a_tag ); snd_seq_remove_events( m_seq, remove_events ); snd_seq_remove_events_free( remove_events ); unlock(); } */ void mastermidibus::lock( ) { // printf( "mastermidibus::lock()\n" ); m_mutex.lock(); } void mastermidibus::unlock( ) { // printf( "mastermidibus::unlock()\n" ); m_mutex.unlock(); } /* gets it running */ void mastermidibus::start() { lock(); #ifdef HAVE_LIBASOUND /* start timer */ snd_seq_start_queue( m_alsa_seq, m_queue, NULL ); for ( int i=0; i < m_num_out_buses; i++ ) m_buses_out[i]->start(); #endif unlock(); } /* gets it a runnin */ void mastermidibus::continue_from( long a_tick) { lock(); #ifdef HAVE_LIBASOUND /* start timer */ snd_seq_start_queue( m_alsa_seq, m_queue, NULL ); for ( int i=0; i < m_num_out_buses; i++ ) m_buses_out[i]->continue_from( a_tick ); #endif unlock(); } void mastermidibus::init_clock( long a_tick ) { lock(); for ( int i=0; i < m_num_out_buses; i++ ) m_buses_out[i]->init_clock( a_tick ); unlock(); } void mastermidibus::stop() { lock(); for ( int i=0; i < m_num_out_buses; i++ ) m_buses_out[i]->stop(); #ifdef HAVE_LIBASOUND snd_seq_drain_output( m_alsa_seq ); snd_seq_sync_output_queue( m_alsa_seq ); /* start timer */ snd_seq_stop_queue( m_alsa_seq, m_queue, NULL ); #endif unlock(); } // generates midi clock void mastermidibus::clock( long a_tick ) { lock(); for ( int i=0; i < m_num_out_buses; i++ ) m_buses_out[i]->clock( a_tick ); unlock(); } void mastermidibus::set_ppqn( int a_ppqn ) { lock(); #ifdef HAVE_LIBASOUND m_ppqn = a_ppqn; /* allocate tempo struct */ snd_seq_queue_tempo_t *tempo; snd_seq_queue_tempo_alloca( &tempo ); /* fill tempo struct with current tempo info */ snd_seq_get_queue_tempo( m_alsa_seq, m_queue, tempo ); /* set ppqn */ snd_seq_queue_tempo_set_ppq( tempo, m_ppqn ); /* give tempo struct to the queue */ snd_seq_set_queue_tempo( m_alsa_seq, m_queue, tempo ); #endif unlock(); } void mastermidibus::set_bpm( int a_bpm ) { lock(); #ifdef HAVE_LIBASOUND m_bpm = a_bpm; /* allocate tempo struct */ snd_seq_queue_tempo_t *tempo; snd_seq_queue_tempo_alloca( &tempo ); /* fill tempo struct with current tempo info */ snd_seq_get_queue_tempo( m_alsa_seq, m_queue, tempo ); snd_seq_queue_tempo_set_tempo( tempo, 60000000 / m_bpm ); /* give tempo struct to the queue */ snd_seq_set_queue_tempo(m_alsa_seq, m_queue, tempo ); #endif unlock(); } // flushes our local queue events out into ALSA void mastermidibus::flush() { lock(); #ifdef HAVE_LIBASOUND snd_seq_drain_output( m_alsa_seq ); #endif unlock(); } /* fills the array with our buses */ mastermidibus::mastermidibus() { /* temp return */ int ret; /* set initial number buses */ m_num_out_buses = 0; m_num_in_buses = 0; for( int i=0; iset_alsa_client_id(snd_seq_client_id(m_alsa_seq)); #endif #endif } void mastermidibus::init( ) { #ifdef HAVE_LIBASOUND /* client info */ snd_seq_client_info_t *cinfo; /* port info */ snd_seq_port_info_t *pinfo; int client; snd_seq_client_info_alloca(&cinfo); snd_seq_client_info_set_client(cinfo, -1); //printf( "global_ports %d\n", global_manual_alsa_ports ); if ( global_manual_alsa_ports ) { int num_buses = 16; for( int i=0; iinit_out_sub(); m_buses_out_active[i] = true; m_buses_out_init[i] = true; } m_num_out_buses = num_buses; /* only one in */ m_buses_in[0] = new midibus( snd_seq_client_id( m_alsa_seq ), m_alsa_seq, m_num_in_buses, m_queue); m_buses_in[0]->init_in_sub(); m_buses_in_active[0] = true; m_buses_in_init[0] = true; m_num_in_buses = 1; } else { /* while the next client one the sequencer is avaiable */ while (snd_seq_query_next_client(m_alsa_seq, cinfo) >= 0){ /* get client from cinfo */ client = snd_seq_client_info_get_client(cinfo); /* fill pinfo */ snd_seq_port_info_alloca(&pinfo); snd_seq_port_info_set_client(pinfo, client); snd_seq_port_info_set_port(pinfo, -1); /* while the next port is avail */ while (snd_seq_query_next_port(m_alsa_seq, pinfo) >= 0 ){ /* get its capability */ int cap = snd_seq_port_info_get_capability(pinfo); if ( snd_seq_client_id( m_alsa_seq ) != snd_seq_port_info_get_client(pinfo) && snd_seq_port_info_get_client(pinfo) != SND_SEQ_CLIENT_SYSTEM){ /* the outs */ if ( (cap & SND_SEQ_PORT_CAP_SUBS_WRITE) != 0 && snd_seq_client_id( m_alsa_seq ) != snd_seq_port_info_get_client(pinfo)){ m_buses_out[m_num_out_buses] = new midibus( snd_seq_client_id( m_alsa_seq ), snd_seq_port_info_get_client(pinfo), snd_seq_port_info_get_port(pinfo), m_alsa_seq, snd_seq_client_info_get_name(cinfo), snd_seq_port_info_get_name(pinfo), m_num_out_buses, m_queue ); if ( m_buses_out[m_num_out_buses]->init_out() ){ m_buses_out_active[m_num_out_buses] = true; m_buses_out_init[m_num_out_buses] = true; } else { m_buses_out_init[m_num_out_buses] = true; } m_num_out_buses++; } /* the ins */ if ( (cap & SND_SEQ_PORT_CAP_SUBS_READ) != 0 && snd_seq_client_id( m_alsa_seq ) != snd_seq_port_info_get_client(pinfo)){ m_buses_in[m_num_in_buses] = new midibus( snd_seq_client_id( m_alsa_seq ), snd_seq_port_info_get_client(pinfo), snd_seq_port_info_get_port(pinfo), m_alsa_seq, snd_seq_client_info_get_name(cinfo), snd_seq_port_info_get_name(pinfo), m_num_in_buses, m_queue); //if ( m_buses_in[m_num_in_buses]->init_in() ){ m_buses_in_active[m_num_in_buses] = true; m_buses_in_init[m_num_in_buses] = true; //} else { //m_buses_in_init[m_num_in_buses] = true; //} m_num_in_buses++; } } } } /* end loop for clients */ } set_bpm( c_bpm ); set_ppqn( c_ppqn ); /* midi input */ /* poll descriptors */ /* get number of file descriptors */ m_num_poll_descriptors = snd_seq_poll_descriptors_count(m_alsa_seq, POLLIN); /* allocate into */ m_poll_descriptors = new pollfd[m_num_poll_descriptors]; /* get descriptors */ snd_seq_poll_descriptors(m_alsa_seq, m_poll_descriptors, m_num_poll_descriptors, POLLIN); set_sequence_input( false, NULL ); /* sizes */ snd_seq_set_output_buffer_size(m_alsa_seq, c_midibus_output_size ); snd_seq_set_input_buffer_size(m_alsa_seq, c_midibus_input_size ); m_bus_announce = new midibus( snd_seq_client_id( m_alsa_seq ), SND_SEQ_CLIENT_SYSTEM, SND_SEQ_PORT_SYSTEM_ANNOUNCE, m_alsa_seq, "system", "annouce", 0, m_queue); m_bus_announce->set_input(true); for ( int i=0; iinit_out_sub(); m_buses_out_active[i] = true; m_buses_out_init[i] = true; } m_num_out_buses = num_buses; /* only one in */ m_buses_in[0] = new midibus( m_num_in_buses, m_queue); m_buses_in[0]->init_in_sub(); m_buses_in_active[0] = true; m_buses_in_init[0] = true; m_num_in_buses = 1; set_bpm( c_bpm ); set_ppqn( c_ppqn ); /* midi input */ /* poll descriptors */ set_sequence_input( false, NULL ); for ( int i=0; isysex( a_ev ); flush(); unlock(); } void mastermidibus::play( unsigned char a_bus, event *a_e24, unsigned char a_channel ) { lock(); if ( m_buses_out_active[a_bus] && a_bus < m_num_out_buses ){ m_buses_out[a_bus]->play( a_e24, a_channel ); } unlock(); } void mastermidibus::set_clock( unsigned char a_bus, clock_e a_clock_type ) { lock(); if ( a_bus < c_maxBuses ){ m_init_clock[a_bus] = a_clock_type; } if ( m_buses_out_active[a_bus] && a_bus < m_num_out_buses ){ m_buses_out[a_bus]->set_clock( a_clock_type ); } unlock(); } clock_e mastermidibus::get_clock( unsigned char a_bus ) { if ( m_buses_out_active[a_bus] && a_bus < m_num_out_buses ){ return m_buses_out[a_bus]->get_clock(); } return e_clock_off; } void midibus::set_clock_mod( int a_clock_mod ) { if (a_clock_mod != 0 ) m_clock_mod = a_clock_mod; } int midibus::get_clock_mod() { return m_clock_mod; } void mastermidibus::set_input( unsigned char a_bus, bool a_inputing ) { lock(); if ( a_bus < c_maxBuses ){ m_init_input[a_bus] = a_inputing; } if ( m_buses_in_active[a_bus] && a_bus < m_num_in_buses ){ m_buses_in[a_bus]->set_input( a_inputing ); } unlock(); } bool mastermidibus::get_input( unsigned char a_bus ) { if ( m_buses_in_active[a_bus] && a_bus < m_num_in_buses ){ return m_buses_in[a_bus]->get_input(); } return false; } string mastermidibus::get_midi_out_bus_name( int a_bus ) { if ( m_buses_out_active[a_bus] && a_bus < m_num_out_buses ){ return m_buses_out[a_bus]->get_name(); } /* copy names */ char tmp[60]; if ( m_buses_out_init[a_bus] ){ snprintf( tmp, 59, "[%d] %d:%d (disconnected)", a_bus, m_buses_out[a_bus]->get_client(), m_buses_out[a_bus]->get_port() ); } else { snprintf( tmp, 59, "[%d] (unconnected)", a_bus ); } string ret = tmp; return ret; } string mastermidibus::get_midi_in_bus_name( int a_bus ) { if ( m_buses_in_active[a_bus] && a_bus < m_num_in_buses ){ return m_buses_in[a_bus]->get_name(); } /* copy names */ char tmp[60]; if ( m_buses_in_init[a_bus] ){ snprintf( tmp, 59, "[%d] %d:%d (disconnected)", a_bus, m_buses_in[a_bus]->get_client(), m_buses_in[a_bus]->get_port() ); } else { snprintf( tmp, 59, "[%d] (unconnected)", a_bus ); } string ret = tmp; return ret; } void mastermidibus::print() { printf( "Available Buses\n"); for ( int i=0; im_name.c_str() ); } } int mastermidibus::get_num_out_buses() { return m_num_out_buses; } int mastermidibus::get_num_in_buses() { return m_num_in_buses; } int mastermidibus::poll_for_midi( ) { int ret = 0; #ifdef HAVE_LIBASOUND ret = poll( m_poll_descriptors, m_num_poll_descriptors, 1000); #endif return ret; } bool mastermidibus::is_more_input( ){ lock(); int size=0; #ifdef HAVE_LIBASOUND size = snd_seq_event_input_pending(m_alsa_seq, 0); #endif unlock(); return ( size > 0 ); } void mastermidibus::port_start( int a_client, int a_port ) { lock(); #ifdef HAVE_LIBASOUND /* client info */ snd_seq_client_info_t *cinfo; snd_seq_client_info_alloca(&cinfo); snd_seq_get_any_client_info( m_alsa_seq, a_client, cinfo ); /* port info */ snd_seq_port_info_t *pinfo; /* fill pinfo */ snd_seq_port_info_alloca(&pinfo); snd_seq_get_any_port_info( m_alsa_seq, a_client, a_port, pinfo ); /* get its capability */ int cap = snd_seq_port_info_get_capability(pinfo); if ( snd_seq_client_id( m_alsa_seq ) != snd_seq_port_info_get_client(pinfo)){ /* the outs */ if ( (cap & (SND_SEQ_PORT_CAP_SUBS_WRITE | SND_SEQ_PORT_CAP_WRITE )) == (SND_SEQ_PORT_CAP_SUBS_WRITE | SND_SEQ_PORT_CAP_WRITE ) && snd_seq_client_id( m_alsa_seq ) != snd_seq_port_info_get_client(pinfo)){ bool replacement = false; int bus_slot = m_num_out_buses; for( int i=0; i< m_num_out_buses; i++ ){ if( m_buses_out[i]->get_client() == a_client && m_buses_out[i]->get_port() == a_port && m_buses_out_active[i] == false ){ replacement = true; bus_slot = i; } } m_buses_out[bus_slot] = new midibus( snd_seq_client_id( m_alsa_seq ), snd_seq_port_info_get_client(pinfo), snd_seq_port_info_get_port(pinfo), m_alsa_seq, snd_seq_client_info_get_name(cinfo), snd_seq_port_info_get_name(pinfo), m_num_out_buses, m_queue ); m_buses_out[bus_slot]->init_out(); m_buses_out_active[bus_slot] = true; m_buses_out_init[bus_slot] = true; if ( !replacement ){ m_num_out_buses++; } } /* the ins */ if ( (cap & (SND_SEQ_PORT_CAP_SUBS_READ | SND_SEQ_PORT_CAP_READ )) == (SND_SEQ_PORT_CAP_SUBS_READ | SND_SEQ_PORT_CAP_READ ) && snd_seq_client_id( m_alsa_seq ) != snd_seq_port_info_get_client(pinfo)){ bool replacement = false; int bus_slot = m_num_in_buses; for( int i=0; i< m_num_in_buses; i++ ){ if( m_buses_in[i]->get_client() == a_client && m_buses_in[i]->get_port() == a_port && m_buses_in_active[i] == false ){ replacement = true; bus_slot = i; } } //printf( "in [%d] [%d]\n", replacement, bus_slot ); m_buses_in[bus_slot] = new midibus( snd_seq_client_id( m_alsa_seq ), snd_seq_port_info_get_client(pinfo), snd_seq_port_info_get_port(pinfo), m_alsa_seq, snd_seq_client_info_get_name(cinfo), snd_seq_port_info_get_name(pinfo), m_num_in_buses, m_queue); //m_buses_in[bus_slot]->init_in(); m_buses_in_active[bus_slot] = true; m_buses_in_init[bus_slot] = true; if ( !replacement ){ m_num_in_buses++; } } } /* end loop for clients */ /* midi input */ /* poll descriptors */ /* get number of file descriptors */ m_num_poll_descriptors = snd_seq_poll_descriptors_count(m_alsa_seq, POLLIN); /* allocate into */ m_poll_descriptors = new pollfd[m_num_poll_descriptors]; /* get descriptors */ snd_seq_poll_descriptors(m_alsa_seq, m_poll_descriptors, m_num_poll_descriptors, POLLIN); #endif unlock(); } void mastermidibus::port_exit( int a_client, int a_port ) { lock(); #ifdef HAVE_LIBASOUND for( int i=0; i< m_num_out_buses; i++ ){ if( m_buses_out[i]->get_client() == a_client && m_buses_out[i]->get_port() == a_port ){ m_buses_out_active[i] = false; } } for( int i=0; i< m_num_in_buses; i++ ){ if( m_buses_in[i]->get_client() == a_client && m_buses_in[i]->get_port() == a_port ){ m_buses_in_active[i] = false; } } #endif unlock(); } bool mastermidibus::get_midi_event( event *a_in ) { lock(); #ifdef HAVE_LIBASOUND snd_seq_event_t *ev; bool sysex = false; bool ret = false; /* temp for midi data */ unsigned char buffer[0x1000]; snd_seq_event_input(m_alsa_seq, &ev); if (! global_manual_alsa_ports ) { switch(ev->type) { case SND_SEQ_EVENT_PORT_START: { //printf("SND_SEQ_EVENT_PORT_START: addr[%d:%d]\n", // ev->data.addr.client, ev->data.addr.port ); port_start( ev->data.addr.client, ev->data.addr.port ); ret = true; break; } case SND_SEQ_EVENT_PORT_EXIT: { //printf("SND_SEQ_EVENT_PORT_EXIT: addr[%d:%d]\n", // ev->data.addr.client, ev->data.addr.port ); port_exit( ev->data.addr.client, ev->data.addr.port ); ret = true; break; } case SND_SEQ_EVENT_PORT_CHANGE: { //printf("SND_SEQ_EVENT_PORT_CHANGE: addr[%d:%d]\n", // ev->data.addr.client, // ev->data.addr.port ); ret = true; break; } default: break; } } if (ret) { unlock(); return false; } /* alsa midi parser */ snd_midi_event_t *midi_ev; snd_midi_event_new(sizeof(buffer), &midi_ev); long bytes = snd_midi_event_decode(midi_ev, buffer, sizeof(buffer), ev); if (bytes <= 0) { unlock(); return false; } a_in->set_timestamp( ev->time.tick ); a_in->set_status( buffer[0] ); a_in->set_size( bytes ); /* we will only get EVENT_SYSEX on the first packet of midi data, the rest we have to poll for */ //if ( buffer[0] == EVENT_SYSEX ){ if (0) { /* set up for sysex if needed */ a_in->start_sysex( ); sysex = a_in->append_sysex( buffer, bytes ); } else { a_in->set_data( buffer[1], buffer[2] ); // some keyboards send on's with vel 0 for off if ( a_in->get_status() == EVENT_NOTE_ON && a_in->get_note_velocity() == 0x00 ){ a_in->set_status( EVENT_NOTE_OFF ); } sysex = false; } /* sysex messages might be more than one message */ while (sysex) { snd_seq_event_input(m_alsa_seq, &ev); bytes = snd_midi_event_decode(midi_ev, buffer, sizeof(buffer), ev); if (bytes > 0) sysex = a_in->append_sysex( buffer, bytes ); else sysex = false; } snd_midi_event_free( midi_ev ); #endif unlock(); return true; } void mastermidibus::set_sequence_input( bool a_state, sequence *a_seq ) { lock(); m_seq = a_seq; m_dumping_input = a_state; unlock(); } seq24-0.9.3/src/perftime.cpp0000644000175000017500000001342411465300367012521 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #include "event.h" #include "perftime.h" #include "font.h" perftime::perftime( perform *a_perf, Adjustment *a_hadjust ) : m_black(Gdk::Color("black")), m_white(Gdk::Color("white")), m_grey(Gdk::Color("grey")), m_mainperf(a_perf), m_hadjust(a_hadjust), m_4bar_offset(0), m_snap(c_ppqn), m_measure_length(c_ppqn * 4) { add_events( Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK ); // in the construor you can only allocate colors, // get_window() returns 0 because we have not be realized Glib::RefPtr colormap = get_default_colormap(); colormap->alloc_color( m_black ); colormap->alloc_color( m_white ); colormap->alloc_color( m_grey ); m_hadjust->signal_value_changed().connect( mem_fun( *this, &perftime::change_horz )); set_double_buffered( false ); } void perftime::increment_size() { } void perftime::update_sizes() { } void perftime::on_realize() { // we need to do the default realize Gtk::DrawingArea::on_realize(); // Now we can allocate any additional resources we need m_window = get_window(); m_gc = Gdk::GC::create( m_window ); m_window->clear(); set_size_request( 10, c_timearea_y ); } void perftime::change_horz( ) { if ( m_4bar_offset != (int) m_hadjust->get_value() ){ m_4bar_offset = (int) m_hadjust->get_value(); queue_draw(); } } void perftime::set_guides( int a_snap, int a_measure ) { m_snap = a_snap; m_measure_length = a_measure; queue_draw(); } int perftime::idle_progress( ) { return true; } void perftime::update_pixmap() { } void perftime::draw_pixmap_on_window() { } bool perftime::on_expose_event(GdkEventExpose* a_e) { /* clear background */ m_gc->set_foreground(m_white); m_window->draw_rectangle(m_gc,true, 0, 0, m_window_x, m_window_y ); m_gc->set_foreground(m_black); m_window->draw_line(m_gc, 0, m_window_y - 1, m_window_x, m_window_y - 1 ); /* draw vert lines */ m_gc->set_foreground(m_grey); long tick_offset = (m_4bar_offset * 16 * c_ppqn); long first_measure = tick_offset / m_measure_length; #if 0 0 1 2 3 4 5 6 | | | | | | | | | | | | | 0 1 2 3 4 5 #endif for ( int i=first_measure; idraw_line(m_gc, x_pos, 0, x_pos, m_window_y ); char bar[5]; snprintf( bar, sizeof(bar), "%d", i + 1 ); m_gc->set_foreground(m_black); p_font_renderer->render_string_on_drawable(m_gc, x_pos + 2, 0, m_window, bar, font::BLACK ); } long left = m_mainperf->get_left_tick( ); long right = m_mainperf->get_right_tick( ); left -= (m_4bar_offset * 16 * c_ppqn); left /= c_perf_scale_x; right -= (m_4bar_offset * 16 * c_ppqn); right /= c_perf_scale_x; if ( left >=0 && left <= m_window_x ){ m_gc->set_foreground(m_black); m_window->draw_rectangle(m_gc,true, left, m_window_y - 9, 7, 10 ); m_gc->set_foreground(m_white); p_font_renderer->render_string_on_drawable(m_gc, left + 1, 9, m_window, "L", font::WHITE ); } if ( right >=0 && right <= m_window_x ){ m_gc->set_foreground(m_black); m_window->draw_rectangle(m_gc,true, right - 6, m_window_y - 9, 7, 10 ); m_gc->set_foreground(m_white); p_font_renderer->render_string_on_drawable(m_gc, right - 6 + 1, 9, m_window, "R", font::WHITE ); } return true; } bool perftime::on_button_press_event(GdkEventButton* p0) { long tick = (long) p0->x; tick *= c_perf_scale_x; //tick = tick - (tick % (c_ppqn * 4)); tick += (m_4bar_offset * 16 * c_ppqn); tick = tick - (tick % m_snap); //if ( p0->button == 2 ) //m_mainperf->set_start_tick( tick ); if ( p0->button == 1 ) { m_mainperf->set_left_tick( tick ); } if ( p0->button == 3 ) { m_mainperf->set_right_tick( tick + m_snap ); } queue_draw(); return true; } bool perftime::on_button_release_event(GdkEventButton* p0) { return false; } void perftime::on_size_allocate(Gtk::Allocation &a_r ) { Gtk::DrawingArea::on_size_allocate( a_r ); m_window_x = a_r.get_width(); m_window_y = a_r.get_height(); } seq24-0.9.3/src/midibus_portmidi.cpp0000644000175000017500000003350312651156360014251 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #include "midibus_portmidi.h" #ifdef __WIN32__ midibus::midibus( char a_id, char a_pm_num, const char *a_client_name ) { /* set members */ m_pm_num = a_pm_num; m_id = a_id; m_clock_type = e_clock_off; m_inputing = false; /* copy names */ char tmp[60]; snprintf( tmp, 59, "[%d] %s", m_id, a_client_name ); m_name = tmp; m_pms = NULL; } int midibus::poll_for_midi( ) { if ( m_pm_num ) { PmError err = Pm_Poll( m_pms); if ( err == FALSE ) { return 0; } if ( err == TRUE ) { return 1; } printf( "Pm_Poll: %s\n", Pm_GetErrorText( err )); } return 0; } int midibus::m_clock_mod = 16 * 4; void midibus::lock( ) { m_mutex.lock(); } void midibus::unlock( ) { m_mutex.unlock(); } bool midibus::init_out( ) { PmError err = Pm_OpenOutput( &m_pms, m_pm_num, NULL, 100, NULL, NULL, 0); if ( err != pmNoError ) { printf( "Pm_OpenOutput: %s\n", Pm_GetErrorText( err )); return false; } return true; } bool midibus::init_in( ) { PmError err = Pm_OpenInput( &m_pms, m_pm_num, NULL, 100, NULL, NULL); if ( err != pmNoError ) { printf( "Pm_OpenInput: %s\n", Pm_GetErrorText( err )); return false; } return true; } int midibus::get_id( ) { return m_id; } void midibus::print() { printf( "%s" , m_name.c_str() ); } string midibus::get_name() { return m_name; } midibus::~midibus() { if ( m_pms ) Pm_Close( m_pms ); m_pms = NULL; } /* takes an native event, encodes to alsa event, puts it in the queue */ void midibus::play( event *a_e24, unsigned char a_channel ) { lock(); PmEvent event; event.timestamp = 0; /* temp for midi data */ unsigned char buffer[3]; /* fill buffer and set midi channel */ buffer[0] = a_e24->get_status(); buffer[0] += (a_channel & 0x0F); a_e24->get_data( &buffer[1], &buffer[2] ); event.message = Pm_Message(buffer[0], buffer[1], buffer[2]); /*PmError err = */Pm_Write( m_pms, &event, 1 ); unlock(); } inline long min ( long a, long b ){ if ( a < b ) return a; return b; } /* takes an native event, encodes to alsa event, puts it in the queue */ void midibus::sysex( event *a_e24 ) { lock(); unlock(); } // flushes our local queue events out into ALSA void midibus::flush() { } void midibus::init_clock( long a_tick ) { if ( m_clock_type == e_clock_pos && a_tick != 0) { continue_from( a_tick ); } else if ( m_clock_type == e_clock_mod || a_tick == 0) { start(); long clock_mod_ticks = (c_ppqn / 4) * m_clock_mod; long leftover = ( a_tick % clock_mod_ticks ); long starting_tick = a_tick - leftover; /* was there anything left?, then wait for next beat (16th note) to start clocking */ if ( leftover > 0) { starting_tick += clock_mod_ticks; } //printf ( "continue_from leftover[%ld] starting_tick[%ld]\n", leftover, starting_tick ); m_lasttick = starting_tick - 1; } } void midibus::continue_from( long a_tick ) { /* tell the device that we are going to start at a certain position */ long pp16th = (c_ppqn / 4); long leftover = ( a_tick % pp16th ); long beats = ( a_tick / pp16th ); long starting_tick = a_tick - leftover; /* was there anything left?, then wait for next beat (16th note) to start clocking */ if ( leftover > 0) { starting_tick += pp16th; } //printf ( "continue_from leftover[%ld] starting_tick[%ld]\n", leftover, starting_tick ); m_lasttick = starting_tick - 1; if ( m_clock_type != e_clock_off ) { PmEvent event; event.timestamp = 0; event.message = Pm_Message( EVENT_MIDI_CONTINUE, 0,0 ); Pm_Write( m_pms, &event, 1 ); event.message = Pm_Message( EVENT_MIDI_SONG_POS, (beats & 0x3F80 >> 7), (beats & 0x7F) ); Pm_Write( m_pms, &event, 1 ); } } /* gets it a runnin */ void midibus::start() { m_lasttick = -1; if ( m_clock_type != e_clock_off ){ PmEvent event; event.timestamp = 0; event.message = Pm_Message( EVENT_MIDI_START, 0,0 ); Pm_Write( m_pms, &event, 1 ); } } void midibus::set_clock( clock_e a_clock_type ) { m_clock_type = a_clock_type; } clock_e midibus::get_clock( ) { return m_clock_type; } void midibus::set_input( bool a_inputing ) { if ( m_inputing != a_inputing ) { m_inputing = a_inputing; } } bool midibus::get_input( ) { return m_inputing; } void midibus::stop() { m_lasttick = -1; if ( m_clock_type != e_clock_off ) { PmEvent event; event.timestamp = 0; event.message = Pm_Message( EVENT_MIDI_STOP, 0,0 ); Pm_Write( m_pms, &event, 1 ); } } // generates midi clock void midibus::clock( long a_tick ) { lock(); if ( m_clock_type != e_clock_off ){ bool done = false; long uptotick = a_tick; if ( m_lasttick >= uptotick ) done = true; while ( !done ){ m_lasttick++; if ( m_lasttick >= uptotick ) done = true; /* tick time? */ if ( m_lasttick % ( c_ppqn / 24 ) == 0 ) { PmEvent event; event.timestamp = 0; event.message = Pm_Message( EVENT_MIDI_CLOCK, 0,0 ); Pm_Write( m_pms, &event, 1 ); } } } unlock(); } void mastermidibus::lock( ) { // printf( "mastermidibus::lock()\n" ); m_mutex.lock(); } void mastermidibus::unlock( ) { // printf( "mastermidibus::unlock()\n" ); m_mutex.unlock(); } /* gets it a runnin */ void mastermidibus::start() { lock(); for ( int i=0; i < m_num_out_buses; i++ ) m_buses_out[i]->start(); unlock(); } /* gets it a runnin */ void mastermidibus::continue_from( long a_tick) { lock(); for ( int i=0; i < m_num_out_buses; i++ ) m_buses_out[i]->continue_from( a_tick ); unlock(); } void mastermidibus::init_clock( long a_tick ) { lock(); for ( int i=0; i < m_num_out_buses; i++ ) m_buses_out[i]->init_clock( a_tick ); unlock(); } void mastermidibus::stop() { lock(); for ( int i=0; i < m_num_out_buses; i++ ) m_buses_out[i]->stop(); unlock(); } // generates midi clock void mastermidibus::clock( long a_tick ) { lock(); for ( int i=0; i < m_num_out_buses; i++ ) m_buses_out[i]->clock( a_tick ); unlock(); } void mastermidibus::set_ppqn( int a_ppqn ) { lock(); m_ppqn = a_ppqn; unlock(); } void mastermidibus::set_bpm( int a_bpm ) { lock(); m_bpm = a_bpm; unlock(); } // flushes our local queue events out into ALSA void mastermidibus::flush() { } /* fills the array with our buses */ mastermidibus::mastermidibus() { /* temp return */ //int ret; /* set initial number buses */ m_num_out_buses = 0; m_num_in_buses = 0; for( int i=0; iinterf, dev_info->name, dev_info->input, dev_info->output ); if ( dev_info->output ) { m_buses_out[m_num_out_buses] = new midibus( m_num_out_buses, i, dev_info->name ); if ( m_buses_out[m_num_out_buses]->init_out() ) { m_buses_out_active[m_num_out_buses] = true; m_buses_out_init[m_num_out_buses] = true; m_num_out_buses++; } else { delete m_buses_out[m_num_out_buses]; } } if ( dev_info->input ) { m_buses_in[m_num_in_buses] = new midibus( m_num_in_buses, i, dev_info->name ); if ( m_buses_in[m_num_in_buses]->init_in()) { m_buses_in_active[m_num_in_buses] = true; m_buses_in_init[m_num_in_buses] = true; m_num_in_buses++; } else { delete m_buses_in[m_num_in_buses]; } } } set_bpm( c_bpm ); set_ppqn( c_ppqn ); /* midi input */ /* poll descriptors */ set_sequence_input( false, NULL ); for ( int i=0; isysex( a_ev ); flush(); unlock(); } void mastermidibus::play( unsigned char a_bus, event *a_e24, unsigned char a_channel ) { lock(); if ( m_buses_out_active[a_bus] && a_bus < m_num_out_buses ){ m_buses_out[a_bus]->play( a_e24, a_channel ); } unlock(); } void mastermidibus::set_clock( unsigned char a_bus, clock_e a_clock_type ) { lock(); if ( a_bus < c_maxBuses ){ m_init_clock[a_bus] = a_clock_type; } if ( m_buses_out_active[a_bus] && a_bus < m_num_out_buses ){ m_buses_out[a_bus]->set_clock( a_clock_type ); } unlock(); } clock_e mastermidibus::get_clock( unsigned char a_bus ) { if ( m_buses_out_active[a_bus] && a_bus < m_num_out_buses ){ return m_buses_out[a_bus]->get_clock(); } return e_clock_off; } void midibus::set_clock_mod( int a_clock_mod ) { if (a_clock_mod != 0 ) m_clock_mod = a_clock_mod; } int midibus::get_clock_mod() { return m_clock_mod; } void mastermidibus::set_input( unsigned char a_bus, bool a_inputing ) { lock(); if ( a_bus < c_maxBuses ){ m_init_input[a_bus] = a_inputing; } if ( m_buses_in_active[a_bus] && a_bus < m_num_in_buses ){ m_buses_in[a_bus]->set_input( a_inputing ); } unlock(); } bool mastermidibus::get_input( unsigned char a_bus ) { if ( m_buses_in_active[a_bus] && a_bus < m_num_in_buses ){ return m_buses_in[a_bus]->get_input(); } return false; } string mastermidibus::get_midi_out_bus_name( int a_bus ) { if ( m_buses_out_active[a_bus] && a_bus < m_num_out_buses ){ return m_buses_out[a_bus]->get_name(); } return "error..."; } string mastermidibus::get_midi_in_bus_name( int a_bus ) { if ( m_buses_in_active[a_bus] && a_bus < m_num_in_buses ){ return m_buses_in[a_bus]->get_name(); } return "error..."; } void mastermidibus::print() { printf( "Available Buses\n"); for ( int i=0; im_name.c_str() ); } } int mastermidibus::get_num_out_buses() { return m_num_out_buses; } int mastermidibus::get_num_in_buses() { return m_num_in_buses; } int mastermidibus::poll_for_midi( ) { //int ret = 0; while(1) { for ( int i=0; ipoll_for_midi( )) { return 1; } } Sleep(1); return 0; } } bool mastermidibus::is_more_input( ){ lock(); int size=0; for ( int i=0; ipoll_for_midi( )) { size = 1; } } unlock(); return ( size > 0 ); } bool mastermidibus::get_midi_event( event *a_in ) { lock(); bool ret = false; PmEvent event; PmError err; for ( int i=0; ipoll_for_midi( )) { err = Pm_Read( m_buses_in[i]->m_pms, &event, 1 ); if ( err < 0 ) { printf( "Pm_Read: %s\n", Pm_GetErrorText( err )); } if ( m_buses_in[i]->m_inputing ) ret = true; } } if( !ret ){ unlock(); return false; } a_in->set_status( Pm_MessageStatus(event.message)); a_in->set_size( 3 ); a_in->set_data( Pm_MessageData1(event.message), Pm_MessageData2(event.message) ); // some keyboards send on's with vel 0 for off if ( a_in->get_status() == EVENT_NOTE_ON && a_in->get_note_velocity() == 0x00 ){ a_in->set_status( EVENT_NOTE_OFF ); } unlock(); return true; } void mastermidibus::set_sequence_input( bool a_state, sequence *a_seq ) { lock(); m_seq = a_seq; m_dumping_input = a_state; unlock(); } #endif seq24-0.9.3/src/maintime.h0000644000175000017500000000255112651156360012155 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #pragma once #include "globals.h" const int c_maintime_x = 300; const int c_maintime_y = 10; const int c_pill_width = 8; /* main time*/ class maintime: public Gtk::DrawingArea { private: Glib::RefPtr m_gc; Glib::RefPtr m_window; Gdk::Color m_black, m_white, m_grey; void on_realize(); bool on_expose_event(GdkEventExpose* a_ev); long m_tick; public: int idle_progress( long a_ticks ); maintime( ); }; seq24-0.9.3/src/configfile.cpp0000644000175000017500000000327311473026367013020 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #include "configfile.h" #include configfile::configfile(const Glib::ustring& a_name) : m_pos(0), m_name(a_name) { } configfile::~configfile( ) { } void configfile::next_data_line( ifstream *a_file) { a_file->getline( m_line, sizeof(m_line) ); while (( m_line[0] == '#' || m_line[0] == ' ' || m_line[0] == 0 ) && !a_file->eof() ) { a_file->getline( m_line, sizeof(m_line) ); } } void configfile::line_after( ifstream *a_file, string a_tag) { /* run to start */ a_file->clear(); a_file->seekg( 0, ios::beg ); a_file->getline( m_line, sizeof(m_line) ); while ( strncmp( m_line, a_tag.c_str(), a_tag.length()) != 0 && !a_file->eof() ) { a_file->getline( m_line, sizeof(m_line) ); } next_data_line( a_file ); } seq24-0.9.3/src/seqtime.h0000644000175000017500000000451212651156360012020 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #pragma once #include "sequence.h" #include "seqtime.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include "globals.h" /* piano time*/ class seqtime: public Gtk::DrawingArea { private: Glib::RefPtr m_gc; Glib::RefPtr m_window; Gdk::Color m_black, m_white, m_grey; Glib::RefPtr m_pixmap; Gtk::Adjustment *m_hadjust; int m_scroll_offset_ticks; int m_scroll_offset_x; sequence *m_seq; /* one pixel == m_zoom ticks */ int m_zoom; int m_window_x, m_window_y; void on_realize(); bool on_expose_event(GdkEventExpose* a_ev); bool on_button_press_event(GdkEventButton* a_ev); bool on_button_release_event(GdkEventButton* a_ev); void draw_pixmap_on_window(); void draw_progress_on_window(); void update_pixmap(); bool idle_progress(); void on_size_allocate(Gtk::Allocation& ); void change_horz(); void update_sizes(); void force_draw(); public: seqtime( sequence *a_seq, int a_zoom, Gtk::Adjustment *a_hadjust ); void reset(); void redraw(); void set_zoom( int a_zoom ); }; seq24-0.9.3/src/event.h0000644000175000017500000001005412651200767011471 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #pragma once #include #include #include "globals.h" const unsigned char EVENT_STATUS_BIT = 0x80; const unsigned char EVENT_NOTE_OFF = 0x80; const unsigned char EVENT_NOTE_ON = 0x90; const unsigned char EVENT_AFTERTOUCH = 0xA0; const unsigned char EVENT_CONTROL_CHANGE = 0xB0; const unsigned char EVENT_PROGRAM_CHANGE = 0xC0; const unsigned char EVENT_CHANNEL_PRESSURE = 0xD0; const unsigned char EVENT_PITCH_WHEEL = 0xE0; const unsigned char EVENT_CLEAR_CHAN_MASK = 0xF0; const unsigned char EVENT_MIDI_SONG_POS = 0xF2; const unsigned char EVENT_MIDI_CLOCK = 0xF8; const unsigned char EVENT_MIDI_START = 0xFA; const unsigned char EVENT_MIDI_CONTINUE = 0xFB; const unsigned char EVENT_MIDI_STOP = 0xFC; const unsigned char EVENT_SYSEX = 0xF0; const unsigned char EVENT_SYSEX_END = 0xF7; class event { private: /* timestamp in ticks */ unsigned long m_timestamp; /* status byte without channel */ /* channel will be appended on bus */ /* high nibble = type of event*/ /* low nibble = channel */ /* bit 7 is present in all status bytes */ unsigned char m_status; /* data for event */ unsigned char m_data[2]; /* data for sysex */ vector m_sysex; /* used to link note ons and offs together */ event *m_linked; bool m_has_link; /* is this event selected in editing */ bool m_selected; /* is this event marked in processing */ bool m_marked; /* is this event being painted */ bool m_painted; /* used in sorting */ int get_rank( ) const; public: event(); void set_timestamp( const unsigned long time ); long get_timestamp(); void mod_timestamp( unsigned long a_mod ); void set_status( const char status ); unsigned char get_status( ); void set_data( const char D1 ); void set_data( const char D1, const char D2 ); void get_data( unsigned char *D0, unsigned char *D1 ); void increment_data1(); void decrement_data1(); void increment_data2(); void decrement_data2(); void start_sysex(); bool append_sysex( unsigned char *a_data, long size ); unsigned char *get_sysex(); void set_note( char a_note ); void set_size( long a_size ); long get_size(); void link( event *event ); event *get_linked( ); bool is_linked( ); void clear_link( ); void paint( ); void unpaint( ); bool is_painted( ); void mark( ); void unmark( ); bool is_marked( ); void select( ); void unselect( ); bool is_selected( ); /* set status to midi clock */ void make_clock( ); /* gets the note assuming its note on/off */ unsigned char get_note(); unsigned char get_note_velocity(); void set_note_velocity( int a_vel ); /* returns true if status is set */ bool is_note_on(); bool is_note_off(); void print(); /* overloads */ bool operator> ( const event &rhsevent ); bool operator< ( const event &rhsevent ); bool operator<=( const unsigned long &rhslong ); bool operator> ( const unsigned long &rhslong ); friend class sequence; }; seq24-0.9.3/src/sequence.h0000644000175000017500000002751212651156360012166 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #pragma once class sequence; #include #include #include #include "event.h" #include "midibus.h" #include "globals.h" #include "mutex.h" enum draw_type { DRAW_FIN = 0, DRAW_NORMAL_LINKED, DRAW_NOTE_ON, DRAW_NOTE_OFF }; /* used in playback */ class trigger { public: long m_tick_start; long m_tick_end; bool m_selected; long m_offset; trigger (){ m_tick_start = 0; m_tick_end = 0; m_offset = 0; m_selected = false; }; bool operator< (trigger rhs){ if (m_tick_start < rhs.m_tick_start) return true; return false; }; }; class sequence { private: /* holds the events */ list < event > m_list_event; static list < event > m_list_clipboard; list < trigger > m_list_trigger; trigger m_trigger_clipboard; stack < list < event > >m_list_undo; stack < list < event > >m_list_redo; stack < list < trigger > >m_list_trigger_undo; stack < list < trigger > >m_list_trigger_redo; /* markers */ list < event >::iterator m_iterator_play; list < event >::iterator m_iterator_draw; list < trigger >::iterator m_iterator_play_trigger; list < trigger >::iterator m_iterator_draw_trigger; /* contains the proper midi channel */ char m_midi_channel; char m_bus; /* song playback mode mute */ bool m_song_mute; /* polyphonic step edit note counter */ int m_notes_on; /* outputs to sequence to this Bus on midichannel */ mastermidibus *m_masterbus; /* map for noteon, used when muting, to shut off current messages */ int m_playing_notes[c_midi_notes]; /* states */ bool m_was_playing; bool m_playing; bool m_recording; bool m_quanized_rec; bool m_thru; bool m_queued; bool m_trigger_copied; /* flag indicates that contents has changed from a recording */ bool m_dirty_main; bool m_dirty_edit; bool m_dirty_perf; bool m_dirty_names; /* anything editing currently ? */ bool m_editing; bool m_raise; /* named sequence */ string m_name; /* where were we */ long m_last_tick; long m_queued_tick; long m_trigger_offset; /* length of sequence in pulses should be powers of two in bars */ long m_length; long m_snap_tick; /* these are just for the editor to mark things in correct time */ //long m_length_measures; long m_time_beats_per_measure; long m_time_beat_width; long m_rec_vol; /* locking */ mutex m_mutex; /* used to idenfity which events are ours in the out queue */ //unsigned char m_tag; /* takes an event this sequence is holding and places it on our midibus */ void put_event_on_bus (event * a_e); /* resetes the location counters */ void reset_loop (); void remove_all (); /* mutex */ void lock (); void unlock (); /* sets m_trigger_offset and wraps it to length */ void set_trigger_offset (long a_trigger_offset); void split_trigger( trigger &trig, long a_split_tick); void adjust_trigger_offsets_to_legnth( long a_new_len ); long adjust_offset( long a_offset ); void remove( list::iterator i ); void remove( event* e ); public: sequence (); ~sequence (); void push_undo (); void pop_undo (); void pop_redo (); void push_trigger_undo (); void pop_trigger_undo (); // // Gets and Sets // /* name */ void set_name (string a_name); void set_name (char *a_name); void set_measures (long a_length_measures); long get_measures (); void set_bpm (long a_beats_per_measure); long get_bpm (); void set_bw (long a_beat_width); long get_bw (); void set_rec_vol (long a_rec_vol); void set_song_mute (bool a_mute); bool get_song_mute (); /* returns string of name */ const char *get_name (); void set_editing (bool a_edit) { m_editing = a_edit; }; bool get_editing () { return m_editing; }; void set_raise (bool a_edit) { m_raise = a_edit; }; bool get_raise () { return m_raise; }; /* length in ticks */ void set_length (long a_len, bool a_adjust_triggers = true); long get_length (); /* returns last tick played.. used by editors idle function */ long get_last_tick (); /* sets state. when playing, and sequencer is running, notes get dumped to the alsa buffers */ void set_playing (bool); bool get_playing (); void toggle_playing (); void toggle_queued (); void off_queued (); bool get_queued (); long get_queued_tick (); void set_recording (bool); bool get_recording (); void set_snap_tick( int a_st ); void set_quanized_rec( bool a_qr ); bool get_quanidez_rec( ); void set_thru (bool); bool get_thru (); /* singals that a redraw is needed from recording */ /* resets flag on call */ bool is_dirty_main (); bool is_dirty_edit (); bool is_dirty_perf (); bool is_dirty_names (); void set_dirty_mp(); void set_dirty(); /* midi channel */ unsigned char get_midi_channel (); void set_midi_channel (unsigned char a_ch); /* dumps contents to stdout */ void print (); void print_triggers(); /* dumps notes from tick and prebuffers to ahead. Called by sequencer thread - performance */ void play (long a_tick, bool a_playback_mode); void set_orig_tick (long a_tick); // // Selection and Manipulation // /* adds event to internal list */ void add_event (const event * a_e); void add_trigger (long a_tick, long a_length, long a_offset = 0, bool a_adjust_offset = true); void split_trigger( long a_tick ); void grow_trigger (long a_tick_from, long a_tick_to, long a_length); void del_trigger (long a_tick ); bool get_trigger_state (long a_tick); bool select_trigger(long a_tick); bool unselect_triggers (); bool intersectTriggers( long position, long& start, long& end ); bool intersectNotes( long position, long position_note, long& start, long& end, long& note ); bool intersectEvents( long posstart, long posend, long status, long& start ); void del_selected_trigger(); void cut_selected_trigger(); void copy_selected_trigger(); void paste_trigger(); void move_selected_triggers_to(long a_tick, bool a_adjust_offset, int a_which=2); long get_selected_trigger_start_tick(); long get_selected_trigger_end_tick(); long get_max_trigger (); void move_triggers (long a_start_tick, long a_distance, bool a_direction); void copy_triggers (long a_start_tick, long a_distance); void clear_triggers (); long get_trigger_offset (); /* sets the midibus to dump to */ void set_midi_bus (char a_mb); char get_midi_bus (); void set_master_midi_bus (mastermidibus * a_mmb); enum select_action_e { e_select, e_select_one, e_is_selected, e_would_select, e_deselect, // deselect under cursor e_toggle_selection, // sel/deselect under cursor e_remove_one // remove one note under cursor }; /* select note events in range, returns number selected */ int select_note_events (long a_tick_s, int a_note_h, long a_tick_f, int a_note_l, select_action_e a_action ); /* select events in range, returns number selected */ int select_events (long a_tick_s, long a_tick_f, unsigned char a_status, unsigned char a_cc, select_action_e a_action); int get_num_selected_notes (); int get_num_selected_events (unsigned char a_status, unsigned char a_cc); void select_all (); void copy_selected (); void paste_selected (long a_tick, int a_note); /* returns the 'box' of selected items */ void get_selected_box (long *a_tick_s, int *a_note_h, long *a_tick_f, int *a_note_l); /* returns the 'box' of selected items */ void get_clipboard_box (long *a_tick_s, int *a_note_h, long *a_tick_f, int *a_note_l); /* removes and adds readds selected in position */ void move_selected_notes (long a_delta_tick, int a_delta_note); /* adds a single note on / note off pair */ void add_note (long a_tick, long a_length, int a_note, bool a_paint = false); void add_event (long a_tick, unsigned char a_status, unsigned char a_d0, unsigned char a_d1, bool a_paint = false); void stream_event (event * a_ev); /* changes velocities in a ramping way from vel_s to vel_f */ void change_event_data_range (long a_tick_s, long a_tick_f, unsigned char a_status, unsigned char a_cc, int a_d_s, int a_d_f); //unsigned char a_d_s, unsigned char a_d_f); /* moves note off event */ void increment_selected (unsigned char a_status, unsigned char a_control); void decrement_selected (unsigned char a_status, unsigned char a_control); /* moves note off event */ void grow_selected (long a_delta_tick); void stretch_selected(long a_delta_tick); /* deletes events */ void remove_marked(); void mark_selected(); void unpaint_all(); /* unselects every event */ void unselect (); /* verfies state, all noteons have an off, links noteoffs with their ons */ void verify_and_link (); void link_new (); /* resets everything to zero, used when sequencer stops */ void zero_markers (); /* flushes a note to the midibus to preview its sound, used by the virtual paino */ void play_note_on (int a_note); void play_note_off (int a_note); /* send a note off for all active notes */ void off_playing_notes (); // // Drawing functions // /* resets draw marker so calls to getNextnoteEvent will start from the first */ void reset_draw_marker (); void reset_draw_trigger_marker (); /* each call seqdata( sequence *a_seq, int a_scale );fills the passed refrences with a events elements, and returns true. When it has no more events, returns a false */ draw_type get_next_note_event (long *a_tick_s, long *a_tick_f, int *a_note, bool * a_selected, int *a_velocity); int get_lowest_note_event (); int get_highest_note_event (); bool get_next_event (unsigned char a_status, unsigned char a_cc, long *a_tick, unsigned char *a_D0, unsigned char *a_D1, bool * a_selected); bool get_next_event (unsigned char *a_status, unsigned char *a_cc); bool get_next_trigger (long *a_tick_on, long *a_tick_off, bool * a_selected, long *a_tick_offset); sequence & operator= (const sequence & a_rhs); void fill_list (list < char >*a_list, int a_pos); void select_events (unsigned char a_status, unsigned char a_cc, bool a_inverse = false); void quanize_events (unsigned char a_status, unsigned char a_cc, long a_snap_tick, int a_divide, bool a_linked = false); void transpose_notes (int a_steps, int a_scale); }; seq24-0.9.3/src/mutex.h0000644000175000017500000000250712651156360011515 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #pragma once #include "globals.h" #include class mutex { private: static const pthread_mutex_t recmutex; protected: /* mutex lock */ pthread_mutex_t m_mutex_lock; public: mutex(); void lock(); void unlock(); }; class condition_var : public mutex { private: static const pthread_cond_t cond; pthread_cond_t m_cond; public: condition_var(); void wait(); void signal(); }; seq24-0.9.3/src/seqevent.h0000644000175000017500000001147112651156360012205 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #pragma once #include "sequence.h" #include "seqkeys.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "globals.h" #include "seqdata.h" using namespace Gtk; // interaction methods class seqevent; struct FruitySeqEventInput { FruitySeqEventInput() : m_justselected_one(false), m_is_drag_pasting_start(false), m_is_drag_pasting(false) {} bool m_justselected_one; bool m_is_drag_pasting_start; bool m_is_drag_pasting; bool on_button_press_event(GdkEventButton* a_ev, seqevent& ths); bool on_button_release_event(GdkEventButton* a_ev, seqevent& ths); bool on_motion_notify_event(GdkEventMotion* a_ev, seqevent& ths); void updateMousePtr(seqevent& ths); }; struct Seq24SeqEventInput { Seq24SeqEventInput() : m_adding( false ) {} bool on_button_press_event(GdkEventButton* a_ev, seqevent& ths); bool on_button_release_event(GdkEventButton* a_ev, seqevent& ths); bool on_motion_notify_event(GdkEventMotion* a_ev, seqevent& ths); void set_adding( bool a_adding, seqevent& ths ); bool m_adding; }; /* piano event */ class seqevent : public Gtk::DrawingArea { private: friend struct FruitySeqEventInput; FruitySeqEventInput m_fruity_interaction; friend struct Seq24SeqEventInput; Seq24SeqEventInput m_seq24_interaction; Glib::RefPtr m_gc; Glib::RefPtr m_window; Gdk::Color m_black, m_white, m_grey, m_dk_grey, m_red; Glib::RefPtr m_pixmap; GdkRectangle m_old; GdkRectangle m_selected; Gtk::Adjustment * const m_hadjust; int m_scroll_offset_ticks; int m_scroll_offset_x; sequence * const m_seq; seqdata * const m_seqdata_wid; /* one pixel == m_zoom ticks */ int m_zoom; int m_snap; int m_window_x, m_window_y; /* when highlighting a bunch of events */ bool m_selecting; bool m_moving_init; bool m_moving; bool m_growing; bool m_painting; bool m_paste; /* where the dragging started */ int m_drop_x; int m_drop_y; int m_current_x; int m_current_y; int m_move_snap_offset_x; /* what is the data window currently editing ? */ unsigned char m_status; unsigned char m_cc; void on_realize(); bool on_expose_event(GdkEventExpose* a_ev); bool on_button_press_event(GdkEventButton* a_ev); bool on_button_release_event(GdkEventButton* a_ev); bool on_motion_notify_event(GdkEventMotion* a_ev); bool on_key_press_event(GdkEventKey* a_p0); bool on_focus_in_event(GdkEventFocus*); bool on_focus_out_event(GdkEventFocus*); void convert_x( int a_x, long *a_ticks ); void convert_t( long a_ticks, int *a_x ); void snap_y( int *a_y ); void snap_x( int *a_x ); void x_to_w( int a_x1, int a_x2, int *a_x, int *a_w ); void drop_event( long a_tick ); void draw_events_on ( Glib::RefPtr a_draw ); void start_paste(); void on_size_allocate(Gtk::Allocation& ); void change_horz(); void force_draw(); public: seqevent( sequence *a_seq, int a_zoom, int a_snap, seqdata *a_seqdata_wid, Gtk::Adjustment *a_hadjust ); void reset(); void redraw(); void set_zoom( int a_zoom ); void set_snap( int a_snap ); void set_data_type( unsigned char a_status, unsigned char a_control ); void update_sizes(); void draw_background(); void draw_events_on_pixmap(); void draw_pixmap_on_window(); void draw_selection_on_window(); void update_pixmap(); int idle_redraw(); }; seq24-0.9.3/src/perfnames.cpp0000644000175000017500000002157212651156360012671 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #include "perfnames.h" #include "font.h" perfnames::perfnames( perform *a_perf, Adjustment *a_vadjust ): seqmenu(a_perf), m_black(Gdk::Color( "black" )), m_white(Gdk::Color( "white" )), m_grey(Gdk::Color( "grey" )), m_mainperf(a_perf), m_vadjust(a_vadjust), m_sequence_offset(0) { add_events( Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK | Gdk::SCROLL_MASK ); /* set default size */ set_size_request( c_names_x, 100 ); // in the construor you can only allocate colors, // get_window() returns 0 because we have not be realized Glib::RefPtr colormap= get_default_colormap(); colormap->alloc_color( m_black ); colormap->alloc_color( m_white ); colormap->alloc_color( m_grey ); m_vadjust->signal_value_changed().connect( mem_fun( *(this), &perfnames::change_vert )); set_double_buffered( false ); for( int i=0; iclear(); m_pixmap = Gdk::Pixmap::create(m_window, c_names_x, c_names_y * c_total_seqs + 1, -1); } void perfnames::change_vert( ) { if ( m_sequence_offset != (int) m_vadjust->get_value() ){ m_sequence_offset = (int) m_vadjust->get_value(); queue_draw(); } } void perfnames::update_pixmap() { } void perfnames::draw_area(){ } void perfnames::redraw( int sequence ) { draw_sequence( sequence); } void perfnames::draw_sequence( int sequence ) { int i = sequence - m_sequence_offset; if ( sequence < c_total_seqs ){ m_gc->set_foreground(m_black); m_window->draw_rectangle(m_gc,true, 0, (c_names_y * i) , c_names_x, c_names_y + 1 ); if ( sequence % c_seqs_in_set == 0 ){ char ss[3]; snprintf(ss, sizeof(ss), "%2d", sequence / c_seqs_in_set ); m_gc->set_foreground(m_white); p_font_renderer->render_string_on_drawable(m_gc, 2, c_names_y * i + 2, m_window, ss, font::WHITE ); } else { m_gc->set_foreground(m_white); m_window->draw_rectangle(m_gc,true, 1, (c_names_y * (i)), (6*2) + 1, c_names_y ); } if ( m_mainperf->is_active( sequence )) m_gc->set_foreground(m_white); else m_gc->set_foreground(m_grey); m_window->draw_rectangle(m_gc,true, 6 * 2 + 3, (c_names_y * i) + 1, c_names_x - 3 - (6*2), c_names_y - 1 ); if ( m_mainperf->is_active( sequence )){ m_sequence_active[sequence]=true; /* names */ char name[50]; snprintf(name, sizeof(name), "%-14.14s %2d", m_mainperf->get_sequence(sequence)->get_name(), m_mainperf->get_sequence(sequence)->get_midi_channel() + 1); p_font_renderer->render_string_on_drawable(m_gc, 5 + 6*2, c_names_y * i + 2, m_window, name, font::BLACK ); char str[20]; snprintf(str, sizeof(str), "%d-%d %ld/%ld", m_mainperf->get_sequence(sequence)->get_midi_bus(), m_mainperf->get_sequence(sequence)->get_midi_channel()+1, m_mainperf->get_sequence(sequence)->get_bpm(), m_mainperf->get_sequence(sequence)->get_bw() ); p_font_renderer->render_string_on_drawable(m_gc, 5 + 6*2, c_names_y * i + 12, m_window, str, font::BLACK ); bool muted = m_mainperf->get_sequence(sequence)->get_song_mute(); m_gc->set_foreground(m_black); m_window->draw_rectangle(m_gc,muted, 6*2 + 6 * 20 + 2, (c_names_y * i), 10, c_names_y ); if ( muted ){ p_font_renderer->render_string_on_drawable(m_gc, 5 + 6*2 + 6 * 20, c_names_y * i + 2, m_window, "M", font::WHITE ); } else { p_font_renderer->render_string_on_drawable(m_gc, 5 + 6*2 + 6 * 20, c_names_y * i + 2, m_window, "M", font::BLACK ); } } } else { m_gc->set_foreground(m_grey); m_window->draw_rectangle(m_gc,true, 0, (c_names_y * i) + 1 , c_names_x, c_names_y ); } } bool perfnames::on_expose_event(GdkEventExpose* a_e) { int seqs = (m_window_y / c_names_y) + 1; for ( int i=0; i< seqs; i++ ){ int sequence = i + m_sequence_offset; draw_sequence(sequence); } return true; } void perfnames::convert_y( int a_y, int *a_seq) { *a_seq = a_y / c_names_y; *a_seq += m_sequence_offset; if ( *a_seq >= c_total_seqs ) *a_seq = c_total_seqs - 1; if ( *a_seq < 0 ) *a_seq = 0; } bool perfnames::on_button_press_event(GdkEventButton *a_e) { int sequence; /*int x = (int) a_e->x;*/ int y = (int) a_e->y; convert_y( y, &sequence ); m_current_seq = sequence; /* left mouse button */ if ( a_e->button == 1 ){ if ( m_mainperf->is_active( sequence )){ bool muted = m_mainperf->get_sequence(sequence)->get_song_mute(); m_mainperf->get_sequence(sequence)->set_song_mute( !muted ); queue_draw(); } } return true; } bool perfnames::on_button_release_event(GdkEventButton* p0) { /* right mouse button */ if ( p0->button == 3 ){ popup_menu(); } return false; } bool perfnames::on_scroll_event( GdkEventScroll* a_ev ) { double val = m_vadjust->get_value(); if ( a_ev->direction == GDK_SCROLL_UP ){ val -= m_vadjust->get_step_increment(); } if ( a_ev->direction == GDK_SCROLL_DOWN ){ val += m_vadjust->get_step_increment(); } m_vadjust->clamp_page( val, val + m_vadjust->get_page_size()); return true; } void perfnames::on_size_allocate(Gtk::Allocation &a_r ) { Gtk::DrawingArea::on_size_allocate( a_r ); m_window_x = a_r.get_width(); m_window_y = a_r.get_height(); } void perfnames::redraw_dirty_sequences() { int y_s = 0; int y_f = m_window_y / c_names_y; for ( int y=y_s; y<=y_f; y++ ){ int seq = y + m_sequence_offset; // 4am if ( seq < c_total_seqs){ bool dirty = (m_mainperf->is_dirty_names( seq )); if (dirty) { draw_sequence( seq ); } } } } seq24-0.9.3/src/globals.h0000644000175000017500000001636112651156360012001 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #pragma once #ifdef __WIN32__ # include "configwin32.h" #else # include "config.h" #endif #include #include #include //For keys #include using namespace std; /* 16 per screen */ const int c_mainwnd_rows = 4; const int c_mainwnd_cols = 8; const int c_seqs_in_set = c_mainwnd_rows * c_mainwnd_cols; const int c_gmute_tracks = c_seqs_in_set * c_seqs_in_set; const int c_max_sets = 32; const int c_total_seqs = c_seqs_in_set * c_max_sets; /* number of sequences */ /* 32 screen sets */ const int c_max_sequence = c_mainwnd_rows * c_mainwnd_cols * c_max_sets; const int c_ppqn = 192; /* default - dosnt change */ const int c_bpm = 120; /* default */ const int c_maxBuses = 32; /* trigger width in milliseconds */ const int c_thread_trigger_width_ms = 4; const int c_thread_trigger_lookahead_ms = 2; /* for the seqarea class */ const int c_text_x = 6; const int c_text_y = 12; const int c_seqarea_x = c_text_x * 15; const int c_seqarea_y = c_text_y * 5; const int c_mainwid_border = 0; const int c_mainwid_spacing = 2; const int c_control_height = 0; const int c_mainwid_x = ((c_seqarea_x + c_mainwid_spacing ) * c_mainwnd_cols - c_mainwid_spacing + c_mainwid_border * 2 ); const int c_mainwid_y = ((c_seqarea_y + c_mainwid_spacing ) * c_mainwnd_rows + c_mainwid_border * 2 + c_control_height ); /* data entry area (velocity, aftertouch, etc ) */ const int c_dataarea_y = 128; /* width of 'bar' */ const int c_data_x = 2; /* keyboard */ const int c_key_x = 16; const int c_key_y = 8; const int c_num_keys = 128; const int c_keyarea_y = c_key_y * c_num_keys + 1; const int c_keyarea_x = 36; const int c_keyoffset_x = c_keyarea_x - c_key_x; /* paino roll */ const int c_rollarea_y = c_keyarea_y; /* events bar */ const int c_eventarea_y = 16; const int c_eventevent_y = 10; const int c_eventevent_x = 5; /* time scale window on top */ const int c_timearea_y = 18; /* sequences */ const int c_midi_notes = 256; const std::string c_dummy( "Untitled" ); /* maximum size of sequence, default size */ const int c_maxbeats = 0xFFFF; /* max number of beats in a sequence */ /* midifile tags */ const unsigned long c_midibus = 0x24240001; const unsigned long c_midich = 0x24240002; const unsigned long c_midiclocks = 0x24240003; const unsigned long c_triggers = 0x24240004; const unsigned long c_notes = 0x24240005; const unsigned long c_timesig = 0x24240006; const unsigned long c_bpmtag = 0x24240007; const unsigned long c_triggers_new = 0x24240008; const unsigned long c_midictrl = 0x24240010; const unsigned long c_mutegroups = 0x24240009; // not sure why we went to 10 above, this might need a different value const char c_font_6_12[] = "-*-fixed-medium-r-*--12-*-*-*-*-*-*"; const char c_font_8_13[] = "-*-fixed-medium-r-*--13-*-*-*-*-*-*"; const char c_font_5_7[] = "-*-fixed-medium-r-*--7-*-*-*-*-*-*"; /* used in menu to tell setState what to do */ const int c_adding = 0; const int c_normal = 1; const int c_paste = 2; /* redraw when recording ms */ #ifdef __WIN32__ const int c_redraw_ms = 20; #else const int c_redraw_ms = 40; #endif /* consts for perform editor */ const int c_names_x = 6 * 24; const int c_names_y = 22; const int c_perf_scale_x = 32; /*ticks per pixel */ extern bool global_showmidi; extern bool global_priority; extern bool global_stats; extern bool global_pass_sysex; extern bool global_with_jack_transport; extern bool global_with_jack_master; extern bool global_with_jack_master_cond; extern bool global_jack_start_mode; extern bool global_manual_alsa_ports; extern Glib::ustring global_filename; extern Glib::ustring global_jack_session_uuid; extern Glib::ustring last_used_dir; extern bool is_pattern_playing; extern bool global_print_keys; const int c_max_instruments = 64; struct user_midi_bus_definition { std::string alias; int instrument[16]; }; struct user_instrument_definition { std::string instrument; bool controllers_active[128]; std::string controllers[128]; }; extern user_midi_bus_definition global_user_midi_bus_definitions[c_maxBuses]; extern user_instrument_definition global_user_instrument_definitions[c_max_instruments]; /* scales */ enum c_music_scales { c_scale_off, c_scale_major, c_scale_minor, c_scale_size }; const bool c_scales_policy[c_scale_size][12] = { /* off = chromatic */ { true,true,true,true,true,true,true,true,true,true,true,true}, /* major */ { true,false,true,false,true,true,false,true,false,true,false,true}, /* minor */ { true,false,true,true,false,true,false,true,true,false,true,false}, }; const int c_scales_transpose_up[c_scale_size][12] = { /* off = chromatic */ { 1,1,1,1,1,1,1,1,1,1,1,1}, /* major */ { 2,0,2,0,1,2,0,2,0,2,0,1}, /* minor */ { 2,0,1,2,0,2,0,1,2,0,2,0}, }; const int c_scales_transpose_dn[c_scale_size][12] = { /* off = chromatic */ { -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, /* major */ { -1,0,-2,0,-2,-1,0,-2,0,-2,0,-2}, /* minor */ { -2,0,-2,-1,0,-2,0,-2,-1,0,-2,0}, }; const int c_scales_symbol[c_scale_size][12] = { /* off = chromatic */ { 32,32,32,32,32,32,32,32,32,32,32,32}, /* major */ { 32,32,32,32,32,32,32,32,32,32,32,32}, /* minor */ { 32,32,32,32,32,32,32,32,129,128,129,128}, }; // up 128 // down 129 const char c_scales_text[c_scale_size][6] = { "Off", "Major", "Minor" }; const char c_key_text[][3] = { "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B" }; const char c_interval_text[][3] = { "P1", "m2", "M2", "m3", "M3", "P4", "TT", "P5", "m6", "M6", "m7", "M7", "P8", "m9", "M9", "" }; const char c_chord_text[][5] = { "I", "II", "III", "IV", "V", "VI", "VII", "VIII" }; enum mouse_action_e { e_action_select, e_action_draw, e_action_grow }; enum interaction_method_e { e_seq24_interaction, e_fruity_interaction, e_number_of_interactions // keep this one last... }; const char* const c_interaction_method_names[] = { "seq24", "fruity", NULL }; const char* const c_interaction_method_descs[] = { "original seq24 method", "similar to a certain fruity sequencer we like", NULL }; extern interaction_method_e global_interactionmethod; seq24-0.9.3/src/font.cpp0000644000175000017500000000464611473026533011661 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #include #include "font.h" #include "string.h" #include "pixmaps/font_w.xpm" #include "pixmaps/font_b.xpm" font::font( ) { } void font::init( Glib::RefPtr a_window ) { m_black_pixmap = Gdk::Pixmap::create_from_xpm(a_window->get_colormap(), m_clip_mask, font_b_xpm ); m_white_pixmap = Gdk::Pixmap::create_from_xpm(a_window->get_colormap(), m_clip_mask, font_w_xpm ); } void font::render_string_on_drawable( Glib::RefPtr a_gc, int x, int y, Glib::RefPtr a_draw, const char *str, font::Color col ) { int length = 0; if ( str != NULL ) length = strlen(str); int font_w = 6; int font_h = 10; for( int i=0; idraw_drawable(a_gc, m_pixmap, pixbuf_index_x, pixbuf_index_y, x + (i*font_w), y, font_w, font_h ); } } seq24-0.9.3/src/keybindentry.h0000644000175000017500000000315012651156360013055 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- // GTK text edit widget for getting keyboard button values (for binding keys) // put cursor in text box, hit a key, something like 'a' (42) appears... // each keypress replaces the previous text. // also supports keyevent and keygroup maps in the perform class #pragma once #include /*forward declaration*/ class perform; class KeyBindEntry : public Gtk::Entry { public: enum type { location, events, groups }; KeyBindEntry(type t, unsigned int* location_to_write = NULL, perform* p = NULL, long s = 0); void set( unsigned int val ); virtual bool on_key_press_event(GdkEventKey* event); private: unsigned int* m_key; type m_type; perform* m_perf; long m_slot; }; seq24-0.9.3/src/seqedit.h0000644000175000017500000001505112651156360012007 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #pragma once #include "sequence.h" #include "seqkeys.h" #include "seqroll.h" #include "seqdata.h" #include "seqtime.h" #include "seqevent.h" #include "perform.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "globals.h" #include "mainwid.h" using namespace Gtk; /* has a seqroll and paino roll */ class seqedit : public Gtk::Window { private: static const int c_min_zoom = 1; static const int c_max_zoom = 32; sequence * const m_seq; perform * const m_mainperf; MenuBar *m_menubar; Menu *m_menu_tools; Menu *m_menu_zoom; Menu *m_menu_snap; Menu *m_menu_note_length; /* length in measures */ Menu *m_menu_length; Menu *m_menu_midich; Menu *m_menu_midibus; Menu *m_menu_data; Menu *m_menu_key; Menu *m_menu_scale; Menu *m_menu_sequences; /* time signature, beats per measure, beat width */ Menu *m_menu_bpm; Menu *m_menu_bw; Menu *m_menu_rec_vol; // mainwid *m_mainwid; int m_pos; seqroll *m_seqroll_wid; seqkeys *m_seqkeys_wid; seqdata *m_seqdata_wid; seqtime *m_seqtime_wid; seqevent *m_seqevent_wid; Table *m_table; VBox *m_vbox; HBox *m_hbox; HBox *m_hbox2; HBox *m_hbox3; Adjustment *m_vadjust; Adjustment *m_hadjust; VScrollbar *m_vscroll_new; HScrollbar *m_hscroll_new; Button *m_button_undo; Button *m_button_redo; Button *m_button_quanize; Button *m_button_tools; Button *m_button_sequence; Entry *m_entry_sequence; Button *m_button_bus; Entry *m_entry_bus; Button *m_button_channel; Entry *m_entry_channel; Button *m_button_snap; Entry *m_entry_snap; Button *m_button_note_length; Entry *m_entry_note_length; Button *m_button_zoom; Entry *m_entry_zoom; Button *m_button_length; Entry *m_entry_length; Button *m_button_key; Entry *m_entry_key; Button *m_button_scale; Entry *m_entry_scale; Tooltips *m_tooltips; Button *m_button_data; Entry *m_entry_data; Button *m_button_bpm; Entry *m_entry_bpm; Button *m_button_bw; Entry *m_entry_bw; Button *m_button_rec_vol; ToggleButton *m_toggle_play; ToggleButton *m_toggle_record; ToggleButton *m_toggle_q_rec; ToggleButton *m_toggle_thru; RadioButton *m_radio_select; RadioButton *m_radio_grow; RadioButton *m_radio_draw; Entry *m_entry_name; /* the zoom 0 1 2 3 4 1, 2, 4, 8, 16 */ int m_zoom; static int m_initial_zoom; /* set snap to in pulses, off = 1 */ int m_snap; static int m_initial_snap; int m_note_length; static int m_initial_note_length; /* music scale and key */ int m_scale; static int m_initial_scale; int m_key; static int m_initial_key; int m_sequence; static int m_initial_sequence; long m_measures; /* what is the data window currently editing ? */ unsigned char m_editing_status; unsigned char m_editing_cc; void set_zoom( int a_zoom ); void set_snap( int a_snap ); void set_note_length( int a_note_length ); void set_bpm( int a_beats_per_measure ); void set_bw( int a_beat_width ); void set_rec_vol( int a_rec_vol ); void set_measures( int a_length_measures ); void apply_length( int a_bpm, int a_bw, int a_measures ); long get_measures(); void set_midi_channel( int a_midichannel ); void set_midi_bus( int a_midibus ); void set_scale( int a_scale ); void set_key( int a_note ); void set_background_sequence( int a_seq ); void name_change_callback(); void play_change_callback(); void record_change_callback(); void q_rec_change_callback(); void thru_change_callback(); void undo_callback(); void redo_callback(); void set_data_type( unsigned char a_status, unsigned char a_control = 0 ); void update_all_windows( ); void fill_top_bar(); void create_menus(); void menu_action_quantise(); void popup_menu( Menu *a_menu ); void popup_event_menu(); void popup_midibus_menu(); void popup_sequence_menu(); void popup_tool_menu(); void popup_midich_menu(); Gtk::Image* create_menu_image( bool a_state = false ); void on_realize(); bool timeout(); void do_action( int a_action, int a_var ); void mouse_action( mouse_action_e a_action ); public: seqedit(sequence *a_seq, perform *a_perf, // mainwid *a_mainwid, int a_pos); ~seqedit(); bool on_delete_event(GdkEventAny *a_event); bool on_scroll_event(GdkEventScroll* a_ev); bool on_key_press_event(GdkEventKey* a_ev); }; seq24-0.9.3/src/perfnames.h0000644000175000017500000000460712651156360012336 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #pragma once #include "perform.h" #include "sequence.h" #include "seqmenu.h" #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace Gtk; #include "globals.h" /* holds the left side piano */ class perfnames : public virtual Gtk::DrawingArea, public virtual seqmenu { private: Glib::RefPtr m_gc; Glib::RefPtr m_window; Gdk::Color m_black, m_white, m_grey; Glib::RefPtr m_pixmap; perform *m_mainperf; Adjustment *m_vadjust; int m_window_x, m_window_y; int m_sequence_offset; bool m_sequence_active[c_total_seqs]; void on_realize(); bool on_expose_event(GdkEventExpose* a_ev); bool on_button_press_event(GdkEventButton* a_ev); bool on_button_release_event(GdkEventButton* a_ev); void on_size_allocate(Gtk::Allocation& ); bool on_scroll_event( GdkEventScroll* a_ev ) ; void draw_area(); void update_pixmap(); void convert_y( int a_y, int *a_note); void draw_sequence( int a_sequence ); void change_vert(); void redraw( int a_sequence ); public: void redraw_dirty_sequences(); perfnames( perform *a_perf, Adjustment *a_vadjust ); }; seq24-0.9.3/src/userfile.h0000644000175000017500000000220412651156360012163 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #pragma once #include "perform.h" #include "configfile.h" #include class userfile : public configfile { public: userfile( string a_name ); ~userfile( ); bool parse( perform *a_perf ); bool write( perform *a_perf ); }; seq24-0.9.3/src/pixmaps/0000755000175000017500000000000012651206575011743 500000000000000seq24-0.9.3/src/pixmaps/length.xpm0000644000175000017500000000102011060731321013644 00000000000000/* XPM */ static const char * length_xpm[] = { "36 11 2 1", " c None", ". c #000000", " ................................ ", " ................................ ", " ", " ................ ", " ................ ", " ", " ........ ", " ........ ", " ", " .... ", " .... "}; seq24-0.9.3/src/pixmaps/play.xpm0000644000175000017500000000137711060731321013347 00000000000000/* XPM */ static const char * play_xpm[] = { "36 14 10 1", " c None", ". c #000000", "+ c #BFD8FF", "@ c #FFFFFF", "# c #82B1FF", "$ c #1E56AA", "% c #9E9E9E", "& c #CDFFBC", "* c #37FF00", "= c #379319", ".......... ...... ", ".++++++++. ...@..@... ", ".+######$. . ..@@@%%@@@.. ", ".+######$. .. .@@@@@@@@@@. ", ".+######$. .&. ..@@@@@@@@@@..", ".+######$. ......&*. .@@@@@@@@@@@@.", ".+######$. .&&&&&***. .@..@@@@@@..@.", ".+######$. .*******=. .@%.@@@@@@.%@.", ".+######$. ......*=. .@@@@@@@@@@@@.", ".+######$. .=. ..@..@@@@..@..", ".+######$. .. .@%.@..@.%@. ", ".+######$. . ..@@@..@@@.. ", ".$$$$$$$$. ...@@@@... ", ".......... ...... "}; seq24-0.9.3/src/pixmaps/collapse.xpm0000644000175000017500000000067611060731321014205 00000000000000/* XPM */ static const char * collapse_xpm[] = { "27 11 3 1", " c None", ". c #000000", "+ c #FFFFFF", " ", " ....... ....... ", " .+..... . .++++.. ", " .+..... .. .+...+. ", " .+..... ... .+...+. ", " .+..... ....... .++++.. ", " .+..... ... .+.+... ", " .+..... .. .+..+.. ", " .+++++. . .+...+. ", " ....... ....... ", " "}; seq24-0.9.3/src/pixmaps/learn.xpm0000644000175000017500000000043111217356737013513 00000000000000/* XPM */ static const char * learn_xpm[] = { "21 6 5 1", " c None", ". c #000000", "+ c #FFC1C1", "@ c #AD6666", "# c #724B4B", " .. ", " .. ", " .. ", " .. ", " ............ ", " ............ "}; seq24-0.9.3/src/pixmaps/menu_full.xpm0000644000175000017500000000034711060731321014364 00000000000000/* XPM */ static const char * menu_full_xpm[] = { "10 10 2 1", " c None", ". c #000000", " ", " ........ ", " ........ ", " ........ ", " ........ ", " ........ ", " ........ ", " ........ ", " ........ ", " "}; seq24-0.9.3/src/pixmaps/redo.xpm0000644000175000017500000000057511060731321013332 00000000000000/* XPM */ static const char * redo_xpm[] = { "16 14 3 1", " c None", ". c #000000", "+ c #65FF72", " . ", " .. ", " .+. ", " ........++. ", " .++++++++++. ", " .+......++. ", " .+. .+. ", " .+. .. ", " .+. . ", " .+. ", " .+. ", " .+........ ", " .++++++++. ", " .......... "}; seq24-0.9.3/src/pixmaps/menu_empty.xpm0000644000175000017500000000035011060731321014552 00000000000000/* XPM */ static const char * menu_empty_xpm[] = { "10 10 2 1", " c None", ". c #000000", "..........", ". .", ". .", ". .", ". .", ". .", ". .", ". .", ". .", ".........."}; seq24-0.9.3/src/pixmaps/down.xpm0000644000175000017500000000035711060731321013346 00000000000000/* XPM */ static const char * down_xpm[] = { "7 14 2 1", " c None", ". c #000000", " ", " ", " ", " ", " ... ", " ... ", " ... ", ".......", " ..... ", " ... ", " . ", " ", " ", " "}; seq24-0.9.3/src/pixmaps/tools.xpm0000644000175000017500000000056211060731321013535 00000000000000/* XPM */ static const char * tools_xpm[] = { "13 14 5 1", " c None", ". c #000000", "+ c #9B9B9B", "@ c #DDB36A", "# c #C4922F", " ......... ..", "....+++++...+", ". ..........", " ....... ..", " .@. ", " .@. ", " .@. ", " .@. ", " .#. ", " .#. ", " .#. ", " .#. ", " .#. ", " ... "}; seq24-0.9.3/src/pixmaps/quanize.xpm0000644000175000017500000000056111060731321014050 00000000000000/* XPM */ static const char * quanize_xpm[] = { "16 14 2 1", " c None", ". c #000000", " ", " ", " .... ", " .. .. ", " .. .. ", " .. .. ", " .. .. ", " .. .. ", " .. .. ", " .. . .. ", " .. ... ", " ..... ", " . ", " "}; seq24-0.9.3/src/pixmaps/loop.xpm0000644000175000017500000000104111060731321013337 00000000000000/* XPM */ static const char * loop_xpm[] = { "33 12 3 1", " c None", ". c #000000", "+ c #FFFFFF", " ", " . ", " ....... .. ....... ", " .+..... ..... .. .++++.. ", " .+..... . .. . .+...+. ", " .+..... . . . .+...+. ", " .+..... . . .++++.. ", " .+..... . . .+.+... ", " .+..... . . .+..+.. ", " .+++++. ......... .+...+. ", " ....... ....... ", " "}; seq24-0.9.3/src/pixmaps/zoom.xpm0000644000175000017500000000074711060731321013366 00000000000000/* XPM */ static const char * zoom_xpm[] = { "16 14 10 1", " c None", ". c #000000", "+ c #65D3FF", "@ c #FFFFFF", "# c #E5E5E5", "$ c #4C9CBA", "% c #BCBCBC", "& c #7F7F7F", "* c #FFD07A", "= c #B76F0B", " ..... ", " ..+++.. ", " ..+@#++.. ", " .+@@++++. ", " .+++++++. ", " .+@++++$. ", " ..++++$.. ", " %..+$$.. ", " ..&%..... ", " .*=. ", " .*==. ", " .*==. ", " .==. ", " .. "}; seq24-0.9.3/src/pixmaps/play2.xpm0000644000175000017500000000054011060731321013420 00000000000000/* XPM */ static const char * play2_xpm[] = { "16 11 5 1", " c None", ". c #000000", "+ c #C6EF94", "@ c #9CBF74", "# c #7B935E", " ... ", " .++.. ", " .+@++.. ", " .+@@@++.. ", " .+@@@@@@@.. ", " .+@@@@@@@##. ", " .+@@@@@##.. ", " .+@@@##.. ", " .+@##.. ", " .##.. ", " ... "}; seq24-0.9.3/src/pixmaps/snap.xpm0000644000175000017500000000101711060731321013332 00000000000000/* XPM */ static const char * snap_xpm[] = { "29 12 5 1", " c None", ". c #000000", "+ c #56BEFF", "@ c #BFE8FF", "# c #357293", " . ", " . . . ", " .. . .. ", " .+. . .@. ", " ......++. . .@+...... ", " .@@@@@+++. . .@++@@@@@. ", " .+++++++#. . .++++++++. ", " ......+#. . .++...... ", " .#. . .+. ", " .. . .. ", " . . . ", " . "}; seq24-0.9.3/src/pixmaps/q_rec.xpm0000644000175000017500000000132211060731321013461 00000000000000/* XPM */ static const char * q_rec_xpm[] = { "36 14 7 1", " c None", ". c #000000", "+ c #FFFFFF", "@ c #9E9E9E", "# c #FFBABA", "$ c #FF5454", "% c #B51E1E", " ...... ", " ...+..+... ", " ..+++@@+++.. . .... ", " .++++++++++. .. .. .. ", "..++++++++++.. .#. .. .. ", ".++++++++++++. ......#$. .. .. ", ".+..++++++..+. .#####$$$. .. .. ", ".+@.++++++.@+. .$$$$$$$%. .. .. ", ".++++++++++++. ......$%. .. .. ", "..+..++++..+.. .%. .. . .. ", " .+@.+..+.@+. .. .. ... ", " ..+++..+++.. . ..... ", " ...++++... . ", " ...... "}; seq24-0.9.3/src/pixmaps/font_b.xpm0000644000175000017500000007501611060731321013652 00000000000000/* XPM */ static const char * font_b_xpm[] = { "145 209 3 1", " c None", ". c #000000", "+ c #FFFFFF", ".................................................................................................................................................", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++++++++.++++++++.+.+.+.++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.+++.++++.++++++++.++++++++.+++.++++.+++.++++.", ".+.+.+.++.++++++++.++.+.+.+.+.++.+++.+...++++.++...+++.+.++++++.+++.++++.++++++++.+.++.+++.+.++.+++.+++.++++.++++++++.++++++++.+++.++++.+++.++++.", ".++++++++.+++.++++.+.+.+.++.+.++.+++.+.++++++.+.++++++.+.++++++.++.+.+++.+++.++++.+..+.+++.+.++.+++.+++.++++.++++++++.++++++++.+++.++++.+++.++++.", ".+.+++.++.++...+++.++.+.+.+.+....+++.+..+++++.+.++++++.+.++++++.+++.++++.+++.++++.+..+.+++.++..++++.+++.++++.++++++++.++++++++.+++.++++.+++.++++.", ".++++++++.+.....++.+.+.+.++.+.++.+++.+.++++++.++...+++.+....+++.++++++++.+.....++.+.+..+++.++.+++++.+++.++++.++++++++.++++++++.+++.++++.+++.++++.", ".+.+++.++.++...+++.++.+.+.+.+.++.+++.+.+...++.++...+++.++....++.++++++++.+++.++++.+.++.+++.++....++.+...++++.+...++++.+++....+.+++....+.+......+.", ".++++++++.+++.++++.+.+.+.++.++....++.+++.++++.++.++.++.++.+++++.++++++++.+++.++++.++.+++++.++++.+++.++++++++.+++.++++.+++.++++.++++++++.+++.++++.", ".+.+.+.++.++++++++.++.+.+.+.++++.+++.+++..+++.++...+++.++...+++.++++++++.+.....++.++.+++++.++++.+++.++++++++.+++.++++.+++.++++.++++++++.+++.++++.", ".++++++++.++++++++.+.+.+.++.++++.+++.+++.++++.++.++.++.++.+++++.++++++++.++++++++.++.+++++.++++.+++.++++++++.+++.++++.+++.++++.++++++++.+++.++++.", ".++++++++.++++++++.++.+.+.+.++++.+++.+++.++++.++.++.++.++.+++++.++++++++.++++++++.++....++.++++.+++.++++++++.+++.++++.+++.++++.++++++++.+++.++++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".................................................................................................................................................", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".+......+.++++++++.++++++++.++++++++.++++++++.+++.++++.+++.++++.+++.++++.++++++++.+++.++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.+++.++++.+++.++++.+++.++++.++++++++.+++.++++.++++..++.+..+++++.++++++++.+++++.++.+++..+++.++++++++.", ".++++++++.+......+.++++++++.++++++++.++++++++.+++.++++.+++.++++.+++.++++.++++++++.+++.++++.++..++++.+++..+++.++++++++.++++.+++.++.++.++.++++++++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.+++.++++.+++.++++.+++.++++.++++++++.+++.++++.+.++++++.+++++.++.+.....++.+.....++.++.+++++.++++++++.", ".++++++++.++++++++.++....++.++++++++.++++++++.+++.++++.+++.++++.+++.++++.++++++++.+++.++++.++..++++.+++..+++.++.+.+++.+++.++++.+...++++.+++.++++.", ".++++++++.++++++++.+......+.++++++++.++++++++.+......+.+...++++.+......+.+......+.+++.++++.++++..++.+..+++++.++.+.+++.+.....++.++.+++++.++++++++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.+++.++++.+++.++++.++++++++.+++.++++.+++.++++.++++++++.++++++++.++.+.+++.++.+++++.++.++.++.++++++++.", ".++++++++.++++++++.++++++++.+......+.++++++++.+++.++++.+++.++++.++++++++.+++.++++.+++.++++.+.....++.+.....++.++.+.+++.+.++++++.+.+..+++.++++++++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.+++.++++.+++.++++.++++++++.+++.++++.+++.++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++++++++.++++++++.++++++++.++++++++.+......+.+++.++++.+++.++++.++++++++.+++.++++.+++.++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".................................................................................................................................................", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++++++++.+++.++++.++.+.+++.++.+.+++.+++.++++.++.++.++.++.+++++.+++.++++.++++.+++.++.+++++.++++++++.++++++++.++++++++.++++++++.++++++++.+++++.++.", ".++++++++.+++.++++.++.+.+++.++.+.+++.++...+++.+.+.+.++.+.+.++++.+++.++++.+++.++++.+++.++++.+.+++.++.+++.++++.++++++++.++++++++.++++++++.+++++.++.", ".++++++++.+++.++++.++.+.+++.+.....++.+.+.++++.++.+.+++.+.+.++++.+++.++++.++.+++++.++++.+++.++.+.+++.+++.++++.++++++++.++++++++.++++++++.++++.+++.", ".++++++++.+++.++++.++++++++.++.+.+++.++...+++.+++.++++.++.+++++.++++++++.++.+++++.++++.+++.+.....++.+.....++.++++++++.+.....++.++++++++.+++.++++.", ".++++++++.+++.++++.++++++++.+.....++.+++.+.++.++.+.+++.+.+.+.++.++++++++.++.+++++.++++.+++.++.+.+++.+++.++++.++++++++.++++++++.++++++++.++.+++++.", ".++++++++.++++++++.++++++++.++.+.+++.++...+++.+.+.+.++.+.++.+++.++++++++.+++.++++.+++.++++.+.+++.++.+++.++++.+++..+++.++++++++.+++.++++.+.++++++.", ".++++++++.+++.++++.++++++++.++.+.+++.+++.++++.+.++.+++.++..+.++.++++++++.++++.+++.++.+++++.++++++++.++++++++.+++.++++.++++++++.++...+++.+.++++++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++.+++++.++++++++.+++.++++.++++++++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".................................................................................................................................................", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".+++.++++.+++.++++.++...+++.+.....++.++++.+++.+.....++.+++..+++.+.....++.++...+++.++...+++.++++++++.++++++++.+++++.++.++++++++.++.+++++.++...+++.", ".++.+.+++.++..++++.+.+++.++.+++++.++.+++..+++.+.++++++.++.+++++.+++++.++.+.+++.++.+.+++.++.+++.++++.+++.++++.++++.+++.++++++++.+++.++++.+.+++.++.", ".+.+++.++.+.+.++++.+++++.++.++++.+++.++.+.+++.+.+..+++.+.++++++.++++.+++.+.+++.++.+.++..++.++...+++.++...+++.+++.++++.+.....++.++++.+++.++++.+++.", ".+.+++.++.+++.++++.+++..+++.+++..+++.+.++.+++.+..++.++.+.+..+++.++++.+++.++...+++.++..+.++.+++.++++.+++.++++.++.+++++.++++++++.+++++.++.+++.++++.", ".+.+++.++.+++.++++.++.+++++.+++++.++.+.....++.+++++.++.+..++.++.+++.++++.+.+++.++.+++++.++.++++++++.++++++++.+++.++++.+.....++.++++.+++.+++.++++.", ".++.+.+++.+++.++++.+.++++++.+.+++.++.++++.+++.+.+++.++.+.+++.++.++.+++++.+.+++.++.++++.+++.+++.++++.+++..+++.++++.+++.++++++++.+++.++++.++++++++.", ".+++.++++.+.....++.+.....++.++...+++.++++.+++.++...+++.++...+++.++.+++++.++...+++.++..++++.++...+++.+++.++++.+++++.++.++++++++.++.+++++.+++.++++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.+++.++++.++.+++++.++++++++.++++++++.++++++++.++++++++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".................................................................................................................................................", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++...+++.+++.++++.+....+++.++...+++.+....+++.+.....++.+.....++.++...+++.+.+++.++.++...+++.+++...++.+.+++.++.+.++++++.+.+++.++.+.+++.++.++...+++.", ".+.+++.++.++.+.+++.++.++.++.+.+++.++.++.++.++.+.++++++.+.++++++.+.+++.++.+.+++.++.+++.++++.++++.+++.+.++.+++.+.++++++.+.+++.++.+.+++.++.+.+++.++.", ".+.++..++.+.+++.++.++.++.++.+.++++++.++.++.++.+.++++++.+.++++++.+.++++++.+.+++.++.+++.++++.++++.+++.+.+.++++.+.++++++.+..+..++.+..++.++.+.+++.++.", ".+.+.+.++.+.+++.++.++...+++.+.++++++.++.++.++.+....+++.+....+++.+.++++++.+.....++.+++.++++.++++.+++.+..+++++.+.++++++.+.+.+.++.+.+.+.++.+.+++.++.", ".+.+..+++.+.....++.++.++.++.+.++++++.++.++.++.+.++++++.+.++++++.+.++..++.+.+++.++.+++.++++.++++.+++.+.+.++++.+.++++++.+.+++.++.+.++..++.+.+++.++.", ".+.++++++.+.+++.++.++.++.++.+.+++.++.++.++.++.+.++++++.+.++++++.+.+++.++.+.+++.++.+++.++++.+.++.+++.+.++.+++.+.++++++.+.+++.++.+.+++.++.+.+++.++.", ".++...+++.+.+++.++.+....+++.++...+++.+....+++.+.....++.+.++++++.++...+++.+.+++.++.++...+++.++..++++.+.+++.++.+.....++.+.+++.++.+.+++.++.++...+++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".................................................................................................................................................", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".+....+++.++...+++.+....+++.++...+++.+.....++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.....++.++...+++.+.++++++.++...+++.+++.++++.++++++++.", ".+.+++.++.+.+++.++.+.+++.++.+.+++.++.+++.++++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+++++.++.++.+++++.+.++++++.++++.+++.++.+.+++.++++++++.", ".+.+++.++.+.+++.++.+.+++.++.+.++++++.+++.++++.+.+++.++.+.+++.++.+.+++.++.++.+.+++.++.+.+++.++++.+++.++.+++++.++.+++++.++++.+++.+.+++.++.++++++++.", ".+....+++.+.+++.++.+....+++.++...+++.+++.++++.+.+++.++.++.+.+++.+.+.+.++.+++.++++.+++.++++.+++.++++.++.+++++.+++.++++.++++.+++.++++++++.++++++++.", ".+.++++++.+.+++.++.+.+.++++.+++++.++.+++.++++.+.+++.++.++.+.+++.+.+.+.++.++.+.+++.+++.++++.++.+++++.++.+++++.++++.+++.++++.+++.++++++++.++++++++.", ".+.++++++.+.+.+.++.+.++.+++.+.+++.++.+++.++++.+.+++.++.++.+.+++.+..+..++.+.+++.++.+++.++++.+.++++++.++.+++++.+++++.++.++++.+++.++++++++.++++++++.", ".+.++++++.++...+++.+.+++.++.++...+++.+++.++++.++...+++.+++.++++.+.+++.++.+.+++.++.+++.++++.+.....++.++...+++.+++++.++.++...+++.++++++++.++++++++.", ".++++++++.+++++.++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.+.....++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".................................................................................................................................................", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".+++.++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++++.+++.++++++++.+.++++++.++++++++.+++++.++.++++++++.+++..+++.++++++++.+.++++++.+++.++++.+++++.++.+.++++++.++..++++.++++++++.++++++++.++++++++.", ".++++++++.++++++++.+.++++++.++++++++.+++++.++.++++++++.++.++.++.++++++++.+.++++++.++++++++.++++++++.+.++++++.+++.++++.++++++++.++++++++.++++++++.", ".++++++++.++...+++.+.+..+++.++...+++.++..+.++.++...+++.++.+++++.++....++.+.+..+++.++..++++.++++..++.+.+++.++.+++.++++.+..+.+++.+.+..+++.++...+++.", ".++++++++.+++++.++.+..++.++.+.+++.++.+.++..++.+.+++.++.+....+++.+.+++.++.+..++.++.+++.++++.+++++.++.+.++.+++.+++.++++.+.+.+.++.+..++.++.+.+++.++.", ".++++++++.++....++.+.+++.++.+.++++++.+.+++.++.+.....++.++.+++++.+.+++.++.+.+++.++.+++.++++.+++++.++.+...++++.+++.++++.+.+.+.++.+.+++.++.+.+++.++.", ".++++++++.+.+++.++.+..++.++.+.+++.++.+.++..++.+.++++++.++.+++++.++....++.+.+++.++.+++.++++.+++++.++.+.++.+++.+++.++++.+.+.+.++.+.+++.++.+.+++.++.", ".++++++++.++....++.+.+..+++.++...+++.++..+.++.++...+++.++.+++++.+++++.++.+.+++.++.++...+++.++.++.++.+.+++.++.++...+++.+.+++.++.+.+++.++.++...+++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.+.+++.++.++++++++.++++++++.++.++.++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++...+++.++++++++.++++++++.+++..+++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".................................................................................................................................................", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++++++++.++++++++.++++++++.++++++++.++.+++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++..++.+++.++++.++..++++.++.++.++.+.+.+.++.", ".++++++++.++++++++.++++++++.++++++++.++.+++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.+++.++++.+++.++++.++++.+++.+.+.+.++.++++++++.", ".+.+..+++.++..+.++.+.+..+++.++...+++.+....+++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.....++.++++.+++.+++.++++.+++.++++.+.++.+++.+.+++.++.", ".+..++.++.+.++..++.+..++.++.+.++++++.++.+++++.+.+++.++.+.+++.++.+.+++.++.++.+.+++.+.+++.++.++++.+++.++..++++.+++.++++.++++..++.++++++++.++++++++.", ".+.+++.++.+.+++.++.+.++++++.++...+++.++.+++++.+.+++.++.++.+.+++.+.+.+.++.+++.++++.+.++..++.+++.++++.++++.+++.+++.++++.+++.++++.++++++++.+.+++.++.", ".+..++.++.+.++..++.+.++++++.+++++.++.++.++.++.+.++..++.++.+.+++.+.+.+.++.++.+.+++.++..+.++.++.+++++.+++.++++.+++.++++.++++.+++.++++++++.++++++++.", ".+.+..+++.++..+.++.+.++++++.+....+++.+++..+++.++..+.++.+++.++++.++.+.+++.+.+++.++.+++++.++.+.....++.++++..++.+++.++++.++..++++.++++++++.+.+.+.++.", ".+.++++++.+++++.++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.+.+++.++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".+.++++++.+++++.++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++...+++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".................................................................................................................................................", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++.+++++.++....++.+.+.+.++.+.+.+.++.+.+.+.++.+.+.+.++.+.+.+.++.+.+.+.++.+.+.+.++.+.+.+.++.+.+.+.++.+.+.+.++.+.+.+.++.+.+.+.++.+.+.+.++.+.+.+.++.", ".++.+++++.++....++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++..++++.+++...++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.", ".++..++++.+++...++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++...+++.++++..++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.", ".++...+++.++++..++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++....++.+++++.++.+.+.+.++.+.+.+.++.+.+.+.++.+.+.+.++.+.+.+.++.+.+.+.++.+.+.+.++.+.+.+.++.+.+.+.++.+.+.+.++.+.+.+.++.+.+.+.++.+.+.+.++.+.+.+.++.", ".++....++.+++++.++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".................................................................................................................................................", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++...+++.++...+++.++...+++.++...+++.++...+++.++...+++.++...+++.++...+++.++...+++.++...+++.+.+.+.++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++.+.+.+.+.+.+.++.+.+.+.++.+.+.+.++.+.+.+.++.+.+.+.++.", ".+++.++++.+++.++++.++...+++.+.....++.++++.+++.+.....++.+++..+++.+.....++.++...+++.++...+++.+.+.+.++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++.+.+++.++..++++.+.+++.++.+++++.++.+++..+++.+.++++++.++.+++++.+++++.++.+.+++.++.+.+++.++.++.+.+.+.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.", ".+.+++.++.+.+.++++.+++++.++.++++.+++.++.+.+++.+.+..+++.+.++++++.++++.+++.+.+++.++.+.++..++.+.+.+.++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".+.+++.++.+++.++++.+++..+++.+++..+++.+.++.+++.+..++.++.+.+..+++.++++.+++.++...+++.++..+.++.++.+.+.+.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.", ".+.+++.++.+++.++++.++.+++++.+++++.++.+.....++.+++++.++.+..++.++.+++.++++.+.+++.++.+++++.++.+.+.+.++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++.+.+++.+++.++++.+.++++++.+.+++.++.++++.+++.+.+++.++.+.+++.++.++.+++++.+.+++.++.++++.+++.++.+.+.+.+.+.+.++.+.+.+.++.+.+.+.++.+.+.+.++.+.+.+.++.", ".+++.++++.+.....++.+.....++.++...+++.++++.+++.++...+++.++...+++.++.+++++.++...+++.++..++++.+.+.+.++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++.+.+.+.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".................................................................................................................................................", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++.+.+++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.+.....++.", ".++++++++.+++.++++.++++++++.+++..+++.++++++++.+.+++.++.+++.++++.++...+++.++++++++.++...+++.+++...++.++++++++.++++++++.++++++++.++...+++.++++++++.", ".++++++++.++++++++.+++.++++.++.++.++.++++++++.+.+++.++.+++.++++.+.++++++.++++++++.+.+++.++.++.++.++.++++++++.++++++++.++++++++.+.+++.++.++++++++.", ".++++++++.+++.++++.++....++.++.+++++.+.+++.++.++.+.+++.+++.++++.+...++++.++++++++.+.+.+.++.++.+..++.+++.++.+.++++++++.++++++++.+...+.++.++++++++.", ".++++++++.+++.++++.+.+.++++.+...++++.++...+++.+++.++++.++++++++.+.++.+++.++++++++.+..++.++.+++.+.++.++.++.++.++....++.++....++.+..++.++.++++++++.", ".++++++++.+++.++++.+.+.++++.++.+++++.++.+.+++.+.....++.+++.++++.++.++.++.++++++++.+.+.+.++.++++++++.+.++.+++.+++++.++.++++++++.+..++.++.++++++++.", ".++++++++.+++.++++.+.+.++++.++.++.++.++...+++.+++.++++.+++.++++.+++...++.++++++++.+.+++.++.++....++.++.++.++.++++++++.++++++++.+.+++.++.++++++++.", ".++++++++.+++.++++.++....++.+.+..+++.+.+++.++.+++.++++.+++.++++.+++++.++.++++++++.++...+++.++++++++.+++.++.+.++++++++.++++++++.++...+++.++++++++.", ".++++++++.++++++++.+++.++++.++++++++.++++++++.+++.++++.++++++++.++...+++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".................................................................................................................................................", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++++++++.++++++++.+++..+++.++...+++.++++.+++.++++++++.++++++++.++++++++.++++++++.+++.++++.++++++++.++++++++.++.+++++.++.+++++.+..+++++.++++++++.", ".+++.++++.++++++++.++.++.++.+++++.++.+++.++++.++++++++.++....++.++++++++.++++++++.++..++++.+++..+++.++++++++.+..+++++.+..+++++.+++.++++.+++.++++.", ".++.+.+++.+++.++++.++++.+++.+++..+++.++++++++.++++++++.+...+.++.++++++++.++++++++.+++.++++.++.++.++.++++++++.++.+++++.++.+++++.++.+++++.++++++++.", ".+++.++++.+++.++++.+++.++++.+++++.++.++++++++.+.+++.++.+...+.++.++++++++.++++++++.+++.++++.++.++.++.+.++.+++.++.+++++.++.+++++.+++.++++.+++.++++.", ".++++++++.+.....++.++....++.++...+++.++++++++.+.+++.++.++..+.++.+++.++++.++++++++.++...+++.+++..+++.++.++.++.+...++.+.+...+.++.+..++.++.+++.++++.", ".++++++++.+++.++++.++++++++.++++++++.++++++++.+.+++.++.+++.+.++.++++++++.++++++++.++++++++.++++++++.+++.++.+.+++++..+.++++.+.+.++++..++.++.+++++.", ".++++++++.+++.++++.++++++++.++++++++.++++++++.+..++.++.+++.+.++.++++++++.++++++++.++++++++.++....++.++.++.++.++++.+.+.++++++.+.+++.+.++.+.+++.++.", ".++++++++.+.....++.++++++++.++++++++.++++++++.+.+..+++.+++.+.++.++++++++.++++++++.++++++++.++++++++.+.++.+++.+++....+.+++++.++.++....++.++...+++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.+.++++++.++++++++.++++++++.++++.+++.++++++++.++++++++.++++++++.++++++.+.++++...+.+++++.++.++++++++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.+++.++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".................................................................................................................................................", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++.+++++.++++.+++.+++.++++.++.++.++.++.+.+++.+++.++++.++++++++.++++++++.++.+++++.++++.+++.+++.++++.++.+.+++.++.+++++.++++.+++.+++.++++.++.+.+++.", ".+++.++++.+++.++++.++.+.+++.+.+..+++.++++++++.++.+.+++.+++....+.++...+++.+.....++.+.....++.+.....++.+.....++.+++.++++.+++.++++.++.+.+++.++++++++.", ".++...+++.++...+++.++...+++.++...+++.++...+++.++...+++.++.+.+++.+.+++.++.+.++++++.+.++++++.+.++++++.+.++++++.++...+++.++...+++.++...+++.++...+++.", ".+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.++.+++.+.++++++.+.++++++.+.++++++.+.++++++.+.++++++.+++.++++.+++.++++.+++.++++.+++.++++.", ".+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.++...+.+.++++++.+....+++.+....+++.+....+++.+....+++.+++.++++.+++.++++.+++.++++.+++.++++.", ".+.....++.+.....++.+.....++.+.....++.+.....++.+.....++.+....+++.+.++++++.+.++++++.+.++++++.+.++++++.+.++++++.+++.++++.+++.++++.+++.++++.+++.++++.", ".+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.++.+++.+.+++.++.+.++++++.+.++++++.+.++++++.+.++++++.+++.++++.+++.++++.+++.++++.+++.++++.", ".+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.++...+.++...+++.+.....++.+.....++.+.....++.+.....++.++...+++.++...+++.++...+++.++...+++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.+++.++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++.+++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".................................................................................................................................................", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++++++++.+++.+.++.++.+++++.++++.+++.+++.++++.+++.+.++.++.+.+++.++++++++.++++++++.++.+++++.++++.+++.+++.++++.++.+.+++.++++.+++.++++++++.++++++++.", ".+....+++.++.+.+++.+++.++++.+++.++++.++.+.+++.++.+.+++.++++++++.++++++++.++...+++.+++.++++.+++.++++.++.+.+++.++++++++.+++.++++.+.++++++.++...+++.", ".++.++.++.+.+++.++.++...+++.++...+++.++...+++.++...+++.++...+++.++++++++.+.++..++.+.+++.++.+.+++.++.++++++++.+.+++.++.+.+++.++.+....+++.+.+++.++.", ".++.++.++.+..++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.++..++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.++.+++.", ".+...+.++.+.+.+.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.++.+.+++.+.+.+.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.++.+.+++.+....+++.+.+.++++.", ".++.++.++.+.++..++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+++.++++.+..++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+++.++++.+.++++++.+.++.+++.", ".++.++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.++.+.+++.+..++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+++.++++.+.++++++.+.+++.++.", ".+....+++.+.+++.++.++...+++.++...+++.++...+++.++...+++.++...+++.+.+++.++.++...+++.++...+++.++...+++.++...+++.++...+++.+++.++++.+.++++++.+.+..+++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".................................................................................................................................................", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++.+++++.++++.+++.+++.++++.+++.+.++.++++++++.+++.++++.++++++++.++++++++.++.+++++.++++.+++.+++.++++.++++++++.++.+++++.+++.++++.+++.++++.++++++++.", ".+++.++++.+++.++++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++++++++.++++++++.+++.++++.+++.++++.++.+.+++.++.+.+++.+++.++++.++.+++++.++.+.+++.++.+.+++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.+++.++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++...+++.++...+++.++...+++.++...+++.++...+++.++...+++.++....++.++...+++.++...+++.++...+++.++...+++.++...+++.++..++++.++..++++.++..++++.++..++++.", ".+++++.++.+++++.++.+++++.++.+++++.++.+++++.++.+++++.++.++++.+.+.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+++.++++.+++.++++.+++.++++.+++.++++.", ".++....++.++....++.++....++.++....++.++....++.++....++.++.....+.+.++++++.+.....++.+.....++.+.....++.+.....++.+++.++++.+++.++++.+++.++++.+++.++++.", ".+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.++.+++.+.+++.++.+.++++++.+.++++++.+.++++++.+.++++++.+++.++++.+++.++++.+++.++++.+++.++++.", ".++....++.++....++.++....++.++....++.++....++.++....++.++.....+.++...+++.++...+++.++...+++.++...+++.++...+++.++...+++.++...+++.++...+++.++...+++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.+++.++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++.+++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".................................................................................................................................................", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", ".++++++++.+++.+.++.++.+++++.++++.+++.+++.++++.+++.+.++.++++++++.++++++++.++++++++.++.+++++.++++.+++.+++.++++.++++++++.++++++++.++++++++.++++++++.", ".+..+++++.++.+.+++.+++.++++.+++.++++.++.+.+++.++.+.+++.++.+.+++.++++++++.++++++++.+++.++++.+++.++++.++.+.+++.++.+.+++.++++.+++.++++++++.++.+.+++.", ".+++..+++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.+++.++++.++++++++.++++++++.++++++++.++++++++.++++++++.+++.++++.+.++++++.++++++++.", ".++...+++.+.+..+++.++...+++.++...+++.++...+++.++...+++.++...+++.++++++++.++....++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+....+++.+.+++.++.", ".+.+++.++.+..++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.....++.+.++..++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.", ".+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.++++++++.+.+.+.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.++..++.+.+++.++.+.++..++.", ".+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+.+++.++.+++.++++.+..++.++.+.++..++.+.++..++.+.++..++.+.++..++.++..+.++.+.+++.++.++..+.++.", ".++...+++.+.+++.++.++...+++.++...+++.++...+++.++...+++.++...+++.++++++++.+....+++.++..+.++.++..+.++.++..+.++.++..+.++.+++++.++.+....+++.+++++.++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.+.+++.++.+.++++++.+.+++.++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++...+++.+.++++++.++...+++.", ".++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.++++++++.", "................................................................................................................................................."}; seq24-0.9.3/src/pixmaps/learn2.xpm0000644000175000017500000000043411217356737013600 00000000000000/* XPM */ static const char * learn2_xpm[] = { "21 6 5 1", ". c None", " c #000000", "+ c #FFC1C1", "@ c #AD6666", "# c #724B4B", " .. ", " .. ", " .. ", " .. ", " ............ ", " ............ "}; seq24-0.9.3/src/pixmaps/thru.xpm0000644000175000017500000000215311060731321013355 00000000000000/* XPM */ static const char * thru_xpm[] = { "62 14 10 1", " c None", ". c #000000", "+ c #FFFFFF", "@ c #BFD8FF", "# c #9E9E9E", "$ c #82B1FF", "% c #1E56AA", "& c #FFC396", "* c #FF9F32", "= c #BC681A", " ...... .......... ...... ", " ...+..+... .@@@@@@@@. ...+..+... ", " ..+++##+++.. . .@$$$$$$%. . ..+++##+++.. ", " .++++++++++. .. .@$$$$$$%. .. .++++++++++. ", "..++++++++++.. .&. .@$$$$$$%. .&. ..++++++++++..", ".++++++++++++. ......&*. .@$$$$$$%. ......&*. .++++++++++++.", ".+..++++++..+. .&&&&&***. .@$$$$$$%. .&&&&&***. .+..++++++..+.", ".+#.++++++.#+. .*******=. .@$$$$$$%. .*******=. .+#.++++++.#+.", ".++++++++++++. ......*=. .@$$$$$$%. ......*=. .++++++++++++.", "..+..++++..+.. .=. .@$$$$$$%. .=. ..+..++++..+..", " .+#.+..+.#+. .. .@$$$$$$%. .. .+#.+..+.#+. ", " ..+++..+++.. . .@$$$$$$%. . ..+++..+++.. ", " ...++++... .%%%%%%%%. ...++++... ", " ...... .......... ...... "}; seq24-0.9.3/src/pixmaps/key.xpm0000644000175000017500000000052211060731321013161 00000000000000/* XPM */ static const char * key_xpm[] = { "13 14 3 1", " c None", ". c #000000", "+ c #F2D91A", " ..... ", " .+++. ", " .+... ", " .+++. ", " .+... ", " .+. ", " .+. ", " ...+... ", " .+++++. ", " .+...+. ", " .+. .+. ", " .+...+. ", " .+++++. ", " ....... "}; seq24-0.9.3/src/pixmaps/bus.xpm0000644000175000017500000000124311060731321013163 00000000000000/* XPM */ static const char * bus_xpm[] = { "36 14 4 1", " c None", ". c #000000", "+ c #FFFFFF", "@ c #939393", " ", " ..... ..... ..... ", " ..+.+.. ..+.+.. ..+.+.. ", " .+++++. .+++++. .+++++. ", " .@+++@. .@+++@. .@+++@. ", " .+++++. .+++++. .+++++. ", " ..+@+.. ..+@+.. ..+@+.. ", " ..... ..... ..... ", " . . . ", " . . . ", " . . . ", " . . . ..................... ", " ", " "}; seq24-0.9.3/src/pixmaps/sequences.xpm0000644000175000017500000000110611060731321014363 00000000000000/* XPM */ static const char * sequences_xpm[] = { "30 14 3 1", " c None", ". c #000000", "+ c #FFFFFF", " ", " ....... ....... ", " .+++++. .+++++. ", " ....... ....... ", " ....... ....... ", " .+++++. .+++++. ", " ....... ....... ", " ....... ....... ", " .+++++. .+++++. ", " ....... ....... ", " ....... ....... ", " .+++++. .+++++. ", " ....... ....... ", " "}; seq24-0.9.3/src/pixmaps/perfedit.xpm0000644000175000017500000000113411060731321014173 00000000000000/* XPM */ static const char * perfedit_xpm[] = { "23 14 11 1", " c None", ". c #000000", "+ c #FF7795", "@ c #FFFFFF", "# c #B2405C", "$ c #AAAAAA", "% c #7C7C7C", "& c #FFDA6D", "* c #B58F2F", "= c #AA5C03", "- c #C6C6C6", " .. ", " .++. ", " .@+#. ", " .@$%. ", " .&&%. ", " .&&*. ", " .&&*. ", " .&&*. ", " ..........=*..... ", " .--------.=.----. ", " .--------..-----. ", " .--------.------. ", " .---------------. ", " ................. "}; seq24-0.9.3/src/pixmaps/font_w.xpm0000644000175000017500000007500211060731321013672 00000000000000/* XPM */ static const char * font_w_xpm[] = { "145 209 2 1", " c #000000", ". c #FFFFFF", ".................................................................................................................................................", ". . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . ... . ... . . . . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . .", ". . . . ... . . . . . .... . .. . . . . . . . . . .. . . .. . . . . . . . . .", ". . ..... . . . . . . . . . . ... . .... . . ..... . . .. . . . . . . . . . . .", ". . . . ... . . . . . . . . . ... . ... . .... . . . . . . . .... . ... . ... . .... . .... . ...... .", ". . . . . . . . .... . . . . . . . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . .. . ... . ... . . ..... . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . . . .... . . . . . . . . . . .", ". . . . . . . . . . . . . . . . .", ".................................................................................................................................................", ". . . . . . . . . . . . . . . . .", ". ...... . . . . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . .. . .. . . . . .. . .", ". . ...... . . . . . . . . . . . . . .. . .. . . . . . . . .", ". . . . . . . . . . . . . . . . . . . ..... . ..... . . . .", ". . . . . . . . . . . . . . . .. . .. . . . . . . ... . . .", ". . . ...... . . . .... . ... . ...... . ...... . . . .. . .. . . . . ..... . . . .", ". . . . . . . . . . . . . . . . . . . . . . . . . .", ". . . . ...... . . . . . . . . . . . ..... . ..... . . . . . . . .. . .", ". . . . . . . . . . . . . . . . . . . . .", ". . . . . ...... . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . .", ".................................................................................................................................................", ". . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . .", ". . . . . . . . . . ... . . . . . . . . . . . . . . . . . . . . . . . .", ". . . . . . . ..... . . . . . . . . . . . . . . . . . . . . . . . . . .", ". . . . . . . . ... . . . . . . . . . . ..... . ..... . . ..... . . . .", ". . . . . ..... . . . . . . . . . . . . . . . . . . . . . . . . . .", ". . . . . . . ... . . . . . . . . . . . . . . . . . . .. . . . . . .", ". . . . . . . . . . . . . .. . . . . . . . . . . . . ... . . .", ". . . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . .", ".................................................................................................................................................", ". . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . .", ". . . . . ... . ..... . . . ..... . .. . ..... . ... . ... . . . . . . . . ... .", ". . . . .. . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . .. . . . . . . . . . .. . ... . ... . . . ..... . . . . .", ". . . . . . .. . .. . . . . .. . . . .. . . . ... . .. . . . . . . . . . . . . .", ". . . . . . . . . . ..... . . . .. . . . . . . . . . . . . . ..... . . . . .", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . .", ". . . ..... . ..... . ... . . . ... . ... . . . ... . .. . ... . . . . . . . . . .", ". . . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . .", ".................................................................................................................................................", ". . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . .", ". ... . . . .... . ... . .... . ..... . ..... . ... . . . . ... . ... . . . . . . . . . . . . ... .", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .", ". . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. .. . .. . . . . .", ". . . . . . . . ... . . . . . . .... . .... . . . ..... . . . . . .. . . . . . . . . . . . . . .", ". . .. . ..... . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . .. . . . .", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .", ". ... . . . . .... . ... . .... . ..... . . . ... . . . . ... . .. . . . . ..... . . . . . . . ... .", ". . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . .", ".................................................................................................................................................", ". . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . .", ". .... . ... . .... . ... . ..... . . . . . . . . . . . . . . . . ..... . ... . . . ... . . . .", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .", ". .... . . . . .... . ... . . . . . . . . . . . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . . . . . . .. .. . . . . . . . . . . . . . . . .", ". . . ... . . . . ... . . . ... . . . . . . . . . . . ..... . ... . . . ... . . .", ". . . . . . . . . . . . . . . . . ..... .", ". . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . .", ".................................................................................................................................................", ". . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . . .", ". . . . . . . . . . .. . . . . . . . . . . .. . . . .", ". . . . . . . . . . . . . . . . . . . . . . . .", ". . ... . . .. . ... . .. . . ... . . . .... . . .. . .. . .. . . . . . . .. . . . .. . ... .", ". . . . .. . . . . . . .. . . . . .... . . . . .. . . . . . . . . . . . . . . . .. . . . . .", ". . .... . . . . . . . . . ..... . . . . . . . . . . . . . ... . . . . . . . . . . . . .", ". . . . . .. . . . . . . .. . . . . . .... . . . . . . . . . . . . . . . . . . . . . . .", ". . .... . . .. . ... . .. . . ... . . . . . . . . ... . . . . . . . ... . . . . . . . ... .", ". . . . . . . . . . . . . . . . . . . . .", ". . . . . . . . ... . . . .. . . . . . .", ". . . . . . . . . . . . . . . . .", ".................................................................................................................................................", ". . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . .. . . . .. . . . . . . . .", ". . . . . . . . . . . . . . . . . . . . . . . .", ". . .. . .. . . . .. . ... . .... . . . . . . . . . . . . . . . . ..... . . . . . . . . . . . . .", ". .. . . . .. . .. . . . . . . . . . . . . . . . . . . . . . . . .. . . . .. . . .", ". . . . . . . . . ... . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . .", ". .. . . . .. . . . . . . . . . .. . . . . . . . . . . . .. . . . . . . . . . . . .", ". . .. . .. . . . . .... . .. . .. . . . . . . . . . . . . ..... . .. . . . .. . . . . . .", ". . . . . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . ... . . . . . . .", ". . . . . . . . . . . . . . . . .", ".................................................................................................................................................", ". . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . .", ".................................................................................................................................................", ". . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . .", ".................................................................................................................................................", ". . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . . . ..... .", ". . . . . .. . . . . . . . ... . . ... . ... . . . . ... . .", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . .", ". . . . .... . . . . . . . . . . . ... . . . . . . . .. . . . . . . ... . . .", ". . . . . . . ... . ... . . . . . . . . .. . . . . . . . . .... . .... . .. . . .", ". . . . . . . . . . . . ..... . . . . . . . . . . . . . . . . . . .. . . .", ". . . . . . . . . . ... . . . . . ... . . . . . .... . . . . . . . . . .", ". . . . .... . . .. . . . . . . . . . . . ... . . . . . . . ... . .", ". . . . . . . . . . ... . . . . . . . . .", ". . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . .", ".................................................................................................................................................", ". . . . . . . . . . . . . . . . .", ". . . .. . ... . . . . . . . . . . . . . . . .. . .", ". . . . . . . . . . . . .... . . . .. . .. . . .. . .. . . . . .", ". . . . . . . . .. . . . ... . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . ... . . . . . . . . . . . . . . . . . . . .", ". . ..... . .... . ... . . . . . .. . . . . . ... . .. . . . . ... . . ... . . .. . . . .", ". . . . . . . . . . . . . . . . . . . . .. . . . . .. . . .", ". . . . . . . .. . . . . . . . . .... . . . . . . . . . . . . . . .", ". . ..... . . . . . .. . . . . . . . . . . . .... . . . .... . ... .", ". . . . . . . . . . . . . . . . . ... . . . .", ". . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . .", ".................................................................................................................................................", ". . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .", ". . . . . . . . . .. . . . . . .... . ... . ..... . ..... . ..... . ..... . . . . . . . . .", ". ... . ... . ... . ... . ... . ... . . . . . . . . . . . . . . . ... . ... . ... . ... .", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . . . . . ... . . . .... . .... . .... . .... . . . . . . . . .", ". ..... . ..... . ..... . ..... . ..... . ..... . .... . . . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . . . . . ... . ... . ..... . ..... . ..... . ..... . ... . ... . ... . ... .", ". . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . .", ".................................................................................................................................................", ". . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .", ". .... . . . . . . . . . . . . . . . . ... . . . . . . . . . . . . . ... .", ". . . . . . . ... . ... . ... . ... . ... . . . .. . . . . . . . . . . . . . . .... . . . .", ". . . . .. . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . .", ". ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .... . . . .", ". . . . . .. . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . .", ". .... . . . . ... . ... . ... . ... . ... . . . . ... . ... . ... . ... . ... . . . . . . .. .", ". . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . .", ".................................................................................................................................................", ". . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . . .", ". ... . ... . ... . ... . ... . ... . .... . ... . ... . ... . ... . ... . .. . .. . .. . .. .", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .", ". .... . .... . .... . .... . .... . .... . ..... . . . ..... . ..... . ..... . ..... . . . . . . . . .", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .", ". .... . .... . .... . .... . .... . .... . ..... . ... . ... . ... . ... . ... . ... . ... . ... . ... .", ". . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . .", ".................................................................................................................................................", ". . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . . . . . . . . . . . .", ". .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .", ". .. . . . . . . . . . . . . . . . . . . .", ". ... . . .. . ... . ... . ... . ... . ... . . .... . . . . . . . . . . . . . . . . .... . . . .", ". . . . .. . . . . . . . . . . . . . . . . . ..... . . .. . . . . . . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . .. .", ". . . . . . . . . . . . . . . . . . . . . . . . .. . . . .. . . .. . . .. . . .. . .. . . . . . .. . .", ". ... . . . . ... . ... . ... . ... . ... . . .... . .. . . .. . . .. . . .. . . . . .... . . .", ". . . . . . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . ... . . . ... .", ". . . . . . . . . . . . . . . . .", "................................................................................................................................................."}; seq24-0.9.3/src/pixmaps/seq24.xpm0000644000175000017500000001014411060731321013330 00000000000000/* XPM */ static const char * seq24_xpm[] = { "124 32 3 1", " c None", ". c None", "+ c #000000", "............................................................................................................................", "............................................................................................................................", "............................................................................................................................", "............................................................................................................................", "....++++++++++++++++++++....++++++++++++++++++++....++++++++++++++++++++....++++++++++++++++++++....++++............++++....", "....++++++++++++++++++++....++++++++++++++++++++....++++++++++++++++++++....++++++++++++++++++++....++++............++++....", "....++++++++++++++++++++....++++++++++++++++++++....++++++++++++++++++++....++++++++++++++++++++....++++............++++....", "....++++++++++++++++++++....++++++++++++++++++++....++++++++++++++++++++....++++++++++++++++++++....++++............++++....", "....++++....................++++....................++++............++++....................++++....++++............++++....", "....++++....................++++....................++++............++++....................++++....++++............++++....", "....++++....................++++....................++++............++++....................++++....++++............++++....", "....++++....................++++....................++++............++++....................++++....++++............++++....", "....++++++++++++++++++++....++++++++++++++++++++....++++............++++....++++++++++++++++++++....++++++++++++++++++++....", "....++++++++++++++++++++....++++++++++++++++++++....++++............++++....++++++++++++++++++++....++++++++++++++++++++....", "....++++++++++++++++++++....++++++++++++++++++++....++++............++++....++++++++++++++++++++....++++++++++++++++++++....", "....++++++++++++++++++++....++++++++++++++++++++....++++............++++....++++++++++++++++++++....++++++++++++++++++++....", "....................++++....++++....................++++....++++....++++....++++....................................++++....", "....................++++....++++....................++++....++++....++++....++++....................................++++....", "....................++++....++++....................++++....++++....++++....++++....................................++++....", "....................++++....++++....................++++....++++....++++....++++....................................++++....", "....++++++++++++++++++++....++++++++++++++++++++....++++++++++++++++++++....++++++++++++++++++++....................++++....", "....++++++++++++++++++++....++++++++++++++++++++....++++++++++++++++++++....++++++++++++++++++++....................++++....", "....++++++++++++++++++++....++++++++++++++++++++....++++++++++++++++++++....++++++++++++++++++++....................++++....", "....++++++++++++++++++++....++++++++++++++++++++....++++++++++++++++++++....++++++++++++++++++++....................++++....", "............................................................++++............................................................", "............................................................++++............................................................", "............................................................++++............................................................", "............................................................++++............................................................", "............................................................................................................................", "............................................................................................................................", "............................................................................................................................", "............................................................................................................................"}; seq24-0.9.3/src/pixmaps/expand.xpm0000644000175000017500000000101511060731321013646 00000000000000/* XPM */ static const char * expand_xpm[] = { "33 11 4 1", " c None", ". c #000000", "+ c #FFFFFF", "@ c #BDBEBD", " ................ ", " . . ", " ....... . ....... . ", " .+..... ... .++++.. . ", " .+..... ..@.. .+...+. ..... ", " .+..... .@@@. .+...+. ... ", " .+..... .@@@. .++++.. . ", " .+..... .@@@. .+.+... ", " .+..... .@@@. .+..+.. ", " .+++++. ..... .+...+. ", " ....... ....... "}; seq24-0.9.3/src/pixmaps/note_length.xpm0000644000175000017500000000075111060731321014703 00000000000000/* XPM */ static const char * note_length_xpm[] = { "29 12 2 1", " c None", ". c #000000", " ", " . . ... ... ", " . . ... ... ", " . . . . ", " . . . ... ", " . . . ... ", " . . . . ", " . . . . ", " .... .... .... .... ", " . . .... .... .... ", " .... .... .... .... ", " "}; seq24-0.9.3/src/pixmaps/copy.xpm0000644000175000017500000000101311060731321013337 00000000000000/* XPM */ static const char * copy_xpm[] = { "33 11 4 1", " c None", ". c #000000", "+ c #FFFFFF", "@ c #BDBEBD", " ................. ", " . . ", " ....... . ....... . ", " .+..... ... .++++.. ... ", " .+..... ..@.. .+...+. ..@.. ", " .+..... .@@@. .+...+. .@@@. ", " .+..... .@@@. .++++.. .@@@. ", " .+..... .@@@. .+.+... .@@@. ", " .+..... .@@@. .+..+.. .@@@. ", " .+++++. ..... .+...+. ..... ", " ....... ....... "}; seq24-0.9.3/src/pixmaps/scale.xpm0000644000175000017500000000106311060731321013461 00000000000000/* XPM */ static const char * scale_xpm[] = { "30 14 2 1", " c None", ". c #000000", " ", " .... ", " . ", " ..... ", " . ", " ..... ", " . ", " ..... ", " . ", " ..... ", " . ", " ..... ", " ", " "}; seq24-0.9.3/src/pixmaps/seq-editor.xpm0000644000175000017500000000250511100157406014451 00000000000000/* XPM */ static const char * seq_editor_xpm[] = { "32 32 9 1", " c None", ". c #CBDAE7", "+ c #B2C0CD", "@ c #566F84", "# c #DB701A", "$ c #415A6F", "% c #264157", "& c #FFFFFF", "* c #5986AC", " ", " . ", " .+@ ", " ### .+@$% ", " ### .+@$% ", " # # .+@$% ", " ## # .+@$% ", " # # .+@$% ", " # # .+@$% ", " # ### .+@$% ", " # ### .+@$% ", " ### # .+@$% ", " ### .+@$% ", " ### .+@$% ", " .+@$% ", " +@$% ", " +@$ ", " @ ", "&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&", "&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&", "&&&&&&&&&&&&&&&&&&&&****&&&&&&&&", "&&&&&&&&&&&&&&&&&&&&****&&&&&&&&", "&&&&&&&&****&&&&&&&&&&&&&&&&&&&&", "&&&&&&&&****&&&&&&&&&&&&&&&&&&&&", "&&&&&&&&&&&&&&&&****&&&&&&&&&&&&", "&&&&&&&&&&&&&&&&****&&&&&&&&&&&&", "&&&&****&&&&****&&&&&&&&****&&&&", "&&&&****&&&&****&&&&&&&&****&&&&", "****&&&&&&&&&&&&&&&&&&&&&&&&****", "****&&&&&&&&&&&&&&&&&&&&&&&&****", "&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&", "&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&"}; seq24-0.9.3/src/pixmaps/Module.am0000644000175000017500000000172112321053644013417 00000000000000# Makefile.am for seq24 EXTRA_DIST += \ src/pixmaps/bus.xpm \ src/pixmaps/collapse.xpm \ src/pixmaps/copy.xpm \ src/pixmaps/down.xpm \ src/pixmaps/expand.xpm \ src/pixmaps/font_b.xpm \ src/pixmaps/font_w.xpm \ src/pixmaps/key.xpm \ src/pixmaps/learn2.xpm \ src/pixmaps/learn.xpm \ src/pixmaps/length.xpm \ src/pixmaps/loop.xpm \ src/pixmaps/menu_empty.xpm \ src/pixmaps/menu_full.xpm \ src/pixmaps/midi.xpm \ src/pixmaps/note_length.xpm \ src/pixmaps/perfedit.xpm \ src/pixmaps/play2.xpm \ src/pixmaps/play.xpm \ src/pixmaps/q_rec.xpm \ src/pixmaps/quanize.xpm \ src/pixmaps/rec.xpm \ src/pixmaps/redo.xpm \ src/pixmaps/scale.xpm \ src/pixmaps/seq24_32.xpm \ src/pixmaps/seq24.xpm \ src/pixmaps/seq-editor.xpm \ src/pixmaps/sequences.xpm \ src/pixmaps/snap.xpm \ src/pixmaps/song-editor.xpm \ src/pixmaps/stop.xpm \ src/pixmaps/thru.xpm \ src/pixmaps/tools.xpm \ src/pixmaps/undo.xpm \ src/pixmaps/zoom.xpm seq24-0.9.3/src/pixmaps/rec.xpm0000644000175000017500000000137611060731321013152 00000000000000/* XPM */ static const char * rec_xpm[] = { "36 14 10 1", " c None", ". c #000000", "+ c #FFFFFF", "@ c #BFD8FF", "# c #9E9E9E", "$ c #82B1FF", "% c #1E56AA", "& c #FFBABA", "* c #FF5454", "= c #B51E1E", " ...... ..........", " ...+..+... .@@@@@@@@.", " ..+++##+++.. . .@$$$$$$%.", " .++++++++++. .. .@$$$$$$%.", "..++++++++++.. .&. .@$$$$$$%.", ".++++++++++++. ......&*. .@$$$$$$%.", ".+..++++++..+. .&&&&&***. .@$$$$$$%.", ".+#.++++++.#+. .*******=. .@$$$$$$%.", ".++++++++++++. ......*=. .@$$$$$$%.", "..+..++++..+.. .=. .@$$$$$$%.", " .+#.+..+.#+. .. .@$$$$$$%.", " ..+++..+++.. . .@$$$$$$%.", " ...++++... .%%%%%%%%.", " ...... .........."}; seq24-0.9.3/src/pixmaps/seq24_32.xpm0000644000175000017500000000233211060731321013634 00000000000000/* XPM */ static const char * seq24_32_xpm[] = { "32 32 2 1", " c None", ". c #000000", " ", " ", " ........ ........ ........ ", " .. .. .. .. ", " . . . . ", " ........ ........ . . ", " ........ ........ . . ", " .. . . .. . ", " ........ ........ ........ ", " ........ ........ ........ ", " .. ", " .. ", " ", " ", " ", " ", " ........ . . ", " ........ . . ", " .. . . ", " ........ ........ ", " ........ ........ ", " . . ", " .. . ", " ........ . ", " ", " ", " ", " ", " ", " ", " ", " "}; seq24-0.9.3/src/pixmaps/undo.xpm0000644000175000017500000000057511060731321013346 00000000000000/* XPM */ static const char * undo_xpm[] = { "16 14 3 1", " c None", ". c #000000", "+ c #65FF72", " . ", " .. ", " .+. ", " .++........ ", " .++++++++++. ", " .++......+. ", " .+. .+. ", " .. .+. ", " . .+. ", " .+. ", " .+. ", " ........+. ", " .++++++++. ", " .......... "}; seq24-0.9.3/src/pixmaps/midi.xpm0000644000175000017500000000056011060731321013315 00000000000000/* XPM */ static const char * midi_xpm[] = { "14 14 4 1", " c None", ". c #000000", "+ c #FFFFFF", "@ c #9E9E9E", " ...... ", " ...+..+... ", " ..+++@@+++.. ", " .++++++++++. ", "..++++++++++..", ".++++++++++++.", ".+..++++++..+.", ".+@.++++++.@+.", ".++++++++++++.", "..+..++++..+..", " .+@.+..+.@+. ", " ..+++..+++.. ", " ...++++... ", " ...... "}; seq24-0.9.3/src/pixmaps/song-editor.xpm0000644000175000017500000000246711100157426014640 00000000000000/* XPM */ static const char * song_editor_xpm[] = { "32 32 8 1", " c None", ". c #9ED69A", "+ c #79AF75", "@ c #4B8747", "# c #30612D", "$ c #11480C", "% c #FFFFFF", "& c #47C847", " ", " . ", " .+@ ", " .+@#$ ", " .+@#$ ", " .+@#$ ", " .+@#$ ", " .+@#$ ", " .+@#$ ", " .+@#$ ", " .+@#$ ", " .+@#$ ", " .+@#$ ", " .+@#$ ", " .+@#$ ", " +@#$ ", " +@# ", " +@ ", "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%", "&&&&&&&&&&&&%%%%%%%%%%%&&&&&&&&&", "&&&&&&&&&&&&%%%%%%%%%%%&&&&&&&&&", "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%", "%%%%%%%%&&&&&&&&&&&&&%%%%%%%%%%%", "%%%%%%%%&&&&&&&&&&&&&%%%%%%%%%%%", "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%", "&&&&&&&&&&&&&&&&%%%%%%%%%%%%%%%%", "&&&&&&&&&&&&&&&&%%%%%%%%%%%%%%%%", "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%", "%%%%%%%%%%%%%%%&&&&&&&&&&&&&&&&&", "%%%%%%%%%%%%%%%&&&&&&&&&&&&&&&&&", "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%", "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"}; seq24-0.9.3/src/pixmaps/stop.xpm0000644000175000017500000000052411060731321013360 00000000000000/* XPM */ static const char * stop_xpm[] = { "15 11 5 1", " c None", ". c #000000", "+ c #FFC1C1", "@ c #AD6666", "# c #724B4B", " ........... ", " .+++++++++. ", " .+@@@@@@@#. ", " .+@@@@@@@#. ", " .+@@@@@@@#. ", " .+@@@@@@@#. ", " .+@@@@@@@#. ", " .+@@@@@@@#. ", " .+@@@@@@@#. ", " .#########. ", " ........... "}; seq24-0.9.3/src/seqmenu.cpp0000644000175000017500000001423712651156360012366 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #include "seqmenu.h" #include "seqedit.h" #include "font.h" // Constructor seqmenu::seqmenu( perform *a_p ) : m_menu(NULL), m_mainperf(a_p) { using namespace Menu_Helpers; // init the clipboard, so that we don't get a crash // on paste with no previous copy... m_clipboard.set_master_midi_bus( a_p->get_master_midi_bus() ); } void seqmenu::popup_menu() { using namespace Menu_Helpers; delete m_menu; m_menu = manage( new Menu()); if ( m_mainperf->is_active( m_current_seq )) { m_menu->items().push_back(MenuElem("Edit...", mem_fun(*this, &seqmenu::seq_edit))); } else { m_menu->items().push_back(MenuElem("New", mem_fun(*this, &seqmenu::seq_edit))); } m_menu->items().push_back(SeparatorElem()); if ( m_mainperf->is_active( m_current_seq )) { m_menu->items().push_back(MenuElem("Cut", mem_fun(*this,&seqmenu::seq_cut))); m_menu->items().push_back(MenuElem("Copy", mem_fun(*this,&seqmenu::seq_copy))); } else { m_menu->items().push_back(MenuElem("Paste", mem_fun(*this,&seqmenu::seq_paste))); } m_menu->items().push_back(SeparatorElem()); Menu *menu_song = manage( new Menu() ); m_menu->items().push_back( MenuElem( "Song", *menu_song) ); if ( m_mainperf->is_active( m_current_seq )) { menu_song->items().push_back(MenuElem("Clear Song Data", mem_fun(*this,&seqmenu::seq_clear_perf))); } menu_song->items().push_back(MenuElem("Mute All Tracks", mem_fun(*this,&seqmenu::mute_all_tracks))); if ( m_mainperf->is_active( m_current_seq )) { m_menu->items().push_back(SeparatorElem()); Menu *menu_buses = manage( new Menu() ); m_menu->items().push_back( MenuElem( "Midi Bus", *menu_buses) ); /* midi buses */ mastermidibus *masterbus = m_mainperf->get_master_midi_bus(); for ( int i=0; i< masterbus->get_num_out_buses(); i++ ){ Menu *menu_channels = manage( new Menu() ); menu_buses->items().push_back(MenuElem( masterbus->get_midi_out_bus_name(i), *menu_channels )); char b[4]; /* midi channel menu */ for( int j=0; j<16; j++ ){ snprintf(b, sizeof(b), "%d", j + 1); std::string name = string(b); int instrument = global_user_midi_bus_definitions[i].instrument[j]; if ( instrument >= 0 && instrument < c_maxBuses ) { name = name + (string(" (") + global_user_instrument_definitions[instrument].instrument + string(")") ); } menu_channels->items().push_back(MenuElem(name, sigc::bind(mem_fun(*this,&seqmenu::set_bus_and_midi_channel), i, j ))); } } } m_menu->popup(0,0); } void seqmenu::set_bus_and_midi_channel( int a_bus, int a_ch ) { if ( m_mainperf->is_active( m_current_seq )) { m_mainperf->get_sequence( m_current_seq )->set_midi_bus( a_bus ); m_mainperf->get_sequence( m_current_seq )->set_midi_channel( a_ch ); m_mainperf->get_sequence( m_current_seq )->set_dirty(); } } void seqmenu::mute_all_tracks() { m_mainperf->mute_all_tracks(); } // Menu callback, Lanches Editor Window void seqmenu::seq_edit(){ if ( m_mainperf->is_active( m_current_seq )) { if ( !m_mainperf->get_sequence( m_current_seq )->get_editing()) { new seqedit( m_mainperf->get_sequence( m_current_seq ), m_mainperf, m_current_seq ); } else { m_mainperf->get_sequence( m_current_seq )->set_raise(true); } } else { this->seq_new(); new seqedit( m_mainperf->get_sequence( m_current_seq ), m_mainperf, m_current_seq ); } } // Makes a New sequence void seqmenu::seq_new(){ if ( ! m_mainperf->is_active( m_current_seq )){ m_mainperf->new_sequence( m_current_seq ); m_mainperf->get_sequence( m_current_seq )->set_dirty(); } } // Copies selected to clipboard sequence */ void seqmenu::seq_copy(){ if ( m_mainperf->is_active( m_current_seq )) m_clipboard = *(m_mainperf->get_sequence( m_current_seq )); } // Deletes and Copies to Clipboard */ void seqmenu::seq_cut(){ if ( m_mainperf->is_active( m_current_seq ) && !m_mainperf->is_sequence_in_edit( m_current_seq ) ){ m_clipboard = *(m_mainperf->get_sequence( m_current_seq )); m_mainperf->delete_sequence( m_current_seq ); redraw( m_current_seq ); } } // Puts clipboard into location void seqmenu::seq_paste(){ if ( ! m_mainperf->is_active( m_current_seq )){ m_mainperf->new_sequence( m_current_seq ); *(m_mainperf->get_sequence( m_current_seq )) = m_clipboard; m_mainperf->get_sequence( m_current_seq )->set_dirty(); } } void seqmenu::seq_clear_perf(){ if ( m_mainperf->is_active( m_current_seq )){ m_mainperf->push_trigger_undo(); m_mainperf->clear_sequence_triggers( m_current_seq ); m_mainperf->get_sequence( m_current_seq )->set_dirty(); } } seq24-0.9.3/src/options.cpp0000644000175000017500000004622311473027467012412 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #include #include #include #include "options.h" #include "keybindentry.h" // tooltip helper, for old vs new gtk... #if GTK_MINOR_VERSION >= 12 # define add_tooltip(obj, text) obj->set_tooltip_text(text); #else # define add_tooltip(obj, text) m_tooltips->set_tip(*obj, text); #endif const int c_status = 0; const int c_status_inv = 1; const int c_d1 = 2; const int c_d2 = 3; const int c_d3 = 4; enum {e_keylabelsonsequence = 9999}; options::options (Gtk::Window & parent, perform * a_p): Gtk::Dialog ("Options", parent, true, true), m_perf(a_p) { #if GTK_MINOR_VERSION < 12 m_tooltips = manage(new Tooltips()); #endif HBox *hbox = manage (new HBox ()); get_vbox ()->pack_start (*hbox, false, false); get_action_area ()->set_border_width (2); hbox->set_border_width (6); m_button_ok = manage (new Button(Gtk::Stock::OK)); get_action_area ()->pack_end (*m_button_ok, false, false); m_button_ok->signal_clicked ().connect (mem_fun (*this, &options::hide)); m_notebook = manage (new Notebook ()); hbox->pack_start (*m_notebook); add_midi_clock_page(); add_midi_input_page(); add_keyboard_page(); add_mouse_page(); add_jack_sync_page(); } /*MIDI Clock page*/ void options::add_midi_clock_page() { // Clock Buses int buses = m_perf->get_master_midi_bus ()->get_num_out_buses (); VBox *vbox = manage(new VBox()); vbox->set_border_width(6); m_notebook->append_page(*vbox, "MIDI _Clock", true); manage (new Tooltips ()); for (int i = 0; i < buses; i++) { HBox *hbox2 = manage (new HBox ()); Label *label = manage( new Label(m_perf->get_master_midi_bus ()-> get_midi_out_bus_name (i), 0)); hbox2->pack_start (*label, false, false); Gtk::RadioButton * rb_off = manage (new RadioButton ("Off")); add_tooltip( rb_off, "Midi Clock will be disabled."); Gtk::RadioButton * rb_on = manage (new RadioButton ("On (Pos)")); add_tooltip( rb_on, "Midi Clock will be sent. Midi Song Position and Midi Continue will be sent if starting greater than tick 0 in song mode, otherwise Midi Start is sent."); Gtk::RadioButton * rb_mod = manage (new RadioButton ("On (Mod)")); add_tooltip( rb_mod, "Midi Clock will be sent. Midi Start will be sent and clocking will begin once the song position has reached the modulo of the specified Size. (Used for gear that doesn't respond to Song Position)"); Gtk::RadioButton::Group group = rb_off->get_group (); rb_on->set_group (group); rb_mod->set_group (group); rb_off->signal_toggled().connect (sigc::bind(mem_fun (*this, &options::clock_callback_off), i, rb_off )); rb_on->signal_toggled ().connect (sigc::bind(mem_fun (*this, &options::clock_callback_on), i, rb_on )); rb_mod->signal_toggled().connect (sigc::bind(mem_fun (*this, &options::clock_callback_mod), i, rb_mod )); hbox2->pack_end (*rb_mod, false, false ); hbox2->pack_end (*rb_on, false, false); hbox2->pack_end (*rb_off, false, false); vbox->pack_start( *hbox2, false, false ); switch ( m_perf->get_master_midi_bus ()->get_clock (i)) { case e_clock_off: rb_off->set_active(1); break; case e_clock_pos: rb_on->set_active(1); break; case e_clock_mod: rb_mod->set_active(1); break; } } Adjustment *clock_mod_adj = new Adjustment(midibus::get_clock_mod(), 1, 16 << 10, 1 ); SpinButton *clock_mod_spin = new SpinButton( *clock_mod_adj ); HBox *hbox2 = manage (new HBox ()); //m_spinbutton_bpm->set_editable( false ); hbox2->pack_start(*(manage(new Label( "Clock Start Modulo (1/16 Notes)"))), false, false, 4); hbox2->pack_start(*clock_mod_spin, false, false ); vbox->pack_start( *hbox2, false, false ); clock_mod_adj->signal_value_changed().connect(sigc::bind(mem_fun(*this, &options::clock_mod_callback), clock_mod_adj)); } /*MIDI Input page*/ void options::add_midi_input_page() { // Input Buses int buses = m_perf->get_master_midi_bus ()->get_num_in_buses (); VBox *vbox = manage(new VBox ()); vbox->set_border_width(6); m_notebook->append_page(*vbox, "MIDI _Input", true); for (int i = 0; i < buses; i++) { CheckButton *check = manage(new CheckButton( m_perf->get_master_midi_bus()->get_midi_in_bus_name(i), 0)); check->signal_toggled().connect(bind(mem_fun(*this, &options::input_callback), i, check)); check->set_active(m_perf->get_master_midi_bus()->get_input(i)); vbox->pack_start(*check, false, false); } } /*Keyboard page*/ /*Keybinding setup (editor for .seq24rc keybindings).*/ void options::add_keyboard_page() { VBox *mainbox = manage(new VBox()); mainbox->set_spacing(6); m_notebook->append_page(*mainbox, "_Keyboard", true); Label* label; KeyBindEntry* entry; HBox *hbox = manage (new HBox()); CheckButton *check = manage(new CheckButton( "_Show key labels on sequences", true)); check->signal_toggled().connect(bind(mem_fun(*this, &options::input_callback), (int)e_keylabelsonsequence, check)); check->set_active(m_perf->m_show_ui_sequence_key); mainbox->pack_start(*check, false, false); /*Frame for sequence toggle keys*/ Frame* controlframe = manage(new Frame("Control keys")); controlframe->set_border_width(4); mainbox->pack_start(*controlframe, Gtk::PACK_SHRINK); Table* controltable = manage(new Table(4, 8, false)); controltable->set_border_width(4); controltable->set_spacings(4); controlframe->add(*controltable); label = manage(new Label("Start", Gtk::ALIGN_RIGHT)); entry = manage(new KeyBindEntry(KeyBindEntry::location, &m_perf->m_key_start)); controltable->attach(*label, 0, 1, 0, 1); controltable->attach(*entry, 1, 2, 0, 1); label = manage(new Label("Stop", Gtk::ALIGN_RIGHT)); entry = manage(new KeyBindEntry(KeyBindEntry::location, &m_perf->m_key_stop)); controltable->attach(*label, 0, 1, 1, 2); controltable->attach(*entry, 1, 2, 1, 2); label = manage(new Label("Snapshot 1", Gtk::ALIGN_RIGHT)); entry = manage(new KeyBindEntry(KeyBindEntry::location, &m_perf->m_key_snapshot_1)); controltable->attach(*label, 2, 3, 0, 1); controltable->attach(*entry, 3, 4, 0, 1); label = manage(new Label("Snapshot 2", Gtk::ALIGN_RIGHT)); entry = manage(new KeyBindEntry(KeyBindEntry::location, &m_perf->m_key_snapshot_2)); controltable->attach(*label, 2, 3, 1, 2); controltable->attach(*entry, 3, 4, 1, 2); label = manage(new Label("bpm down", Gtk::ALIGN_RIGHT)); entry = manage(new KeyBindEntry(KeyBindEntry::location, &m_perf->m_key_bpm_dn)); controltable->attach(*label, 2, 3, 3, 4); controltable->attach(*entry, 3, 4, 3, 4); label = manage(new Label("bpm up", Gtk::ALIGN_RIGHT)); entry = manage(new KeyBindEntry(KeyBindEntry::location, &m_perf->m_key_bpm_up)); controltable->attach(*label, 2, 3, 2, 3); controltable->attach(*entry, 3, 4, 2, 3); label = manage(new Label("Replace", Gtk::ALIGN_RIGHT)); entry = manage(new KeyBindEntry(KeyBindEntry::location, &m_perf->m_key_replace)); controltable->attach(*label, 4, 5, 0, 1); controltable->attach(*entry, 5, 6, 0, 1); label = manage(new Label("Queue", Gtk::ALIGN_RIGHT)); entry = manage(new KeyBindEntry(KeyBindEntry::location, &m_perf->m_key_queue)); controltable->attach(*label, 4, 5, 1, 2); controltable->attach(*entry, 5, 6, 1, 2); label = manage(new Label("Keep queue", Gtk::ALIGN_RIGHT)); entry = manage(new KeyBindEntry(KeyBindEntry::location, &m_perf->m_key_keep_queue)); controltable->attach(*label, 4, 5, 2, 3); controltable->attach(*entry, 5, 6, 2, 3); label = manage(new Label("Screenset up", Gtk::ALIGN_RIGHT)); entry = manage(new KeyBindEntry(KeyBindEntry::location, &m_perf->m_key_screenset_up)); controltable->attach(*label, 6, 7, 0, 1); controltable->attach(*entry, 7, 8, 0, 1); label = manage(new Label("Screenset down", Gtk::ALIGN_RIGHT)); entry = manage(new KeyBindEntry(KeyBindEntry::location, &m_perf->m_key_screenset_dn)); controltable->attach(*label, 6, 7, 1, 2); controltable->attach(*entry, 7, 8, 1, 2); label = manage(new Label("Set playing screenset", Gtk::ALIGN_RIGHT)); entry = manage(new KeyBindEntry(KeyBindEntry::location, &m_perf->m_key_set_playing_screenset)); controltable->attach(*label, 6, 7, 2, 3); controltable->attach(*entry, 7, 8, 2, 3); /*Frame for sequence toggle keys*/ Frame* toggleframe = manage(new Frame("Sequence toggle keys")); toggleframe->set_border_width(4); mainbox->pack_start(*toggleframe, Gtk::PACK_SHRINK); Table* toggletable = manage(new Table(4, 16, false)); toggletable->set_border_width(4); toggletable->set_spacings(4); toggleframe->add(*toggletable); int x = 0; int y = 0; Label* numlabel; for (int i = 0; i < 32; i++) { x = i % 8 * 2; y = i / 8; int slot = x * 2 + y; // count this way: 0, 4, 8, 16... char buf[16]; snprintf(buf, sizeof(buf), "%d", slot); numlabel = manage(new Label(buf, Gtk::ALIGN_RIGHT)); entry = manage(new KeyBindEntry(KeyBindEntry::events, NULL, m_perf, slot)); toggletable->attach(*numlabel, x, x + 1, y, y + 1); toggletable->attach(*entry, x + 1, x + 2, y, y + 1); } /*Frame for mute group slots*/ Frame* mutegroupframe = manage(new Frame("Mute-group slots")); mutegroupframe->set_border_width(4); mainbox->pack_start(*mutegroupframe, Gtk::PACK_SHRINK); Table* mutegrouptable = manage(new Table(4, 16, false)); mutegrouptable->set_border_width(4); mutegrouptable->set_spacings(4); mutegroupframe->add(*mutegrouptable); for (int i = 0; i <32; i++) { x = i%8*2; y = i/8; char buf[16]; snprintf(buf, sizeof(buf), "%d", i); numlabel = manage(new Label(buf, Gtk::ALIGN_RIGHT)); entry = manage(new KeyBindEntry(KeyBindEntry::groups, NULL, m_perf, i)); mutegrouptable->attach(*numlabel, x, x + 1, y, y + 1); mutegrouptable->attach(*entry, x + 1, x + 2, y, y + 1); } #define AddKey(text, integer) \ label = manage(new Label(text)); \ hbox->pack_start(*label, false, false, 4); \ entry = manage(new KeyBindEntry(KeyBindEntry::location, &integer)); \ hbox->pack_start(*entry, false, false, 4); hbox = manage(new HBox()); AddKey("Learn (while pressing a mute-group key):", m_perf->m_key_group_learn); AddKey("Disable:", m_perf->m_key_group_off); AddKey("Enable:", m_perf->m_key_group_on); mainbox->pack_start (*hbox, false, false); #undef AddKey } /*Mouse page*/ void options::add_mouse_page() { VBox *vbox = manage(new VBox()); m_notebook->append_page(*vbox, "_Mouse", true); /*Frame for transport options*/ Frame* interactionframe = manage(new Frame("Interaction method")); interactionframe->set_border_width(4); vbox->pack_start(*interactionframe, Gtk::PACK_SHRINK); VBox *interactionbox = manage(new VBox()); interactionbox->set_border_width(4); interactionframe->add(*interactionbox); Gtk::RadioButton *rb_seq24 = manage(new RadioButton( "se_q24 (original style)", true)); interactionbox->pack_start(*rb_seq24, Gtk::PACK_SHRINK); Gtk::RadioButton * rb_fruity = manage(new RadioButton( "_fruity (similar to a certain well known sequencer)", true)); interactionbox->pack_start(*rb_fruity, Gtk::PACK_SHRINK); Gtk::RadioButton::Group group = rb_seq24->get_group(); rb_fruity->set_group(group); switch(global_interactionmethod) { case e_fruity_interaction: rb_fruity->set_active(); break; case e_seq24_interaction: default: rb_seq24->set_active(); break; } rb_seq24->signal_toggled().connect(sigc::bind(mem_fun(*this, &options::mouse_seq24_callback), rb_seq24)); rb_fruity->signal_toggled().connect(sigc::bind(mem_fun(*this, &options::mouse_fruity_callback), rb_fruity)); } /*Jack Sync page */ void options::add_jack_sync_page() { #ifdef JACK_SUPPORT VBox *vbox = manage(new VBox()); vbox->set_border_width(4); m_notebook->append_page(*vbox, "_Jack Sync", true); /*Frame for transport options*/ Frame* transportframe = manage(new Frame("Transport")); transportframe->set_border_width(4); vbox->pack_start(*transportframe, Gtk::PACK_SHRINK); VBox *transportbox = manage(new VBox()); transportbox->set_border_width(4); transportframe->add(*transportbox); CheckButton *check = manage(new CheckButton("Jack _Transport", true)); check->set_active (global_with_jack_transport); add_tooltip( check, "Enable sync with JACK Transport."); check->signal_toggled().connect(bind(mem_fun(*this, &options::transport_callback), e_jack_transport, check)); transportbox->pack_start(*check, false, false); check = manage(new CheckButton("Trans_port Master", true)); check->set_active (global_with_jack_master); add_tooltip( check, "Seq24 will attempt to serve as JACK Master."); check->signal_toggled().connect(bind(mem_fun(*this, &options::transport_callback), e_jack_master, check)); transportbox->pack_start(*check, false, false); check = manage (new CheckButton ("Master C_onditional", true)); check->set_active (global_with_jack_master_cond); add_tooltip( check, "Seq24 will fail to be master if there is already a master set."); check->signal_toggled().connect(bind(mem_fun(*this, &options::transport_callback), e_jack_master_cond, check)); transportbox->pack_start(*check, false, false); /*Frame for jack start mode options*/ Frame* modeframe = manage(new Frame("Jack start mode")); modeframe->set_border_width(4); vbox->pack_start(*modeframe, Gtk::PACK_SHRINK); VBox *modebox = manage(new VBox()); modebox->set_border_width(4); modeframe->add(*modebox); Gtk::RadioButton * rb_live = manage( new RadioButton("_Live Mode", true)); add_tooltip(rb_live, "Playback will be in live mode. Use this to " "allow muting and unmuting of loops."); Gtk::RadioButton * rb_perform = manage( new RadioButton("_Song Mode", true)); add_tooltip( rb_perform, "Playback will use the song editors data."); Gtk::RadioButton::Group group = rb_live->get_group (); rb_perform->set_group (group); if (global_jack_start_mode) rb_perform->set_active(true); else rb_live->set_active(true); rb_perform->signal_toggled().connect(bind(mem_fun(*this, &options::transport_callback), e_jack_start_mode_song, rb_perform)); modebox->pack_start(*rb_live, false, false); modebox->pack_start(*rb_perform, false, false); /*Connetion buttons*/ HButtonBox* buttonbox = manage(new HButtonBox()); buttonbox->set_layout(Gtk::BUTTONBOX_START); buttonbox->set_spacing(6); vbox->pack_start(*buttonbox, false, false); Gtk::Button * button = manage(new Button("Co_nnect", true)); add_tooltip(button, "Connect to Jack."); button->signal_clicked().connect(bind(mem_fun(*this, &options::transport_callback), e_jack_connect, button)); buttonbox->pack_start(*button, false, false); button = manage(new Button("_Disconnect", true)); add_tooltip(button, "Disconnect Jack."); button->signal_clicked().connect(bind(mem_fun(*this, &options::transport_callback), e_jack_disconnect, button)); buttonbox->pack_start(*button, false, false); #endif } void options::clock_callback_off (int a_bus, RadioButton *a_button) { if (a_button->get_active ()) m_perf->get_master_midi_bus ()->set_clock(a_bus, e_clock_off ); } void options::clock_callback_on (int a_bus, RadioButton *a_button) { if (a_button->get_active ()) m_perf->get_master_midi_bus ()->set_clock(a_bus, e_clock_pos ); } void options::clock_callback_mod (int a_bus, RadioButton *a_button) { if (a_button->get_active ()) m_perf->get_master_midi_bus ()->set_clock(a_bus, e_clock_mod ); } void options::clock_mod_callback( Adjustment *adj ) { midibus::set_clock_mod((int)adj->get_value()); } void options::input_callback (int a_bus, Button * i_button) { CheckButton *a_button = (CheckButton *) i_button; bool input = a_button->get_active (); if (9999 == a_bus) { m_perf->m_show_ui_sequence_key = input; for (int i=0; i< c_max_sequence; i++ ){ if (m_perf->get_sequence( i )) m_perf->get_sequence( i )->set_dirty(); } return; } m_perf->get_master_midi_bus ()->set_input (a_bus, input); } void options::mouse_seq24_callback(Gtk::RadioButton *btn) { if (btn->get_active()) global_interactionmethod = e_seq24_interaction; } void options::mouse_fruity_callback(Gtk::RadioButton *btn) { if (btn->get_active()) global_interactionmethod = e_fruity_interaction; } void options::transport_callback(button a_type, Button *a_check) { CheckButton *check = (CheckButton *) a_check; switch (a_type) { case e_jack_transport: global_with_jack_transport = check->get_active(); break; case e_jack_master: global_with_jack_master = check->get_active(); break; case e_jack_master_cond: global_with_jack_master_cond = check->get_active(); break; case e_jack_start_mode_song: global_jack_start_mode = check->get_active(); break; case e_jack_connect: m_perf->init_jack(); break; case e_jack_disconnect: m_perf->deinit_jack(); break; default: break; } } seq24-0.9.3/src/perfroll.h0000644000175000017500000001003212651156360012170 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #pragma once #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "globals.h" #include "perform.h" #include "mutex.h" using namespace Gtk; #include "perfroll_input.h" const int c_perfroll_background_x = (c_ppqn * 4 * 16) / c_perf_scale_x; const int c_perfroll_size_box_w = 3; const int c_perfroll_size_box_click_w = c_perfroll_size_box_w+1 ; /* performance roll */ class perfroll : public Gtk::DrawingArea { private: friend class FruityPerfInput; friend class Seq24PerfInput; AbstractPerfInput* m_interaction; Glib::RefPtr m_gc; Glib::RefPtr m_window; Gdk::Color m_black, m_white, m_grey, m_lt_grey; Glib::RefPtr m_pixmap; Glib::RefPtr m_background; perform *m_mainperf; int m_snap; int m_measure_length; int m_beat_length; int m_window_x, m_window_y; long m_old_progress_ticks; int m_4bar_offset; int m_sequence_offset; int m_roll_length_ticks; int m_drop_x, m_drop_y; long m_drop_tick; long m_drop_tick_trigger_offset; int m_drop_sequence; bool m_sequence_active[c_total_seqs]; Adjustment *m_vadjust; Adjustment *m_hadjust; bool m_moving; bool m_growing; bool m_grow_direction; void on_realize(); bool on_expose_event(GdkEventExpose* a_ev); bool on_button_press_event(GdkEventButton* a_ev); bool on_button_release_event(GdkEventButton* a_ev); bool on_motion_notify_event(GdkEventMotion* a_ev); bool on_scroll_event( GdkEventScroll* a_ev ) ; bool on_focus_in_event(GdkEventFocus*); bool on_focus_out_event(GdkEventFocus*); void on_size_request(GtkRequisition* ); void on_size_allocate(Gtk::Allocation& ); bool on_key_press_event(GdkEventKey* a_p0); void convert_xy( int a_x, int a_y, long *a_ticks, int *a_seq); void convert_x( int a_x, long *a_ticks); void snap_x( int *a_x ); void start_playing(); void stop_playing(); void draw_sequence_on( Glib::RefPtr a_draw, int a_sequence ); void draw_background_on( Glib::RefPtr a_draw, int a_sequence ); void draw_drawable_row( Glib::RefPtr a_dest, Glib::RefPtr a_src, long a_y ); void change_horz(); void change_vert(); void split_trigger( int a_sequence, long a_tick ); public: void set_guides( int a_snap, int a_measure, int a_beat ); void update_sizes(); void init_before_show( ); void fill_background_pixmap(); void increment_size(); void draw_progress(); void redraw_dirty_sequences(); perfroll( perform *a_perf, Adjustment *a_hadjust, Adjustment *a_vadjust ); ~perfroll( ); }; seq24-0.9.3/src/mutex.cpp0000644000175000017500000000270111473027443012044 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #include "mutex.h" const pthread_mutex_t mutex::recmutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; const pthread_cond_t condition_var::cond = PTHREAD_COND_INITIALIZER; mutex::mutex( ) { m_mutex_lock = recmutex; } void mutex::lock( ) { pthread_mutex_lock( &m_mutex_lock ); } void mutex::unlock( ) { pthread_mutex_unlock( &m_mutex_lock ); } condition_var::condition_var( ) { m_cond = cond; } void condition_var::signal( ) { pthread_cond_signal( &m_cond ); } void condition_var::wait( ) { pthread_cond_wait( &m_cond, &m_mutex_lock ); } seq24-0.9.3/src/seqroll.cpp0000644000175000017500000016366712651156360012406 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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 So%ftware Foundation; either version 2 of the License, or // (at your option) any later version. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #include "event.h" #include "seqroll.h" const long c_handlesize = 16; inline static long clamp( long val, long low, long hi ) { return val < low ? low : hi < val ? hi : val; } seqroll::seqroll(perform *a_perf, sequence *a_seq, int a_zoom, int a_snap, seqdata *a_seqdata_wid, seqevent *a_seqevent_wid, seqkeys *a_seqkeys_wid, int a_pos, Adjustment *a_hadjust, Adjustment *a_vadjust ) : m_black(Gdk::Color("black")), m_white(Gdk::Color("white")), m_grey(Gdk::Color("gray")), m_dk_grey(Gdk::Color("gray50")), m_red(Gdk::Color("orange")), m_seq(a_seq), m_perform(a_perf), m_seqdata_wid(a_seqdata_wid), m_seqevent_wid(a_seqevent_wid), m_seqkeys_wid(a_seqkeys_wid), m_pos(a_pos), m_zoom(a_zoom), m_snap(a_snap), m_scale(0), m_key(0), m_window_x(10), m_window_y(10), m_selecting(false), m_moving(false), m_moving_init(false), m_growing(false), m_painting(false), m_paste(false), m_is_drag_pasting(false), m_is_drag_pasting_start(false), m_justselected_one(false), m_old_progress_x(0), m_vadjust(a_vadjust), m_hadjust(a_hadjust), m_scroll_offset_ticks(0), m_scroll_offset_key(0), m_scroll_offset_x(0), m_scroll_offset_y(0), m_background_sequence(0), m_drawing_background_seq(false), m_ignore_redraw(false) { using namespace Menu_Helpers; Glib::RefPtr colormap = get_default_colormap(); colormap->alloc_color( m_black ); colormap->alloc_color( m_white ); colormap->alloc_color( m_grey ); colormap->alloc_color( m_dk_grey ); colormap->alloc_color( m_red ); m_clipboard = new sequence( ); add_events( Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK | Gdk::POINTER_MOTION_MASK | Gdk::KEY_PRESS_MASK | Gdk::KEY_RELEASE_MASK | Gdk::FOCUS_CHANGE_MASK | Gdk::ENTER_NOTIFY_MASK | Gdk::LEAVE_NOTIFY_MASK | Gdk::SCROLL_MASK); set_double_buffered( false ); } void seqroll::set_background_sequence( bool a_state, int a_seq ) { m_drawing_background_seq = a_state; m_background_sequence = a_seq; if ( m_ignore_redraw ) return; update_background(); update_pixmap(); queue_draw(); } seqroll::~seqroll( ) { delete m_clipboard; } void seqroll::on_realize() { // we need to do the default realize Gtk::DrawingArea::on_realize(); set_flags( Gtk::CAN_FOCUS ); // Now we can allocate any additional resources we need m_window = get_window(); m_gc = Gdk::GC::create( m_window ); m_window->clear(); m_hadjust->signal_value_changed().connect( mem_fun( *this, &seqroll::change_horz )); m_vadjust->signal_value_changed().connect( mem_fun( *this, &seqroll::change_vert )); update_sizes(); } /* use m_zoom and i % m_seq->get_bpm() == 0 int numberLines = 128 / m_seq->get_bw() / m_zoom; int distance = c_ppqn / 32; */ void seqroll::update_sizes() { /* set default size */ m_hadjust->set_lower( 0 ); m_hadjust->set_upper( m_seq->get_length() ); m_hadjust->set_page_size( m_window_x * m_zoom ); /* The step increment is 1 semiquaver (1/16) note per zoom level */ m_hadjust->set_step_increment( (c_ppqn / 4) * m_zoom); /* The page increment is always one bar */ int page_increment = int( double(c_ppqn) * double(m_seq->get_bpm()) * (4.0 / double(m_seq->get_bw())) ); m_hadjust->set_page_increment(page_increment); int h_max_value = ( m_seq->get_length() - (m_window_x * m_zoom)); if ( m_hadjust->get_value() > h_max_value ){ m_hadjust->set_value( h_max_value ); } m_vadjust->set_lower( 0 ); m_vadjust->set_upper( c_num_keys ); m_vadjust->set_page_size( m_window_y / c_key_y ); m_vadjust->set_step_increment( 12 ); m_vadjust->set_page_increment( 12 ); int v_max_value = c_num_keys - (m_window_y / c_key_y); if ( m_vadjust->get_value() > v_max_value ){ m_vadjust->set_value(v_max_value); } /* create pixmaps with window dimentions */ if( is_realized() ) { m_pixmap = Gdk::Pixmap::create( m_window, m_window_x, m_window_y, -1); m_background = Gdk::Pixmap::create( m_window, m_window_x, m_window_y, -1); change_vert(); } } void seqroll::change_horz( ) { m_scroll_offset_ticks = (int) m_hadjust->get_value(); m_scroll_offset_x = m_scroll_offset_ticks / m_zoom; if ( m_ignore_redraw ) return; update_background(); update_pixmap(); force_draw(); } void seqroll::change_vert( ) { m_scroll_offset_key = (int) m_vadjust->get_value(); m_scroll_offset_y = m_scroll_offset_key * c_key_y; if ( m_ignore_redraw ) return; update_background(); update_pixmap(); force_draw(); } /* basically resets the whole widget as if it was realized again */ void seqroll::reset() { m_scroll_offset_ticks = (int) m_hadjust->get_value(); m_scroll_offset_x = m_scroll_offset_ticks / m_zoom; if ( m_ignore_redraw ) return; update_sizes(); update_background(); update_pixmap(); queue_draw(); } void seqroll::redraw() { if ( m_ignore_redraw ) return; m_scroll_offset_ticks = (int) m_hadjust->get_value(); m_scroll_offset_x = m_scroll_offset_ticks / m_zoom; update_background(); update_pixmap(); force_draw(); } void seqroll::redraw_events() { if ( m_ignore_redraw ) return; update_pixmap(); force_draw(); } void seqroll::set_ignore_redraw(bool a_ignore) { m_ignore_redraw = a_ignore; } void seqroll::draw_background_on_pixmap() { m_pixmap->draw_drawable(m_gc, m_background, 0, 0, 0, 0, m_window_x, m_window_y ); } /* updates background */ void seqroll::update_background() { /* clear background */ m_gc->set_foreground(m_white); m_background->draw_rectangle(m_gc,true, 0, 0, m_window_x, m_window_y ); /* draw horz grey lines */ m_gc->set_foreground(m_grey); m_gc->set_line_attributes( 1, Gdk::LINE_ON_OFF_DASH, Gdk::CAP_NOT_LAST, Gdk::JOIN_MITER ); gint8 dash = 1; m_gc->set_dashes( 0, &dash, 1 ); for ( int i=0; i< (m_window_y / c_key_y) + 1; i++ ) { if (global_interactionmethod == e_fruity_interaction) { if (0 == (((c_num_keys - i) - m_scroll_offset_key + ( 12 - m_key )) % 12)) { /* draw horz black lines at C */ m_gc->set_foreground(m_dk_grey); m_gc->set_line_attributes( 1, Gdk::LINE_SOLID, Gdk::CAP_NOT_LAST, Gdk::JOIN_MITER ); } else if (11 == (((c_num_keys - i) - m_scroll_offset_key + ( 12 - m_key )) % 12)) { /* draw horz grey lines for the other notes */ m_gc->set_foreground(m_grey); m_gc->set_line_attributes( 1, Gdk::LINE_ON_OFF_DASH, Gdk::CAP_NOT_LAST, Gdk::JOIN_MITER ); } } m_background->draw_line(m_gc, 0, i * c_key_y, m_window_x, i * c_key_y ); if ( m_scale != c_scale_off ){ if ( !c_scales_policy[m_scale][ ((c_num_keys - i) - m_scroll_offset_key - 1 + ( 12 - m_key )) % 12] ) m_background->draw_rectangle(m_gc,true, 0, i * c_key_y + 1, m_window_x, c_key_y - 1 ); } } /*int measure_length_64ths = m_seq->get_bpm() * 64 / m_seq->get_bw();*/ //printf ( "measure_length_64ths[%d]\n", measure_length_64ths ); //int measures_per_line = (256 / measure_length_64ths) / (32 / m_zoom); //if ( measures_per_line <= 0 int measures_per_line = 1; int ticks_per_measure = m_seq->get_bpm() * (4 * c_ppqn) / m_seq->get_bw(); int ticks_per_beat = (4 * c_ppqn) / m_seq->get_bw(); int ticks_per_step = 6 * m_zoom; int ticks_per_m_line = ticks_per_measure * measures_per_line; int start_tick = m_scroll_offset_ticks - (m_scroll_offset_ticks % ticks_per_step ); int end_tick = (m_window_x * m_zoom) + m_scroll_offset_ticks; //printf ( "ticks_per_step[%d] start_tick[%d] end_tick[%d]\n", // ticks_per_step, start_tick, end_tick ); m_gc->set_foreground(m_grey); for ( int i=start_tick; iset_foreground(m_black); m_gc->set_line_attributes( 1, Gdk::LINE_SOLID, Gdk::CAP_NOT_LAST, Gdk::JOIN_MITER ); } else if (i % ticks_per_beat == 0 ){ m_gc->set_foreground(m_dk_grey); m_gc->set_line_attributes( 1, Gdk::LINE_SOLID, Gdk::CAP_NOT_LAST, Gdk::JOIN_MITER ); } else { m_gc->set_line_attributes( 1, Gdk::LINE_ON_OFF_DASH, Gdk::CAP_NOT_LAST, Gdk::JOIN_MITER ); int i_snap = i - (i % m_snap); if( i == i_snap ){ m_gc->set_foreground(m_dk_grey); } else { m_gc->set_foreground(m_grey); } gint8 dash = 1; m_gc->set_dashes( 0, &dash, 1 ); } m_background->draw_line(m_gc, base_line - m_scroll_offset_x, 0, base_line - m_scroll_offset_x, m_window_y); } /* reset line style */ m_gc->set_line_attributes( 1, Gdk::LINE_SOLID, Gdk::CAP_NOT_LAST, Gdk::JOIN_MITER ); } /* sets zoom, resets */ void seqroll::set_zoom( int a_zoom ) { if ( m_zoom != a_zoom ){ m_zoom = a_zoom; reset(); } } /* simply ses the snap member */ void seqroll::set_snap( int a_snap ) { m_snap = a_snap; reset(); } void seqroll::set_note_length( int a_note_length ) { m_note_length = a_note_length; } /* sets the music scale */ void seqroll::set_scale( int a_scale ) { if ( m_scale != a_scale ){ m_scale = a_scale; reset(); } } /* sets the key */ void seqroll::set_key( int a_key ) { if ( m_key != a_key ){ m_key = a_key; reset(); } } /* draws background pixmap on main pixmap, then puts the events on */ void seqroll::update_pixmap() { //printf( "update_pixmap()\n" ); draw_background_on_pixmap(); draw_events_on_pixmap(); } void seqroll::draw_progress_on_window() { m_window->draw_drawable(m_gc, m_pixmap, m_old_progress_x, 0, m_old_progress_x, 0, 1, m_window_y ); m_old_progress_x = (m_seq->get_last_tick() / m_zoom) - m_scroll_offset_x; if ( m_old_progress_x != 0 ){ m_gc->set_foreground(m_black); m_window->draw_line(m_gc, m_old_progress_x, 0, m_old_progress_x, m_window_y); } } void seqroll::draw_events_on( Glib::RefPtr a_draw ) { long tick_s; long tick_f; int note; int note_x; int note_width; int note_y; int note_height; bool selected; int velocity; draw_type dt; int start_tick = m_scroll_offset_ticks ; int end_tick = (m_window_x * m_zoom) + m_scroll_offset_ticks; sequence *seq = NULL; for( int method=0; method<2; ++method ) { if ( method == 0 && m_drawing_background_seq ){ if ( m_perform->is_active( m_background_sequence )){ seq =m_perform->get_sequence( m_background_sequence ); } else { method++; } } else if ( method == 0 ){ method++; } if ( method==1){ seq = m_seq; } /* draw boxes from sequence */ m_gc->set_foreground( m_black ); seq->reset_draw_marker(); while ( (dt = seq->get_next_note_event( &tick_s, &tick_f, ¬e, &selected, &velocity )) != DRAW_FIN ) { if ((tick_s >= start_tick && tick_s <= end_tick) || ( (dt == DRAW_NORMAL_LINKED) && (tick_f >= start_tick && tick_f <= end_tick)) ) { /* turn into screen corrids */ note_x = tick_s / m_zoom; note_y = c_rollarea_y -(note * c_key_y) - c_key_y - 1 + 2; note_height = c_key_y - 3; // printf( "DEBUG: drawing note[%d] tick_s[%d] tick_f[%d] start_tick[%d] end_tick[%d]\n", // note, tick_s, tick_f, start_tick, end_tick ); // printf( "DEBUG: seq.get_lenght() = %d\n", m_seq->get_length()); int in_shift = 0; int length_add = 0; if ( dt == DRAW_NORMAL_LINKED ){ if (tick_f >= tick_s) { note_width = (tick_f - tick_s) / m_zoom; if ( note_width < 1 ) note_width = 1; } else { note_width = (m_seq->get_length() - tick_s) / m_zoom; } } else { note_width = 16 / m_zoom; } if ( dt == DRAW_NOTE_ON ){ in_shift = 0; length_add = 2; } if ( dt == DRAW_NOTE_OFF ){ in_shift = -1; length_add = 1; } note_x -= m_scroll_offset_x; note_y -= m_scroll_offset_y; m_gc->set_foreground(m_black); /* draw boxes from sequence */ if ( method == 0 ) m_gc->set_foreground( m_dk_grey ); a_draw->draw_rectangle( m_gc,true, note_x, note_y, note_width, note_height); if (tick_f < tick_s) { a_draw->draw_rectangle( m_gc,true, 0, note_y, tick_f/m_zoom, note_height); } /* draw inside box if there is room */ if ( note_width > 3 ){ if ( selected ) m_gc->set_foreground(m_red); else m_gc->set_foreground(m_white); if ( method == 1 ) { if (tick_f >= tick_s) { a_draw->draw_rectangle( m_gc,true, note_x + 1 + in_shift, note_y + 1, note_width - 3 + length_add, note_height - 3); } else { a_draw->draw_rectangle( m_gc,true, note_x + 1 + in_shift, note_y + 1, note_width , note_height - 3); a_draw->draw_rectangle( m_gc,true, 0, note_y + 1, (tick_f/m_zoom) - 3 + length_add, note_height - 3); } } } } } } } /* fills main pixmap with events */ void seqroll::draw_events_on_pixmap() { draw_events_on( m_pixmap ); } int seqroll::idle_redraw() { //printf( "idle_redraw()\n" ); draw_events_on( m_window ); draw_events_on( m_pixmap ); return true; } void seqroll::draw_selection_on_window() { int x,y,w,h; if ( m_selecting || m_moving || m_paste || m_growing ){ m_gc->set_line_attributes( 1, Gdk::LINE_SOLID, Gdk::CAP_NOT_LAST, Gdk::JOIN_MITER ); /* replace old */ m_window->draw_drawable(m_gc, m_pixmap, m_old.x, m_old.y, m_old.x, m_old.y, m_old.width + 1, m_old.height + 1 ); } if ( m_selecting ){ xy_to_rect ( m_drop_x, m_drop_y, m_current_x, m_current_y, &x, &y, &w, &h ); x -= m_scroll_offset_x; y -= m_scroll_offset_y; m_old.x = x; m_old.y = y; m_old.width = w; m_old.height = h + c_key_y; m_gc->set_foreground(m_black); m_window->draw_rectangle(m_gc,false, x, y, w, h + c_key_y ); } if ( m_moving || m_paste ){ int delta_x = m_current_x - m_drop_x; int delta_y = m_current_y - m_drop_y; x = m_selected.x + delta_x; y = m_selected.y + delta_y; x -= m_scroll_offset_x; y -= m_scroll_offset_y; m_gc->set_foreground(m_black); m_window->draw_rectangle(m_gc,false, x, y, m_selected.width, m_selected.height ); m_old.x = x; m_old.y = y; m_old.width = m_selected.width; m_old.height = m_selected.height; } if ( m_growing ){ int delta_x = m_current_x - m_drop_x; int width = delta_x + m_selected.width; if ( width < 1 ) width = 1; x = m_selected.x; y = m_selected.y; x -= m_scroll_offset_x; y -= m_scroll_offset_y; m_gc->set_foreground(m_black); m_window->draw_rectangle(m_gc,false, x, y, width, m_selected.height ); m_old.x = x; m_old.y = y; m_old.width = width; m_old.height = m_selected.height; } } bool seqroll::on_expose_event(GdkEventExpose* e) { m_window->draw_drawable(m_gc, m_pixmap, e->area.x, e->area.y, e->area.x, e->area.y, e->area.width, e->area.height ); draw_selection_on_window(); return true; } void seqroll::force_draw() { m_window->draw_drawable(m_gc, m_pixmap, 0, 0, 0, 0, m_window_x, m_window_y ); draw_selection_on_window(); } /* takes screen corrdinates, give us notes and ticks */ void seqroll::convert_xy( int a_x, int a_y, long *a_tick, int *a_note) { *a_tick = a_x * m_zoom; *a_note = (c_rollarea_y - a_y - 2) / c_key_y; } /* notes and ticks to screen corridinates */ void seqroll::convert_tn( long a_ticks, int a_note, int *a_x, int *a_y) { *a_x = a_ticks / m_zoom; *a_y = c_rollarea_y - ((a_note + 1) * c_key_y) - 1; } /* checks mins / maxes.. the fills in x,y and width and height */ void seqroll::xy_to_rect( int a_x1, int a_y1, int a_x2, int a_y2, int *a_x, int *a_y, int *a_w, int *a_h ) { if ( a_x1 < a_x2 ){ *a_x = a_x1; *a_w = a_x2 - a_x1; } else { *a_x = a_x2; *a_w = a_x1 - a_x2; } if ( a_y1 < a_y2 ){ *a_y = a_y1; *a_h = a_y2 - a_y1; } else { *a_y = a_y2; *a_h = a_y1 - a_y2; } } void seqroll::convert_tn_box_to_rect( long a_tick_s, long a_tick_f, int a_note_h, int a_note_l, int *a_x, int *a_y, int *a_w, int *a_h ) { int x1, y1, x2, y2; /* convert box to X,Y values */ convert_tn( a_tick_s, a_note_h, &x1, &y1 ); convert_tn( a_tick_f, a_note_l, &x2, &y2 ); xy_to_rect( x1, y1, x2, y2, a_x, a_y, a_w, a_h ); *a_h += c_key_y; } void seqroll::start_paste( ) { long tick_s; long tick_f; int note_h; int note_l; snap_x( &m_current_x ); snap_y( &m_current_x ); m_drop_x = m_current_x; m_drop_y = m_current_y; m_paste = true; /* get the box that selected elements are in */ m_seq->get_clipboard_box( &tick_s, ¬e_h, &tick_f, ¬e_l ); convert_tn_box_to_rect( tick_s, tick_f, note_h, note_l, &m_selected.x, &m_selected.y, &m_selected.width, &m_selected.height ); /* adjust for clipboard being shifted to tick 0 */ m_selected.x += m_drop_x; m_selected.y += (m_drop_y - m_selected.y); } bool seqroll::on_button_press_event(GdkEventButton* a_ev) { bool result; switch (global_interactionmethod) { case e_fruity_interaction: result = m_fruity_interaction.on_button_press_event(a_ev, *this); break; case e_seq24_interaction: result = m_seq24_interaction.on_button_press_event(a_ev, *this); break; default: result = false; } return result; } bool seqroll::on_button_release_event(GdkEventButton* a_ev) { bool result; switch (global_interactionmethod) { case e_fruity_interaction: result = m_fruity_interaction.on_button_release_event(a_ev, *this); break; case e_seq24_interaction: result = m_seq24_interaction.on_button_release_event(a_ev, *this); break; default: result = false; } return result; } bool seqroll::on_motion_notify_event(GdkEventMotion* a_ev) { bool result; switch (global_interactionmethod) { case e_fruity_interaction: result = m_fruity_interaction.on_motion_notify_event(a_ev, *this); break; case e_seq24_interaction: result = m_seq24_interaction.on_motion_notify_event(a_ev, *this); break; default: result = false; } return result; } /* performs a 'snap' on y */ void seqroll::snap_y( int *a_y ) { *a_y = *a_y - (*a_y % c_key_y); } /* performs a 'snap' on x */ void seqroll::snap_x( int *a_x ) { //snap = number pulses to snap to //m_zoom = number of pulses per pixel //so snap / m_zoom = number pixels to snap to int mod = (m_snap / m_zoom); if ( mod <= 0 ) mod = 1; *a_x = *a_x - (*a_x % mod ); } bool seqroll::on_enter_notify_event(GdkEventCrossing* a_p0) { m_seqkeys_wid->set_hint_state( true ); return false; } bool seqroll::on_leave_notify_event(GdkEventCrossing* a_p0) { m_seqkeys_wid->set_hint_state( false ); return false; } bool seqroll::on_focus_in_event(GdkEventFocus*) { set_flags(Gtk::HAS_FOCUS); //m_seq->clear_clipboard(); return false; } bool seqroll::on_focus_out_event(GdkEventFocus*) { unset_flags(Gtk::HAS_FOCUS); return false; } bool seqroll::on_key_press_event(GdkEventKey* a_p0) { bool ret = false; // the start/end key may be the same key (i.e. SPACEBAR) // allow toggling when the same key is mapped to both triggers (i.e. SPACEBAR) bool dont_toggle = m_perform->m_key_start != m_perform->m_key_stop; if ( a_p0->keyval == m_perform->m_key_start && (dont_toggle || !is_pattern_playing) ){ m_perform->position_jack( false ); m_perform->start( false ); m_perform->start_jack( ); is_pattern_playing=true; } else if ( a_p0->keyval == m_perform->m_key_stop && (dont_toggle || is_pattern_playing) ){ m_perform->stop_jack(); m_perform->stop(); is_pattern_playing=false; } if ( a_p0->type == GDK_KEY_PRESS ){ if ( a_p0->keyval == GDK_Delete || a_p0->keyval == GDK_BackSpace ){ m_seq->push_undo(); m_seq->mark_selected(); m_seq->remove_marked(); ret = true; } if (!is_pattern_playing) { if ( a_p0->keyval == GDK_Home ){ m_seq->set_orig_tick(0); ret = true; } if ( a_p0->keyval == GDK_Left ){ m_seq->set_orig_tick(m_seq->get_last_tick()- m_snap); ret = true; } if ( a_p0->keyval == GDK_Right ){ m_seq->set_orig_tick(m_seq->get_last_tick() + m_snap); ret = true; } } if ( a_p0->state & GDK_CONTROL_MASK ){ /* cut */ if ( a_p0->keyval == GDK_x || a_p0->keyval == GDK_X ){ m_seq->push_undo(); m_seq->copy_selected(); m_seq->mark_selected(); m_seq->remove_marked(); ret = true; } /* copy */ if ( a_p0->keyval == GDK_c || a_p0->keyval == GDK_C ){ m_seq->copy_selected(); ret = true; } /* paste */ if ( a_p0->keyval == GDK_v || a_p0->keyval == GDK_V ){ start_paste(); ret = true; } /* Undo */ if ( a_p0->keyval == GDK_z || a_p0->keyval == GDK_Z ){ m_seq->pop_undo(); ret = true; } /* select all events */ if ( a_p0->keyval == GDK_a || a_p0->keyval == GDK_A ){ m_seq->select_all(); ret = true; } } } if ( ret == true ){ m_seq->set_dirty(); //redraw_events(); return true; } return false; } void seqroll::set_data_type( unsigned char a_status, unsigned char a_control = 0 ) { m_status = a_status; m_cc = a_control; } void seqroll::on_size_allocate(Gtk::Allocation& a_r ) { Gtk::DrawingArea::on_size_allocate( a_r ); m_window_x = a_r.get_width(); m_window_y = a_r.get_height(); update_sizes(); } bool seqroll::on_scroll_event( GdkEventScroll* a_ev ) { guint modifiers; // Used to filter out caps/num lock etc. modifiers = gtk_accelerator_get_default_mod_mask (); /* This scroll event only handles basic scrolling without any * modifier keys such as GDK_CONTROL_MASK or GDK_SHIFT_MASK */ if ((a_ev->state & modifiers) != 0) return false; double val = m_vadjust->get_value(); if (a_ev->direction == GDK_SCROLL_UP){ val -= m_vadjust->get_step_increment()/6; } else if (a_ev->direction == GDK_SCROLL_DOWN){ val += m_vadjust->get_step_increment()/6; } else { return true; } m_vadjust->clamp_page( val, val + m_vadjust->get_page_size() ); return true; } ////////////////////////// // interaction methods ////////////////////////// void FruitySeqRollInput::updateMousePtr(seqroll& ths) { // context sensitive mouse { long drop_tick; int drop_note; ths.convert_xy( ths.m_current_x, ths.m_current_y, &drop_tick, &drop_note ); long start, end, note; if (ths.m_is_drag_pasting || ths.m_selecting || ths.m_moving || ths.m_growing || ths.m_paste) { ths.get_window()->set_cursor( Gdk::Cursor( Gdk::LEFT_PTR )); } else if (!m_adding && ths.m_seq->intersectNotes( drop_tick, drop_note, start, end, note ) && note == drop_note) { long handle_size = clamp( c_handlesize, 0, (end-start)/3 ); if (start <= drop_tick && drop_tick <= start + handle_size) { //get_window()->set_cursor( Gdk::Cursor( Gdk::RIGHT_PTR )); ths.get_window()->set_cursor( Gdk::Cursor( Gdk::CENTER_PTR )); // not supported yet } else if (end - handle_size <= drop_tick && drop_tick <= end) { ths.get_window()->set_cursor( Gdk::Cursor( Gdk::LEFT_PTR )); } else { ths.get_window()->set_cursor( Gdk::Cursor( Gdk::CENTER_PTR )); } } else { ths.get_window()->set_cursor( Gdk::Cursor( Gdk::PENCIL )); } } } bool FruitySeqRollInput::on_button_press_event(GdkEventButton* a_ev, seqroll& ths) { int numsel; long tick_s; long tick_f; int note_h; int note_l; int norm_x, norm_y, snapped_x, snapped_y; ths.grab_focus( ); bool needs_update = false; snapped_x = norm_x = (int) (a_ev->x + ths.m_scroll_offset_x ); snapped_y = norm_y = (int) (a_ev->y + ths.m_scroll_offset_y ); ths.snap_x( &snapped_x ); ths.snap_y( &snapped_y ); /* y is always snapped */ ths.m_current_y = ths.m_drop_y = snapped_y; /* reset box that holds dirty redraw spot */ ths.m_old.x = 0; ths.m_old.y = 0; ths.m_old.width = 0; ths.m_old.height = 0; // ctrl-v pressed, we're waiting for a click to show where to paste if ( ths.m_paste ){ ths.convert_xy( snapped_x, snapped_y, &tick_s, ¬e_h ); ths.m_paste = false; ths.m_seq->push_undo(); ths.m_seq->paste_selected( tick_s, note_h ); needs_update = true; } else { /* left mouse button */ if ( a_ev->button == 1) { /* selection, normal x */ ths.m_current_x = ths.m_drop_x = norm_x; /* turn x,y in to tick/note */ ths.convert_xy( ths.m_drop_x, ths.m_drop_y, &tick_s, ¬e_h ); // if not on top of event then add one... if ( m_canadd && ! ths.m_seq->select_note_events( tick_s, note_h, tick_s, note_h, sequence::e_would_select ) && !(a_ev->state & GDK_CONTROL_MASK) ) { /* start the paint job */ ths.m_painting = true; m_adding = true; /* adding, snapped x */ ths.m_current_x = ths.m_drop_x = snapped_x; ths.convert_xy( ths.m_drop_x, ths.m_drop_y, &tick_s, ¬e_h ); // test if a note is already there // fake select, if so, no add if ( ! ths.m_seq->select_note_events( tick_s, note_h, tick_s, note_h, sequence::e_would_select )) { /* add note, length = little less than snap */ ths.m_seq->push_undo(); ths.m_seq->add_note( tick_s, ths.m_note_length - 2, note_h, true ); needs_update = true; } } else /* selecting */ { // if the under the cursor is not a selected note... if ( !ths.m_seq->select_note_events( tick_s, note_h, tick_s, note_h, sequence::e_is_selected )) { // if clicking a note ... if (ths.m_seq->select_note_events( tick_s,note_h,tick_s,note_h, sequence::e_would_select ) ) { // ... unselect all if ctrl not held if (! (a_ev->state & GDK_CONTROL_MASK)) ths.m_seq->unselect(); } // if clicking empty space ... else { // ... unselect all if ctrl-shift not held if (! ((a_ev->state & GDK_CONTROL_MASK) && (a_ev->state & GDK_SHIFT_MASK)) ) ths.m_seq->unselect(); } /* on direct click select only one event */ numsel = ths.m_seq->select_note_events( tick_s,note_h,tick_s,note_h, sequence::e_select_one ); // prevent deselect in button_release() if (numsel) ths.m_justselected_one = true; // if nothing selected, start the selection box if (numsel == 0 && (a_ev->state & GDK_CONTROL_MASK)) ths.m_selecting = true; needs_update = true; } // if note under cursor is selected if ( ths.m_seq->select_note_events( tick_s, note_h, tick_s, note_h, sequence::e_is_selected )) { // context sensitive mouse //bool left_mouse_handle = false; bool right_mouse_handle = false; bool center_mouse_handle = false; { long drop_tick; int drop_note; ths.convert_xy( ths.m_drop_x, ths.m_drop_y, &drop_tick, &drop_note ); long start, end, note; if (ths.m_seq->intersectNotes( drop_tick, drop_note, start, end, note ) && note == drop_note) { long handle_size = clamp( c_handlesize, 0, (end-start)/3 ); // 16 wide unless very small... if (start <= drop_tick && drop_tick <= start + handle_size) { //left_mouse_handle = true; // not supported yet center_mouse_handle = true; } else if (end - handle_size <= drop_tick && drop_tick <= end) { right_mouse_handle = true; } else { center_mouse_handle = true; } } } // grab/move the note if ( center_mouse_handle && a_ev->button == 1 && !(a_ev->state & GDK_CONTROL_MASK) ) { ths.m_moving_init = true; needs_update = true; /* get the box that selected elements are in */ ths.m_seq->get_selected_box( &tick_s, ¬e_h, &tick_f, ¬e_l ); ths.convert_tn_box_to_rect( tick_s, tick_f, note_h, note_l, &ths.m_selected.x, &ths.m_selected.y, &ths.m_selected.width, &ths.m_selected.height ); /* save offset that we get from the snap above */ int adjusted_selected_x = ths.m_selected.x; ths.snap_x( &adjusted_selected_x ); ths.m_move_snap_offset_x = ( ths.m_selected.x - adjusted_selected_x); /* align selection for drawing */ ths.snap_x( &ths.m_selected.x ); ths.m_current_x = ths.m_drop_x = snapped_x; } // ctrl left click when stuff is already selected else if (a_ev->button == 1 && (a_ev->state & GDK_CONTROL_MASK) && ths.m_seq->select_note_events( tick_s, note_h, tick_s, note_h, sequence::e_is_selected )) { ths.m_is_drag_pasting_start = true; m_drag_paste_start_pos[0] = (long)a_ev->x; m_drag_paste_start_pos[1] = (long)a_ev->y; //printf( "start: %lf %lf\n", a_ev->x, a_ev->y ); } /* left click on the right handle - grow/resize event */ if ( (right_mouse_handle && a_ev->button == 1 && ! (a_ev->state & GDK_CONTROL_MASK)) || a_ev->button == 2 ){ ths.m_growing = true; /* get the box that selected elements are in */ ths.m_seq->get_selected_box( &tick_s, ¬e_h, &tick_f, ¬e_l ); ths.convert_tn_box_to_rect( tick_s, tick_f, note_h, note_l, &ths.m_selected.x, &ths.m_selected.y, &ths.m_selected.width, &ths.m_selected.height ); } } } } /* right click */ if ( a_ev->button == 3 ){ /* selection, normal x */ ths.m_current_x = ths.m_drop_x = norm_x; /* turn x,y in to tick/note */ ths.convert_xy( ths.m_drop_x, ths.m_drop_y, &tick_s, ¬e_h ); // erase event(s) under cursor if there is one if ( ths.m_seq->select_note_events( tick_s, note_h, tick_s, note_h, sequence::e_would_select) ) { /* right ctrl click: remove all selected notes */ if (a_ev->state & GDK_CONTROL_MASK) { ths.m_seq->select_note_events( tick_s, note_h, tick_s, note_h, sequence::e_select_one ); ths.m_seq->push_undo(); ths.m_seq->mark_selected(); ths.m_seq->remove_marked(); } /* right click: remove only the note under the cursor, leave the selection intact */ else { ths.m_seq->push_undo(); ths.m_seq->select_note_events( tick_s, note_h, tick_s, note_h, sequence::e_remove_one ); } // hold down the right button, drag mouse around erasing notes: m_erase_painting = true; // repaint... we've changed the notes. needs_update = true; } else /* selecting */ { if ( ! (a_ev->state & GDK_CONTROL_MASK) ) ths.m_seq->unselect(); // nothing selected, start the selection box ths.m_selecting = true; needs_update = true; } } } // context sensative mouse pointer... updateMousePtr( ths ); /* if they clicked, something changed */ if ( needs_update ){ ////printf( "needs update\n" ); ths.m_seq->set_dirty(); //redraw_events(); } return true; } bool FruitySeqRollInput::on_button_release_event(GdkEventButton* a_ev, seqroll& ths) { long tick_s; long tick_f; int note_h; int note_l; int x,y,w,h; bool needs_update = false; ths.m_current_x = (int) (a_ev->x + ths.m_scroll_offset_x ); ths.m_current_y = (int) (a_ev->y + ths.m_scroll_offset_y ); ths.snap_y( &ths.m_current_y ); if ( ths.m_moving || ths.m_is_drag_pasting ) ths.snap_x( &ths.m_current_x ); int delta_x = ths.m_current_x - ths.m_drop_x; int delta_y = ths.m_current_y - ths.m_drop_y; long delta_tick; int delta_note; // middle click, or ctrlleft click button up if ( a_ev->button == 1 || a_ev->button == 2 ){ if ( ths.m_growing ) { /* convert deltas into screen corridinates */ ths.convert_xy( delta_x, delta_y, &delta_tick, &delta_note ); ths.m_seq->push_undo(); if ( a_ev->state & GDK_SHIFT_MASK ) ths.m_seq->stretch_selected( delta_tick ); else ths.m_seq->grow_selected( delta_tick ); needs_update = true; } } long int current_tick; int current_note; ths.convert_xy( ths.m_current_x, ths.m_current_y, ¤t_tick, ¤t_note ); // ctrl-left click button up for select/drag copy/paste // left click button up for ending a move of selected notes if ( a_ev->button == 1 ){ m_adding = false; if ( ths.m_is_drag_pasting ) { ths.m_is_drag_pasting = false; ths.m_is_drag_pasting_start = false; /* convert deltas into screen corridinates */ ths.m_paste = false; ths.m_seq->push_undo(); ths.m_seq->paste_selected( current_tick, current_note ); needs_update = true; //m_seq->unselect(); } // ctrl-left click but without movement - select a note if (ths.m_is_drag_pasting_start) { ths.m_is_drag_pasting_start = false; // if ctrl-left click without movement and // if note under cursor is selected, and ctrl is held // and buttondown didn't just select one if (!ths.m_justselected_one && ths.m_seq->select_note_events( current_tick, current_note, current_tick, current_note, sequence::e_is_selected ) && (a_ev->state & GDK_CONTROL_MASK)) { // deselect the note ths.m_seq->select_note_events( current_tick, current_note, current_tick, current_note, sequence::e_deselect ); needs_update = true; } } ths.m_justselected_one = false; // clear flag on left button up if ( ths.m_moving ){ /* adjust for snap */ delta_x -= ths.m_move_snap_offset_x; /* convert deltas into screen corridinates */ ths.convert_xy( delta_x, delta_y, &delta_tick, &delta_note ); /* since delta_note was from delta_y, it will be filpped ( delta_y[0] = note[127], etc.,so we have to adjust */ delta_note = delta_note - (c_num_keys-1); ths.m_seq->push_undo(); ths.m_seq->move_selected_notes( delta_tick, delta_note ); needs_update = true; } } // right click or leftctrl click button up for selection box if ( a_ev->button == 3 || a_ev->button == 1 ){ if ( ths.m_selecting ) { ths.xy_to_rect ( ths.m_drop_x, ths.m_drop_y, ths.m_current_x, ths.m_current_y, &x, &y, &w, &h ); ths.convert_xy( x, y, &tick_s, ¬e_h ); ths.convert_xy( x+w, y+h, &tick_f, ¬e_l ); ths.m_seq->select_note_events( tick_s, note_h, tick_f, note_l, sequence::e_toggle_selection ); needs_update = true; } } if ( a_ev->button == 3 ) { m_erase_painting = false; } /* turn off */ ths.m_selecting = false; ths.m_moving = false; ths.m_growing = false; ths.m_paste = false; ths.m_moving_init = false; ths.m_painting = false; ths.m_seq->unpaint_all(); // context sensative mouse pointer... updateMousePtr( ths ); /* if they clicked, something changed */ if ( needs_update ){ ////printf( "needs_update2\n" ); ths.m_seq->set_dirty(); //redraw_events(); } return true; } bool FruitySeqRollInput::on_motion_notify_event(GdkEventMotion* a_ev, seqroll& ths) { ths.m_current_x = (int) (a_ev->x + ths.m_scroll_offset_x ); ths.m_current_y = (int) (a_ev->y + ths.m_scroll_offset_y ); int note; long tick; if ( ths.m_moving_init ){ ths.m_moving_init = false; ths.m_moving = true; } // context sensitive mouse pointer... updateMousePtr( ths ); // ctrl-left click drag on selected note(s) starts a copy/unselect/paste // don't begin the paste until mouse moves a few pixels, filter out the unsteady hand if ( ths.m_is_drag_pasting_start && (6 <= abs(m_drag_paste_start_pos[0] - (long)a_ev->x) || 6 <= abs(m_drag_paste_start_pos[1] - (long)a_ev->y)) ) { ths.m_seq->copy_selected(); ths.m_seq->unselect(); ths.start_paste(); ths.m_is_drag_pasting_start = false; ths.m_is_drag_pasting = true; } ths.snap_y( &ths.m_current_y ); ths.convert_xy( 0, ths.m_current_y, &tick, ¬e ); ths.m_seqkeys_wid->set_hint_key( note ); if ( ths.m_selecting || ths.m_moving || ths.m_growing || ths.m_paste ){ if ( ths.m_moving || ths.m_paste ){ ths.snap_x( &ths.m_current_x ); } ths.draw_selection_on_window(); return true; } if ( ths.m_painting ) { ths.snap_x( &ths.m_current_x ); ths.convert_xy( ths.m_current_x, ths.m_current_y, &tick, ¬e ); ths.m_seq->add_note( tick, ths.m_note_length - 2, note, true ); return true; } if (m_erase_painting) { ths.convert_xy( ths.m_current_x, ths.m_current_y, &tick, ¬e ); if ( ths.m_seq->select_note_events( tick, note, tick, note, sequence::e_would_select) ) { /* remove only the note under the cursor, leave the selection intact */ ths.m_seq->push_undo(); ths.m_seq->select_note_events( tick, note, tick, note, sequence::e_remove_one ); ths.m_seq->set_dirty(); } } return false; } /* popup menu calls this */ void Seq24SeqRollInput::set_adding( bool a_adding, seqroll& ths ) { if ( a_adding ){ ths.get_window()->set_cursor( Gdk::Cursor( Gdk::PENCIL )); m_adding = true; } else { ths.get_window()->set_cursor( Gdk::Cursor( Gdk::LEFT_PTR )); m_adding = false; } } bool Seq24SeqRollInput::on_button_press_event(GdkEventButton* a_ev, seqroll& ths) { int numsel; long tick_s; long tick_f; int note_h; int note_l; int norm_x, norm_y, snapped_x, snapped_y; ths.grab_focus( ); bool needs_update = false; snapped_x = norm_x = (int) (a_ev->x + ths.m_scroll_offset_x ); snapped_y = norm_y = (int) (a_ev->y + ths.m_scroll_offset_y ); ths.snap_x( &snapped_x ); ths.snap_y( &snapped_y ); /* y is always snapped */ ths.m_current_y = ths.m_drop_y = snapped_y; /* reset box that holds dirty redraw spot */ ths.m_old.x = 0; ths.m_old.y = 0; ths.m_old.width = 0; ths.m_old.height = 0; if ( ths.m_paste ){ ths.convert_xy( snapped_x, snapped_y, &tick_s, ¬e_h ); ths.m_paste = false; ths.m_seq->push_undo(); ths.m_seq->paste_selected( tick_s, note_h ); needs_update = true; } else { /* left mouse button */ if ( a_ev->button == 1 || a_ev->button == 2 ) { /* selection, normal x */ ths.m_current_x = ths.m_drop_x = norm_x; /* turn x,y in to tick/note */ ths.convert_xy( ths.m_drop_x, ths.m_drop_y, &tick_s, ¬e_h ); if ( m_adding ) { /* start the paint job */ ths.m_painting = true; /* adding, snapped x */ ths.m_current_x = ths.m_drop_x = snapped_x; ths.convert_xy( ths.m_drop_x, ths.m_drop_y, &tick_s, ¬e_h ); // test if a note is already there // fake select, if so, no add if ( ! ths.m_seq->select_note_events( tick_s, note_h, tick_s, note_h, sequence::e_would_select )) { /* add note, length = little less than snap */ ths.m_seq->push_undo(); ths.m_seq->add_note( tick_s, ths.m_note_length - 2, note_h, true ); needs_update = true; } } else /* selecting */ { if ( !ths.m_seq->select_note_events( tick_s, note_h, tick_s, note_h, sequence::e_is_selected )) { if ( ! (a_ev->state & GDK_CONTROL_MASK) ) { ths.m_seq->unselect(); } /* on direct click select only one event */ numsel = ths.m_seq->select_note_events( tick_s,note_h,tick_s,note_h, sequence::e_select_one ); /* none selected, start selection box */ if ( numsel == 0 ) { if ( a_ev->button == 1 ) ths.m_selecting = true; } else { needs_update = true; } } if ( ths.m_seq->select_note_events( tick_s, note_h, tick_s, note_h, sequence::e_is_selected )) { // moving - left click only if ( a_ev->button == 1 && !(a_ev->state & GDK_CONTROL_MASK) ) { ths.m_moving_init = true; needs_update = true; /* get the box that selected elements are in */ ths.m_seq->get_selected_box( &tick_s, ¬e_h, &tick_f, ¬e_l ); ths.convert_tn_box_to_rect( tick_s, tick_f, note_h, note_l, &ths.m_selected.x, &ths.m_selected.y, &ths.m_selected.width, &ths.m_selected.height ); /* save offset that we get from the snap above */ int adjusted_selected_x = ths.m_selected.x; ths.snap_x( &adjusted_selected_x ); ths.m_move_snap_offset_x = ( ths.m_selected.x - adjusted_selected_x); /* align selection for drawing */ ths.snap_x( &ths.m_selected.x ); ths.m_current_x = ths.m_drop_x = snapped_x; } /* middle mouse button, or left-ctrl click (for 2button mice) */ if ( a_ev->button == 2 || (a_ev->button == 1 && (a_ev->state & GDK_CONTROL_MASK)) ){ /* moving, normal x */ //m_current_x = m_drop_x = norm_x; //convert_xy( m_drop_x, m_drop_y, &tick_s, ¬e_h ); ths.m_growing = true; /* get the box that selected elements are in */ ths.m_seq->get_selected_box( &tick_s, ¬e_h, &tick_f, ¬e_l ); ths.convert_tn_box_to_rect( tick_s, tick_f, note_h, note_l, &ths.m_selected.x, &ths.m_selected.y, &ths.m_selected.width, &ths.m_selected.height ); } } } } /* right mouse button */ if ( a_ev->button == 3 ){ set_adding( true, ths ); } } /* if they clicked, something changed */ if ( needs_update ){ ////printf( "needs update\n" ); ths.m_seq->set_dirty(); //redraw_events(); } return true; } bool Seq24SeqRollInput::on_button_release_event(GdkEventButton* a_ev, seqroll& ths) { long tick_s; long tick_f; int note_h; int note_l; int x,y,w,h; bool needs_update = false; ths.m_current_x = (int) (a_ev->x + ths.m_scroll_offset_x ); ths.m_current_y = (int) (a_ev->y + ths.m_scroll_offset_y ); ths.snap_y ( &ths.m_current_y ); if ( ths.m_moving ) ths.snap_x( &ths.m_current_x ); int delta_x = ths.m_current_x - ths.m_drop_x; int delta_y = ths.m_current_y - ths.m_drop_y; long delta_tick; int delta_note; if ( a_ev->button == 1 ){ if ( ths.m_selecting ){ ths.xy_to_rect ( ths.m_drop_x, ths.m_drop_y, ths.m_current_x, ths.m_current_y, &x, &y, &w, &h ); ths.convert_xy( x, y, &tick_s, ¬e_h ); ths.convert_xy( x+w, y+h, &tick_f, ¬e_l ); ths.m_seq->select_note_events( tick_s, note_h, tick_f, note_l, sequence::e_select ); needs_update = true; } if ( ths.m_moving ){ /* adjust for snap */ delta_x -= ths.m_move_snap_offset_x; /* convert deltas into screen corridinates */ ths.convert_xy( delta_x, delta_y, &delta_tick, &delta_note ); /* since delta_note was from delta_y, it will be filpped ( delta_y[0] = note[127], etc.,so we have to adjust */ delta_note = delta_note - (c_num_keys-1); ths.m_seq->push_undo(); ths.m_seq->move_selected_notes( delta_tick, delta_note ); needs_update = true; } } if ( a_ev->button == 2 || a_ev->button == 1 ){ if ( ths.m_growing ){ /* convert deltas into screen corridinates */ ths.convert_xy( delta_x, delta_y, &delta_tick, &delta_note ); ths.m_seq->push_undo(); if ( a_ev->state & GDK_SHIFT_MASK ) { ths.m_seq->stretch_selected( delta_tick ); } else { ths.m_seq->grow_selected( delta_tick ); } needs_update = true; } } if ( a_ev->button == 3 ){ set_adding( false, ths ); } /* turn off */ ths.m_selecting = false; ths.m_moving = false; ths.m_growing = false; ths.m_paste = false; ths.m_moving_init = false; ths.m_painting = false; ths.m_seq->unpaint_all(); /* if they clicked, something changed */ if ( needs_update ){ ////printf( "needs_update2\n" ); ths.m_seq->set_dirty(); //redraw_events(); } return true; } bool Seq24SeqRollInput::on_motion_notify_event(GdkEventMotion* a_ev, seqroll& ths) { ths.m_current_x = (int) (a_ev->x + ths.m_scroll_offset_x ); ths.m_current_y = (int) (a_ev->y + ths.m_scroll_offset_y ); int note; long tick; if ( ths.m_moving_init ){ ths.m_moving_init = false; ths.m_moving = true; } ths.snap_y( &ths.m_current_y ); ths.convert_xy( 0, ths.m_current_y, &tick, ¬e ); ths.m_seqkeys_wid->set_hint_key( note ); if ( ths.m_selecting || ths.m_moving || ths.m_growing || ths.m_paste ){ if ( ths.m_moving || ths.m_paste ){ ths.snap_x( &ths.m_current_x ); } ths.draw_selection_on_window(); return true; } if ( ths.m_painting ) { ths.snap_x( &ths.m_current_x ); ths.convert_xy( ths.m_current_x, ths.m_current_y, &tick, ¬e ); ths.m_seq->add_note( tick, ths.m_note_length - 2, note, true ); return true; } return false; } seq24-0.9.3/src/configfile.h0000644000175000017500000000270012651156360012453 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #pragma once #include "perform.h" #include #include #include class configfile { protected: int m_pos; Glib::ustring m_name; /* holds our data */ unsigned char *m_d; list m_l; char m_line[1024]; bool m_done; void next_data_line( ifstream *a_file); void line_after( ifstream *a_file, string a_tag); public: configfile(const Glib::ustring& a_name); virtual ~configfile(); virtual bool parse( perform *a_perf ) = 0; virtual bool write( perform *a_perf ) = 0; }; seq24-0.9.3/src/midibus.h0000644000175000017500000001326612651156360012013 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #pragma once /* forward declarations*/ class mastermidibus; class midibus; #ifdef __WIN32__ # include "configwin32.h" # include "midibus_portmidi.h" #else #include "config.h" #if HAVE_LIBASOUND # include # include #endif #include #include "event.h" #include "sequence.h" #include "mutex.h" #include "globals.h" const int c_midibus_output_size = 0x100000; const int c_midibus_input_size = 0x100000; const int c_midibus_sysex_chunk = 0x100; enum clock_e { e_clock_off, e_clock_pos, e_clock_mod }; class midibus { private: int m_id; clock_e m_clock_type; bool m_inputing; static int m_clock_mod; /* sequencer client handle */ #if HAVE_LIBASOUND snd_seq_t * const m_seq; /* address of client */ const int m_dest_addr_client; const int m_dest_addr_port; const int m_local_addr_client; int m_local_addr_port; #endif /* id of queue */ int m_queue; /* name of bus */ string m_name; /* last tick */ long m_lasttick; /* locking */ mutex m_mutex; /* mutex */ void lock(); void unlock(); public: #if HAVE_LIBASOUND /* constructor, client#, port#, sequencer, name of client, name of port */ midibus( int a_localclient, int a_destclient, int a_destport, snd_seq_t *a_seq, const char *a_client_name, const char *a_port_name, int a_id, int a_queue ); midibus( int a_localclient, snd_seq_t *a_seq, int a_id, int a_queue ); #endif #ifdef __WIN32__ midibus( char a_id, int a_queue ); #endif ~midibus(); bool init_out( ); bool init_in( ); bool deinit_in( ); bool init_out_sub( ); bool init_in_sub( ); void print(); string get_name(); int get_id(); /* puts an event in the queue */ void play( event *a_e24, unsigned char a_channel ); void sysex( event *a_e24 ); /* clock */ void start(); void stop(); void clock( long a_tick ); void continue_from( long a_tick ); void init_clock( long a_tick ); void set_clock( clock_e a_clocking ); clock_e get_clock( ); void set_input( bool a_inputing ); bool get_input( ); void flush(); //void remove_queued_on_events( int a_tag ); /* master midi bus sets up the bus */ friend class mastermidibus; /* address of client */ #if HAVE_LIBASOUND int get_client(void) { return m_dest_addr_client; }; int get_port(void) { return m_dest_addr_port; }; #endif static void set_clock_mod( int a_clock_mod ); static int get_clock_mod(); }; class mastermidibus { private: /* sequencer client handle */ #if HAVE_LIBASOUND snd_seq_t *m_alsa_seq; #endif int m_num_out_buses; int m_num_in_buses; midibus *m_buses_out[c_maxBuses]; midibus *m_buses_in[c_maxBuses]; midibus *m_bus_announce; bool m_buses_out_active[c_maxBuses]; bool m_buses_in_active[c_maxBuses]; bool m_buses_out_init[c_maxBuses]; bool m_buses_in_init[c_maxBuses]; clock_e m_init_clock[c_maxBuses]; bool m_init_input[c_maxBuses]; /* id of queue */ int m_queue; int m_ppqn; int m_bpm; int m_num_poll_descriptors; struct pollfd *m_poll_descriptors; /* for dumping midi input to sequence for recording */ bool m_dumping_input; sequence *m_seq; /* locking */ mutex m_mutex; /* mutex */ void lock(); void unlock(); public: mastermidibus(); ~mastermidibus(); //midibus *get_default_bus(); //midibus *get_bus( int a_bus ); void init(); #if HAVE_LIBASOUND snd_seq_t* get_alsa_seq( ) { return m_alsa_seq; }; #endif int get_num_out_buses(); int get_num_in_buses(); void set_bpm(int a_bpm); void set_ppqn(int a_ppqn); int get_bpm(){ return m_bpm;} int get_ppqn(){ return m_ppqn;} string get_midi_out_bus_name( int a_bus ); string get_midi_in_bus_name( int a_bus ); void print(); void flush(); void start(); void stop(); void clock( long a_tick ); void continue_from( long a_tick ); void init_clock( long a_tick ); int poll_for_midi( ); bool is_more_input( ); bool get_midi_event( event *a_in ); void set_sequence_input( bool a_state, sequence *a_seq ); bool is_dumping( ) { return m_dumping_input; } sequence* get_sequence( ) { return m_seq; } void sysex( event *a_event ); void port_start( int a_client, int a_port ); void port_exit( int a_client, int a_port ); void play( unsigned char a_bus, event *a_e24, unsigned char a_channel ); void set_clock( unsigned char a_bus, clock_e a_clock_type ); clock_e get_clock( unsigned char a_bus ); void set_input( unsigned char a_bus, bool a_inputing ); bool get_input( unsigned char a_bus ); }; #endif seq24-0.9.3/src/event.cpp0000644000175000017500000001262112651200767012026 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #include "event.h" #include "string.h" event::event() : m_timestamp(0), m_status(EVENT_NOTE_OFF), m_linked(NULL), m_has_link(false), m_selected(false), m_marked(false), m_painted(false) { m_data[0] = 0; m_data[1] = 0; } long event::get_timestamp() { return m_timestamp; } void event::set_timestamp( const unsigned long a_time ) { m_timestamp = a_time; } void event::mod_timestamp( unsigned long a_mod ) { m_timestamp %= a_mod; } void event::set_status( const char a_status ) { /* bitwise AND to clear the channel portion of the status */ if ( (unsigned char) a_status >= 0xF0 ) m_status = (char) a_status; else m_status = (char) (a_status & EVENT_CLEAR_CHAN_MASK); } void event::make_clock( ) { m_status = (unsigned char) EVENT_MIDI_CLOCK; } void event::set_data( char a_D1 ) { m_data[0] = a_D1 & 0x7F; } void event::set_data( char a_D1, char a_D2 ) { m_data[0] = a_D1 & 0x7F; m_data[1] = a_D2 & 0x7F; } void event::increment_data2() { m_data[1] = (m_data[1]+1) & 0x7F; } void event::decrement_data2() { m_data[1] = (m_data[1]-1) & 0x7F; } void event::increment_data1() { m_data[0] = (m_data[0]+1) & 0x7F; } void event::decrement_data1() { m_data[0] = (m_data[0]-1) & 0x7F; } void event::get_data( unsigned char *D0, unsigned char *D1 ) { *D0 = m_data[0]; *D1 = m_data[1]; } unsigned char event::get_status( ) { return m_status; } void event::start_sysex() { m_sysex.clear(); } bool event::append_sysex( unsigned char *a_data, long a_size ) { bool ret = true; for ( int i=0; i( const event &a_rhsevent ) { if ( m_timestamp == a_rhsevent.m_timestamp ) { return (get_rank() > a_rhsevent.get_rank()); } else { return (m_timestamp > a_rhsevent.m_timestamp); } } bool event::operator<( const event &a_rhsevent ) { if ( m_timestamp == a_rhsevent.m_timestamp ) { return (get_rank() < a_rhsevent.get_rank()); } else { return (m_timestamp < a_rhsevent.m_timestamp); } } bool event::operator<=( const unsigned long &a_rhslong ) { return (m_timestamp <= a_rhslong); } bool event::operator>( const unsigned long &a_rhslong ) { return (m_timestamp > a_rhslong); } void event::link( event *a_event ) { m_has_link = true; m_linked = a_event; } event* event::get_linked( ) { return m_linked; } bool event::is_linked( ) { return m_has_link; } void event::clear_link( ) { m_has_link = false; } void event::select( ) { m_selected = true; } void event::unselect( ) { m_selected = false; } bool event::is_selected( ) { return m_selected; } void event::paint( ) { m_painted = true; } void event::unpaint( ) { m_painted = false; } bool event::is_painted( ) { return m_painted; } void event::mark( ) { m_marked = true; } void event::unmark( ) { m_marked = false; } bool event::is_marked( ) { return m_marked; } seq24-0.9.3/src/optionsfile.cpp0000644000175000017500000004126112651156360013241 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #include #include #include #include "optionsfile.h" extern Glib::ustring last_used_dir; optionsfile::optionsfile(const Glib::ustring& a_name) : configfile( a_name ) { } bool optionsfile::parse( perform *a_perf ) { /* open binary file */ ifstream file ( m_name.c_str(), ios::in | ios::ate ); if( ! file.is_open() ) return false; /* run to start */ file.seekg( 0, ios::beg ); line_after( &file, "[midi-control]" ); unsigned int sequences = 0; sscanf( m_line, "%u", &sequences ); next_data_line( &file ); for (unsigned int i = 0; i < sequences; ++i) { int sequence = 0; sscanf(m_line, "%d [ %d %d %ld %ld %ld %ld ]" " [ %d %d %ld %ld %ld %ld ]" " [ %d %d %ld %ld %ld %ld ]", &sequence, &a_perf->get_midi_control_toggle(i)->m_active, &a_perf->get_midi_control_toggle(i)->m_inverse_active, &a_perf->get_midi_control_toggle(i)->m_status, &a_perf->get_midi_control_toggle(i)->m_data, &a_perf->get_midi_control_toggle(i)->m_min_value, &a_perf->get_midi_control_toggle(i)->m_max_value, &a_perf->get_midi_control_on(i)->m_active, &a_perf->get_midi_control_on(i)->m_inverse_active, &a_perf->get_midi_control_on(i)->m_status, &a_perf->get_midi_control_on(i)->m_data, &a_perf->get_midi_control_on(i)->m_min_value, &a_perf->get_midi_control_on(i)->m_max_value, &a_perf->get_midi_control_off(i)->m_active, &a_perf->get_midi_control_off(i)->m_inverse_active, &a_perf->get_midi_control_off(i)->m_status, &a_perf->get_midi_control_off(i)->m_data, &a_perf->get_midi_control_off(i)->m_min_value, &a_perf->get_midi_control_off(i)->m_max_value); next_data_line(&file); } /* group midi control */ line_after( &file, "[mute-group]"); int gtrack = 0; sscanf( m_line, "%d", >rack ); next_data_line( &file ); int mtx[c_seqs_in_set], j=0; for (int i=0; i< c_seqs_in_set; i++) { a_perf->select_group_mute(j); sscanf(m_line, "%d [%d %d %d %d %d %d %d %d]" " [%d %d %d %d %d %d %d %d]" " [%d %d %d %d %d %d %d %d]" " [%d %d %d %d %d %d %d %d]", &j, &mtx[0], &mtx[1], &mtx[2], &mtx[3], &mtx[4], &mtx[5], &mtx[6], &mtx[7], &mtx[8], &mtx[9], &mtx[10], &mtx[11], &mtx[12], &mtx[13], &mtx[14], &mtx[15], &mtx[16], &mtx[17], &mtx[18], &mtx[19], &mtx[20], &mtx[21], &mtx[22], &mtx[23], &mtx[24], &mtx[25], &mtx[26], &mtx[27], &mtx[28], &mtx[29], &mtx[30], &mtx[31]); for (int k=0; k< c_seqs_in_set; k++) { a_perf->set_group_mute_state(k, mtx[k]); } j++; next_data_line( &file ); } line_after( &file, "[midi-clock]" ); long buses = 0; sscanf( m_line, "%ld", &buses ); next_data_line( &file ); for ( int i=0; iget_master_midi_bus( )->set_clock( bus, (clock_e) bus_on ); next_data_line( &file ); } line_after( &file, "[keyboard-control]" ); long keys = 0; sscanf( m_line, "%ld", &keys ); next_data_line( &file ); a_perf->key_events.clear(); for ( int i=0; iset_key_event( key, seq ); next_data_line( &file ); } line_after( &file, "[keyboard-group]" ); long groups = 0; sscanf( m_line, "%ld", &groups ); next_data_line( &file ); a_perf->key_groups.clear(); for ( int i=0; iset_key_group( key, group ); next_data_line( &file ); } sscanf( m_line, "%u %u", &a_perf->m_key_bpm_up, &a_perf->m_key_bpm_dn ); next_data_line( &file ); sscanf( m_line, "%u %u %u", &a_perf->m_key_screenset_up, &a_perf->m_key_screenset_dn, &a_perf->m_key_set_playing_screenset); next_data_line( &file ); sscanf( m_line, "%u %u %u", &a_perf->m_key_group_on, &a_perf->m_key_group_off, &a_perf->m_key_group_learn); next_data_line( &file ); sscanf( m_line, "%u %u %u %u %u", &a_perf->m_key_replace, &a_perf->m_key_queue, &a_perf->m_key_snapshot_1, &a_perf->m_key_snapshot_2, &a_perf->m_key_keep_queue); next_data_line( &file ); int show_key = 0; sscanf(m_line, "%d", &show_key); a_perf->m_show_ui_sequence_key = (bool) show_key; next_data_line( &file ); sscanf( m_line, "%u", &a_perf->m_key_start ); next_data_line( &file ); sscanf( m_line, "%u", &a_perf->m_key_stop ); line_after( &file, "[jack-transport]" ); long flag = 0; sscanf( m_line, "%ld", &flag ); global_with_jack_transport = (bool) flag; next_data_line( &file ); sscanf( m_line, "%ld", &flag ); global_with_jack_master = (bool) flag; next_data_line( &file ); sscanf( m_line, "%ld", &flag ); global_with_jack_master_cond = (bool) flag; next_data_line( &file ); sscanf( m_line, "%ld", &flag ); global_jack_start_mode = (bool) flag; line_after( &file, "[midi-input]" ); buses = 0; sscanf( m_line, "%ld", &buses ); next_data_line( &file ); for ( int i=0; iget_master_midi_bus( )->set_input( bus, (bool) bus_on ); next_data_line( &file ); } /* midi clock mod */ long ticks = 64; line_after( &file, "[midi-clock-mod-ticks]" ); sscanf( m_line, "%ld", &ticks ); midibus::set_clock_mod(ticks); /* manual alsa ports */ line_after( &file, "[manual-alsa-ports]" ); sscanf( m_line, "%ld", &flag ); global_manual_alsa_ports = (bool) flag; /* last used dir */ line_after( &file, "[last-used-dir]" ); //FIXME: check for a valid path is missing if (m_line[0] == '/') last_used_dir.assign(m_line); /* interaction method */ long method = 0; line_after( &file, "[interaction-method]" ); sscanf( m_line, "%ld", &method ); global_interactionmethod = (interaction_method_e)method; file.close(); return true; } bool optionsfile::write( perform *a_perf ) { /* open binary file */ ofstream file ( m_name.c_str(), ios::out | ios::trunc ); char outs[1024]; if( ! file.is_open() ) return false; /* midi control */ file << "#\n"; file << "# Seq 24 Init File\n"; file << "#\n\n\n"; file << "[midi-control]\n"; file << c_midi_controls << "\n"; for (int i=0; i< c_midi_controls; i++ ){ switch( i ){ /* 32 mute for channel 32 group mute */ case c_seqs_in_set : file << "# mute in group\n"; break; case c_midi_control_bpm_up : file << "# bpm up\n"; break; case c_midi_control_bpm_dn : file << "# bpm down\n"; break; case c_midi_control_ss_up : file << "# screen set up\n"; break; case c_midi_control_ss_dn : file << "# screen set down\n"; break; case c_midi_control_mod_replace : file << "# mod replace\n"; break; case c_midi_control_mod_snapshot : file << "# mod snapshot\n"; break; case c_midi_control_mod_queue : file << "# mod queue\n"; break; case c_midi_control_mod_gmute : file << "# mod gmute\n"; break; case c_midi_control_mod_glearn : file << "# mod glearn\n"; break; case c_midi_control_play_ss : file << "# screen set play\n"; break; default: break; } snprintf( outs, sizeof(outs), "%d [%1d %1d %3ld %3ld %3ld %3ld]" " [%1d %1d %3ld %3ld %3ld %3ld]" " [%1d %1d %3ld %3ld %3ld %3ld]", i, a_perf->get_midi_control_toggle(i)->m_active, a_perf->get_midi_control_toggle(i)->m_inverse_active, a_perf->get_midi_control_toggle(i)->m_status, a_perf->get_midi_control_toggle(i)->m_data, a_perf->get_midi_control_toggle(i)->m_min_value, a_perf->get_midi_control_toggle(i)->m_max_value, a_perf->get_midi_control_on(i)->m_active, a_perf->get_midi_control_on(i)->m_inverse_active, a_perf->get_midi_control_on(i)->m_status, a_perf->get_midi_control_on(i)->m_data, a_perf->get_midi_control_on(i)->m_min_value, a_perf->get_midi_control_on(i)->m_max_value, a_perf->get_midi_control_off(i)->m_active, a_perf->get_midi_control_off(i)->m_inverse_active, a_perf->get_midi_control_off(i)->m_status, a_perf->get_midi_control_off(i)->m_data, a_perf->get_midi_control_off(i)->m_min_value, a_perf->get_midi_control_off(i)->m_max_value ); file << string(outs) << "\n"; } /* group midi control */ file << "\n\n\n[mute-group]\n"; int mtx[c_seqs_in_set]; file << c_gmute_tracks << "\n"; for (int j=0; j < c_seqs_in_set; j++ ){ a_perf->select_group_mute(j); for (int i=0; i < c_seqs_in_set; i++) { mtx[i] = a_perf->get_group_mute_state(i); } snprintf(outs, sizeof(outs), "%d [%1d %1d %1d %1d %1d %1d %1d %1d]" " [%1d %1d %1d %1d %1d %1d %1d %1d]" " [%1d %1d %1d %1d %1d %1d %1d %1d]" " [%1d %1d %1d %1d %1d %1d %1d %1d]", j, mtx[0], mtx[1], mtx[2], mtx[3], mtx[4], mtx[5], mtx[6], mtx[7], mtx[8], mtx[9], mtx[10], mtx[11], mtx[12], mtx[13], mtx[14], mtx[15], mtx[16], mtx[17], mtx[18], mtx[19], mtx[20], mtx[21], mtx[22], mtx[23], mtx[24], mtx[25], mtx[26], mtx[27], mtx[28], mtx[29], mtx[30], mtx[31]); file << string(outs) << "\n"; } /* bus mute/unmute data */ int buses = a_perf->get_master_midi_bus( )->get_num_out_buses(); file << "\n\n\n[midi-clock]\n"; file << buses << "\n"; for (int i=0; i< buses; i++ ){ file << "# " << a_perf->get_master_midi_bus( )->get_midi_out_bus_name(i) << "\n"; snprintf(outs, sizeof(outs), "%d %d", i, (char) a_perf->get_master_midi_bus( )->get_clock(i)); file << outs << "\n"; } /* midi clock mod */ file << "\n\n[midi-clock-mod-ticks]\n"; file << midibus::get_clock_mod() << "\n"; /* bus input data */ buses = a_perf->get_master_midi_bus( )->get_num_in_buses(); file << "\n\n\n[midi-input]\n"; file << buses << "\n"; for (int i=0; i< buses; i++ ){ file << "# " << a_perf->get_master_midi_bus( )->get_midi_in_bus_name(i) << "\n"; snprintf(outs, sizeof(outs), "%d %d", i, (char) a_perf->get_master_midi_bus( )->get_input(i)); file << outs << "\n"; } /* manual alsa ports */ file << "\n\n\n[manual-alsa-ports]\n"; file << "# set to 1 if you want seq24 to create its own alsa ports and\n"; file << "# not connect to other clients\n"; file << global_manual_alsa_ports << "\n"; /* interaction-method */ int x = 0; file << "\n\n\n[interaction-method]\n"; while (c_interaction_method_names[x] && c_interaction_method_descs[x]) { file << "# " << x << " - '" << c_interaction_method_names[x] << "' (" << c_interaction_method_descs[x] << ")\n"; ++x; } file << global_interactionmethod << "\n"; file << "\n\n\n[keyboard-control]\n"; file << "# Key #, Sequence # \n"; file << (a_perf->key_events.size() < (size_t)c_seqs_in_set ? a_perf->key_events.size() : (size_t)c_seqs_in_set) << "\n"; for( std::map::const_iterator i = a_perf->key_events.begin(); i != a_perf->key_events.end(); ++i ){ snprintf(outs, sizeof(outs), "%u %ld # %s", i->first, i->second, gdk_keyval_name( i->first ) ); file << string(outs) << "\n"; } file << "\n\n\n[keyboard-group]\n"; file << "# Key #, group # \n"; file << (a_perf->key_groups.size() < (size_t)c_seqs_in_set ? a_perf->key_groups.size() : (size_t)c_seqs_in_set) << "\n"; for( std::map::const_iterator i = a_perf->key_groups.begin(); i != a_perf->key_groups.end(); ++i ){ snprintf(outs, sizeof(outs), "%u %ld # %s", i->first, i->second, gdk_keyval_name(i->first)); file << string(outs) << "\n"; } file << "# bpm up, down\n" << a_perf->m_key_bpm_up << " " << a_perf->m_key_bpm_dn << " # " << gdk_keyval_name( a_perf->m_key_bpm_up ) << " " << gdk_keyval_name( a_perf->m_key_bpm_dn ) << "\n"; file << "# screen set up, down, play\n" << a_perf->m_key_screenset_up << " " << a_perf->m_key_screenset_dn << " " << a_perf->m_key_set_playing_screenset << " # " << gdk_keyval_name( a_perf->m_key_screenset_up ) << " " << gdk_keyval_name( a_perf->m_key_screenset_dn ) << " " << gdk_keyval_name( a_perf->m_key_set_playing_screenset ) << "\n"; file << "# group on, off, learn\n" << a_perf->m_key_group_on << " " << a_perf->m_key_group_off << " " << a_perf->m_key_group_learn << " # " << gdk_keyval_name( a_perf->m_key_group_on ) << " " << gdk_keyval_name( a_perf->m_key_group_off ) << " " << gdk_keyval_name( a_perf->m_key_group_learn ) << "\n"; file << "# replace, queue, snapshot_1, snapshot 2, keep queue\n" << a_perf->m_key_replace << " " << a_perf->m_key_queue << " " << a_perf->m_key_snapshot_1 << " " << a_perf->m_key_snapshot_2 << " " << a_perf->m_key_keep_queue << " # " << gdk_keyval_name( a_perf->m_key_replace ) << " " << gdk_keyval_name( a_perf->m_key_queue ) << " " << gdk_keyval_name( a_perf->m_key_snapshot_1 ) << " " << gdk_keyval_name( a_perf->m_key_snapshot_2 ) << " " << gdk_keyval_name( a_perf->m_key_keep_queue ) << "\n"; file << a_perf->m_show_ui_sequence_key << " # show_ui_sequence_key (1=true/0=false)\n"; file << a_perf->m_key_start << " # " << gdk_keyval_name( a_perf->m_key_start ) << " start sequencer\n"; file << a_perf->m_key_stop << " # " << gdk_keyval_name( a_perf->m_key_stop ) << " stop sequencer\n"; file << "\n\n\n[jack-transport]\n\n" << "# jack_transport - Enable sync with JACK Transport.\n" << global_with_jack_transport << "\n\n" << "# jack_master - Seq24 will attempt to serve as JACK Master.\n" << global_with_jack_master << "\n\n" << "# jack_master_cond - Seq24 will fail to be master if there is already a master set.\n" << global_with_jack_master_cond << "\n\n" << "# jack_start_mode\n" << "# 0 = Playback will be in live mode. Use this to allow muting and unmuting of loops.\n" << "# 1 = Playback will use the song editors data.\n" << global_jack_start_mode << "\n\n"; file << "\n\n\n[last-used-dir]\n\n" << "# Last used directory.\n" << last_used_dir << "\n\n"; file.close(); return true; } seq24-0.9.3/src/seqdata.h0000644000175000017500000000631412651156360011775 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #pragma once #include "sequence.h" #include "seqkeys.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include "globals.h" /* piano event */ class seqdata : public Gtk::DrawingArea { private: Glib::RefPtr m_gc; Glib::RefPtr m_window; Gdk::Color m_black, m_white, m_grey; Glib::RefPtr m_pixmap; Glib::RefPtr m_numbers[c_dataarea_y]; sequence * const m_seq; /* one pixel == m_zoom ticks */ int m_zoom; int m_window_x, m_window_y; int m_drop_x, m_drop_y; int m_current_x, m_current_y; Gtk::Adjustment * const m_hadjust; int m_scroll_offset_ticks; int m_scroll_offset_x; int m_background_tile_x; int m_background_tile_y; /* what is the data window currently editing ? */ unsigned char m_status; unsigned char m_cc; GdkRectangle m_old; bool m_dragging; void on_realize(); bool on_expose_event(GdkEventExpose* a_ev); bool on_button_press_event(GdkEventButton* a_ev); bool on_button_release_event(GdkEventButton* a_ev); bool on_motion_notify_event(GdkEventMotion* a_p0); bool on_leave_notify_event(GdkEventCrossing* p0); bool on_scroll_event( GdkEventScroll* a_ev ) ; void update_sizes(); void draw_events_on_pixmap(); void draw_pixmap_on_window(); void update_pixmap(); void draw_line_on_window(); void convert_x( int a_x, long *a_tick ); void xy_to_rect( int a_x1, int a_y1, int a_x2, int a_y2, int *a_x, int *a_y, int *a_w, int *a_h ); void draw_events_on( Glib::RefPtr a_draw ); void on_size_allocate(Gtk::Allocation& ); void change_horz(); void force_draw(); public: seqdata( sequence *a_seq, int a_zoom, Gtk::Adjustment *a_hadjust ); void reset(); void redraw(); void set_zoom( int a_zoom ); void set_data_type( unsigned char a_status, unsigned char a_control ); int idle_redraw(); friend class seqroll; friend class seqevent; }; seq24-0.9.3/src/perform.cpp0000644000175000017500000017311012651156360012357 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #include "perform.h" #include "midibus.h" #include "event.h" #include #ifndef __WIN32__ # include #endif #include //For keys #include using namespace Gtk; perform::perform() { for (int i=0; i< c_max_sequence; i++) { m_seqs[i] = NULL; m_seqs_active[i] = false; m_was_active_main[i] = false; m_was_active_edit[i] = false; m_was_active_perf[i] = false; m_was_active_names[i] = false; } m_mute_group_selected = 0; m_mode_group = true; m_mode_group_learn = false; m_running = false; m_looping = false; m_inputing = true; m_outputing = true; m_tick = 0; m_midiclockrunning = false; m_usemidiclock = false; m_midiclocktick = 0; m_midiclockpos = -1; thread_trigger_width_ms = c_thread_trigger_width_ms; m_left_tick = 0; m_right_tick = c_ppqn * 16; m_starting_tick = 0; midi_control zero = {false,false,0,0,0}; for ( int i=0; i c_seqs_in_set) a_g_track = c_seqs_in_set -1; m_mute_group[a_g_track + m_mute_group_selected * c_seqs_in_set] = a_mute_state; } bool perform::get_group_mute_state (int a_g_track) { if (a_g_track < 0) a_g_track = 0; if (a_g_track > c_seqs_in_set) a_g_track = c_seqs_in_set -1; return m_mute_group[a_g_track + m_mute_group_selected * c_seqs_in_set]; } void perform::select_group_mute (int a_g_mute) { int j = (a_g_mute * c_seqs_in_set); int k = m_playing_screen * c_seqs_in_set; if (a_g_mute < 0) a_g_mute = 0; if (a_g_mute > c_seqs_in_set) a_g_mute = c_seqs_in_set -1; if (m_mode_group_learn) for (int i = 0; i < c_seqs_in_set; i++) { if (is_active(i + k)) { assert(m_seqs[i + k]); m_mute_group[i + j] = m_seqs[i + k]->get_playing(); } } m_mute_group_selected = a_g_mute; } void perform::set_mode_group_learn () { set_mode_group_mute(); m_mode_group_learn = true; for (size_t x = 0; x < m_notify.size(); ++x) m_notify[x]->on_grouplearnchange( true ); } void perform::unset_mode_group_learn () { for (size_t x = 0; x < m_notify.size(); ++x) m_notify[x]->on_grouplearnchange( false ); m_mode_group_learn = false; } void perform::select_mute_group ( int a_group ) { int j = (a_group * c_seqs_in_set); int k = m_playing_screen * c_seqs_in_set; if (a_group < 0) a_group = 0; if (a_group > c_seqs_in_set) a_group = c_seqs_in_set -1; m_mute_group_selected = a_group; for (int i = 0; i < c_seqs_in_set; i++) { if ((m_mode_group_learn) && (is_active(i + k))) { assert(m_seqs[i + k]); m_mute_group[i + j] = m_seqs[i + k]->get_playing(); } m_tracks_mute_state[i] = m_mute_group[i + m_mute_group_selected * c_seqs_in_set]; } } void perform::mute_group_tracks () { if (m_mode_group) { for (int i=0; i< c_seqs_in_set; i++) { for (int j=0; j < c_seqs_in_set; j++) { if ( is_active(i * c_seqs_in_set + j) ) { if ((i == m_playing_screen) && (m_tracks_mute_state[j])) { sequence_playing_on (i * c_seqs_in_set + j); } else { sequence_playing_off (i * c_seqs_in_set + j); } } } } } } void perform::select_and_mute_group (int a_g_group) { select_mute_group(a_g_group); mute_group_tracks(); } void perform::mute_all_tracks() { for (int i=0; i< c_max_sequence; i++ ) { if ( is_active(i) ) m_seqs[i]->set_song_mute( true ); } } perform::~perform() { m_inputing = false; m_outputing = false; m_running = false; m_condition_var.signal(); if (m_out_thread_launched ) pthread_join( m_out_thread, NULL ); if (m_in_thread_launched ) pthread_join( m_in_thread, NULL ); for (int i=0; i< c_max_sequence; i++ ){ if ( is_active(i) ){ delete m_seqs[i]; } } } void perform::set_left_tick( long a_tick ) { m_left_tick = a_tick; m_starting_tick = a_tick; if ( m_left_tick >= m_right_tick ) m_right_tick = m_left_tick + c_ppqn * 4; } long perform::get_left_tick() { return m_left_tick; } void perform::set_starting_tick( long a_tick ) { m_starting_tick = a_tick; } long perform::get_starting_tick() { return m_starting_tick; } void perform::set_right_tick( long a_tick ) { if ( a_tick >= c_ppqn * 4 ){ m_right_tick = a_tick; if ( m_right_tick <= m_left_tick ){ m_left_tick = m_right_tick - c_ppqn * 4; m_starting_tick = m_left_tick; } } } long perform::get_right_tick() { return m_right_tick; } void perform::add_sequence( sequence *a_seq, int a_perf ) { /* check for perferred */ if ( a_perf < c_max_sequence && is_active(a_perf) == false && a_perf >= 0 ){ m_seqs[a_perf] = a_seq; set_active(a_perf, true); //a_seq->set_tag( a_perf ); } else { for (int i=a_perf; i< c_max_sequence; i++ ){ if ( is_active(i) == false ){ m_seqs[i] = a_seq; set_active(i,true); //a_seq->set_tag( i ); break; } } } } void perform::set_active( int a_sequence, bool a_active ) { if ( a_sequence < 0 || a_sequence >= c_max_sequence ) return; //printf ("set_active %d\n", a_active ); if ( m_seqs_active[ a_sequence ] == true && a_active == false ) { set_was_active(a_sequence); } m_seqs_active[ a_sequence ] = a_active; } void perform::set_was_active( int a_sequence ) { if ( a_sequence < 0 || a_sequence >= c_max_sequence ) return; //printf( "was_active true\n" ); m_was_active_main[ a_sequence ] = true; m_was_active_edit[ a_sequence ] = true; m_was_active_perf[ a_sequence ] = true; m_was_active_names[ a_sequence ] = true; } bool perform::is_active( int a_sequence ) { if ( a_sequence < 0 || a_sequence >= c_max_sequence ) return false; return m_seqs_active[ a_sequence ]; } bool perform::is_dirty_main (int a_sequence) { if ( a_sequence < 0 || a_sequence >= c_max_sequence ) return false; if ( is_active(a_sequence) ) { return m_seqs[a_sequence]->is_dirty_main(); } bool was_active = m_was_active_main[ a_sequence ]; m_was_active_main[ a_sequence ] = false; return was_active; } bool perform::is_dirty_edit (int a_sequence) { if ( a_sequence < 0 || a_sequence >= c_max_sequence ) return false; if ( is_active(a_sequence) ) { return m_seqs[a_sequence]->is_dirty_edit(); } bool was_active = m_was_active_edit[ a_sequence ]; m_was_active_edit[ a_sequence ] = false; return was_active; } bool perform::is_dirty_perf (int a_sequence) { if ( a_sequence < 0 || a_sequence >= c_max_sequence ) return false; if ( is_active(a_sequence) ) { return m_seqs[a_sequence]->is_dirty_perf(); } bool was_active = m_was_active_perf[ a_sequence ]; m_was_active_perf[ a_sequence ] = false; return was_active; } bool perform::is_dirty_names (int a_sequence) { if ( a_sequence < 0 || a_sequence >= c_max_sequence ) return false; if ( is_active(a_sequence) ) { return m_seqs[a_sequence]->is_dirty_names(); } bool was_active = m_was_active_names[ a_sequence ]; m_was_active_names[ a_sequence ] = false; return was_active; } sequence* perform::get_sequence( int a_sequence ) { return m_seqs[a_sequence]; } mastermidibus* perform::get_master_midi_bus( ) { return &m_master_bus; } void perform::set_running( bool a_running ) { m_running = a_running; } bool perform::is_running() { return m_running; } void perform::set_bpm(int a_bpm) { if ( a_bpm < 20 ) a_bpm = 20; if ( a_bpm > 500 ) a_bpm = 500; if ( ! (m_jack_running && m_running )){ m_master_bus.set_bpm( a_bpm ); } } int perform::get_bpm( ) { return m_master_bus.get_bpm( ); } void perform::delete_sequence( int a_num ) { set_active(a_num, false); if ( m_seqs[a_num] != NULL && !m_seqs[a_num]->get_editing() ){ m_seqs[a_num]->set_playing( false ); delete m_seqs[a_num]; } } bool perform::is_sequence_in_edit( int a_num ) { return ( m_seqs[a_num] != NULL && m_seqs[a_num]->get_editing()); } void perform::new_sequence( int a_sequence ) { m_seqs[ a_sequence ] = new sequence(); m_seqs[ a_sequence ]->set_master_midi_bus( &m_master_bus ); set_active(a_sequence, true); } midi_control * perform::get_midi_control_toggle( unsigned int a_seq ) { if ( a_seq >= (unsigned int) c_midi_controls ) return NULL; return &m_midi_cc_toggle[a_seq]; } midi_control * perform::get_midi_control_on( unsigned int a_seq ) { if ( a_seq >= (unsigned int) c_midi_controls ) return NULL; return &m_midi_cc_on[a_seq]; } midi_control* perform::get_midi_control_off( unsigned int a_seq ) { if ( a_seq >= (unsigned int) c_midi_controls ) return NULL; return &m_midi_cc_off[a_seq]; } void perform::print() { // for( int i=0; iprint(); // } // m_master_bus.print(); } void perform::set_screen_set_notepad( int a_screen_set, string *a_notepad ) { if ( a_screen_set < c_max_sets ) m_screen_set_notepad[a_screen_set] = *a_notepad; } string * perform::get_screen_set_notepad( int a_screen_set ) { return &m_screen_set_notepad[a_screen_set]; } void perform::set_screenset( int a_ss ) { m_screen_set = a_ss; if ( m_screen_set < 0 ) m_screen_set = c_max_sets - 1; if ( m_screen_set >= c_max_sets ) m_screen_set = 0; } int perform::get_screenset() { return m_screen_set; } void perform::set_playing_screenset () { for (int j, i = 0; i < c_seqs_in_set; i++) { j = i + m_playing_screen * c_seqs_in_set; if ( is_active(j) ){ assert( m_seqs[j] ); m_tracks_mute_state[i] = m_seqs[j]->get_playing(); } } m_playing_screen = m_screen_set; mute_group_tracks(); } int perform::get_playing_screenset () { return m_playing_screen; } void perform::set_offset( int a_offset ) { m_offset = a_offset * c_mainwnd_rows * c_mainwnd_cols; } void perform::play( long a_tick ) { /* just run down the list of sequences and have them dump */ //printf( "play [%d]\n", a_tick ); m_tick = a_tick; for (int i=0; i< c_max_sequence; i++ ){ if ( is_active(i) ){ assert( m_seqs[i] ); if ( m_seqs[i]->get_queued() && m_seqs[i]->get_queued_tick() <= a_tick ){ m_seqs[i]->play( m_seqs[i]->get_queued_tick() - 1, m_playback_mode ); m_seqs[i]->toggle_playing(); } m_seqs[i]->play( a_tick, m_playback_mode ); } } /* flush the bus */ m_master_bus.flush(); } void perform::set_orig_ticks( long a_tick ) { for (int i=0; i< c_max_sequence; i++ ){ if ( is_active(i) == true ){ assert( m_seqs[i] ); m_seqs[i]->set_orig_tick( a_tick ); } } } void perform::clear_sequence_triggers( int a_seq ) { if ( is_active(a_seq) == true ){ assert( m_seqs[a_seq] ); m_seqs[a_seq]->clear_triggers( ); } } void perform::move_triggers( bool a_direction ) { if ( m_left_tick < m_right_tick ){ long distance = m_right_tick - m_left_tick; for (int i=0; i< c_max_sequence; i++ ){ if ( is_active(i) == true ){ assert( m_seqs[i] ); m_seqs[i]->move_triggers( m_left_tick, distance, a_direction ); } } } } void perform::push_trigger_undo() { for (int i=0; i< c_max_sequence; i++ ){ if ( is_active(i) == true ){ assert( m_seqs[i] ); m_seqs[i]->push_trigger_undo( ); } } } void perform::pop_trigger_undo() { for (int i=0; i< c_max_sequence; i++ ){ if ( is_active(i) == true ){ assert( m_seqs[i] ); m_seqs[i]->pop_trigger_undo( ); } } } /* copies between L and R -> R */ void perform::copy_triggers( ) { if ( m_left_tick < m_right_tick ){ long distance = m_right_tick - m_left_tick; for (int i=0; i< c_max_sequence; i++ ){ if ( is_active(i) == true ){ assert( m_seqs[i] ); m_seqs[i]->copy_triggers( m_left_tick, distance ); } } } } void perform::start_jack( ) { //printf( "perform::start_jack()\n" ); #ifdef JACK_SUPPORT if ( m_jack_running) jack_transport_start (m_jack_client ); #endif } void perform::stop_jack( ) { //printf( "perform::stop_jack()\n" ); #ifdef JACK_SUPPORT if( m_jack_running ) jack_transport_stop (m_jack_client); #endif } void perform::position_jack( bool a_state ) { //printf( "perform::position_jack()\n" ); #ifdef JACK_SUPPORT if ( m_jack_running ){ jack_transport_locate( m_jack_client, 0 ); } return; jack_nframes_t rate = jack_get_sample_rate( m_jack_client ) ; long current_tick = 0; if ( a_state ){ current_tick = m_left_tick; } jack_position_t pos; pos.valid = JackPositionBBT; pos.beats_per_bar = 4; pos.beat_type = 4; pos.ticks_per_beat = c_ppqn * 10; pos.beats_per_minute = m_master_bus.get_bpm(); /* Compute BBT info from frame number. This is relatively * simple here, but would become complex if we supported tempo * or time signature changes at specific locations in the * transport timeline. */ current_tick *= 10; pos.bar = (int32_t) (current_tick / (long) pos.ticks_per_beat / pos.beats_per_bar); pos.beat = (int32_t) ((current_tick / (long) pos.ticks_per_beat) % 4); pos.tick = (int32_t) (current_tick % (c_ppqn * 10)); pos.bar_start_tick = pos.bar * pos.beats_per_bar * pos.ticks_per_beat; pos.frame_rate = rate; pos.frame = (jack_nframes_t) ( (current_tick * rate * 60.0) / (pos.ticks_per_beat * pos.beats_per_minute) ); /* ticks * 10 = jack ticks; jack ticks / ticks per beat = num beats; num beats / beats per minute = num minutes num minutes * 60 = num seconds num secords * frame_rate = frame */ pos.bar++; pos.beat++; //printf( "position bbb[%d:%d:%4d]\n", pos.bar, pos.beat, pos.tick ); jack_transport_reposition( m_jack_client, &pos ); #endif } void perform::start(bool a_state) { if (m_jack_running) { return; } inner_start(a_state); } void perform::stop() { if (m_jack_running) { return; } inner_stop(); } void perform::inner_start(bool a_state) { m_condition_var.lock(); if (!is_running()) { set_playback_mode( a_state ); if (a_state) off_sequences(); set_running(true); m_condition_var.signal(); } m_condition_var.unlock(); } void perform::inner_stop() { set_running(false); //off_sequences(); reset_sequences(); m_usemidiclock = false; } void perform::off_sequences() { for (int i = 0; i < c_max_sequence; i++) { if (is_active(i)) { assert(m_seqs[i]); m_seqs[i]->set_playing(false); } } } void perform::all_notes_off() { for (int i=0; i< c_max_sequence; i++) { if (is_active(i)) { assert(m_seqs[i]); m_seqs[i]->off_playing_notes(); } } /* flush the bus */ m_master_bus.flush(); } void perform::reset_sequences() { for (int i=0; i< c_max_sequence; i++) { if (is_active(i)) { assert( m_seqs[i] ); bool state = m_seqs[i]->get_playing(); m_seqs[i]->off_playing_notes(); m_seqs[i]->set_playing(false); m_seqs[i]->zero_markers(); if (!m_playback_mode) m_seqs[i]->set_playing(state); } } /* flush the bus */ m_master_bus.flush(); } void perform::launch_output_thread() { int err; err = pthread_create(&m_out_thread, NULL, output_thread_func, this); if (err != 0) { /*TODO: error handling*/ } else m_out_thread_launched= true; } void perform::set_playback_mode( bool a_playback_mode ) { m_playback_mode = a_playback_mode; } void perform::launch_input_thread() { int err; err = pthread_create(&m_in_thread, NULL, input_thread_func, this); if (err != 0) { /*TODO: error handling*/ } else m_in_thread_launched = true; } long perform::get_max_trigger() { long ret = 0, t; for (int i=0; i< c_max_sequence; i++ ){ if ( is_active(i) == true ){ assert( m_seqs[i] ); t = m_seqs[i]->get_max_trigger( ); if ( t > ret ) ret = t; } } return ret; } void* output_thread_func(void *a_pef ) { /* set our performance */ perform *p = (perform *) a_pef; assert(p); struct sched_param schp; /* * set the process to realtime privs */ if ( global_priority ){ memset(&schp, 0, sizeof(sched_param)); schp.sched_priority = 1; #ifndef __WIN32__ // Not in MinGW RCB if (sched_setscheduler(0, SCHED_FIFO, &schp) != 0) { printf("output_thread_func: couldnt sched_setscheduler" " (FIFO), you need to be root.\n"); pthread_exit(0); } #endif } #ifdef __WIN32__ timeBeginPeriod(1); #endif p->output_func(); #ifdef __WIN32__ timeEndPeriod(1); #endif return 0; } #ifdef JACK_SUPPORT int jack_process_callback(jack_nframes_t nframes, void* arg) {return 0;} int jack_sync_callback(jack_transport_state_t state, jack_position_t *pos, void *arg) { perform *p = (perform *) arg; p->m_jack_frame_current = jack_get_current_transport_frame(p->m_jack_client); p->m_jack_tick = p->m_jack_frame_current * p->m_jack_pos.ticks_per_beat * p->m_jack_pos.beats_per_minute / (p->m_jack_pos.frame_rate * 60.0); p->m_jack_frame_last = p->m_jack_frame_current; p->m_jack_transport_state_last = p->m_jack_transport_state = state; switch (state) { case JackTransportStopped: //printf( "[JackTransportStopped]\n" ); break; case JackTransportRolling: //printf( "[JackTransportRolling]\n" ); break; case JackTransportStarting: //printf( "[JackTransportStarting]\n" ); p->inner_start( global_jack_start_mode ); break; case JackTransportLooping: //printf( "[JackTransportLooping]" ); break; default: break; } //printf( "starting frame[%d] tick[%8.2f]\n", p->m_jack_frame_current, p->m_jack_tick ); print_jack_pos( pos ); return 1; } #ifdef JACK_SESSION bool perform::jack_session_event() { Glib::ustring fname( m_jsession_ev->session_dir ); fname += "file.mid"; Glib::ustring cmd( "seq24 \"${SESSION_DIR}file.mid\" --jack_session_uuid " ); cmd += m_jsession_ev->client_uuid; midifile f(fname); f.write(this); m_jsession_ev->command_line = strdup( cmd.c_str() ); jack_session_reply( m_jack_client, m_jsession_ev ); if( m_jsession_ev->type == JackSessionSaveAndQuit ) Gtk::Main::quit(); jack_session_event_free (m_jsession_ev); return false; } void jack_session_callback(jack_session_event_t *event, void *arg ) { perform *p = (perform *) arg; p->m_jsession_ev = event; Glib::signal_idle().connect( sigc::mem_fun( *p, &perform::jack_session_event) ); } #endif #endif void perform::output_func() { while (m_outputing) { //printf ("waiting for signal\n"); m_condition_var.lock(); while (!m_running) { m_condition_var.wait(); /* if stopping, then kill thread */ if (!m_outputing) break; } m_condition_var.unlock(); //printf( "signaled [%d]\n", m_playback_mode ); #ifndef __WIN32__ /* begning time */ struct timespec last; /* current time */ struct timespec current; struct timespec stats_loop_start; struct timespec stats_loop_finish; /* difference between last and current */ struct timespec delta; #else /* begning time */ long last; /* current time */ long current; long stats_loop_start = 0; long stats_loop_finish = 0; /* difference between last and current */ long delta; #endif /* tick and tick fraction */ double current_tick = 0.0; double total_tick = 0.0; long clock_tick = 0; long delta_tick_frac = 0; long stats_total_tick = 0; long stats_loop_index = 0; long stats_min = 0x7FFFFFFF; long stats_max = 0; long stats_avg = 0; long stats_last_clock_us = 0; long stats_clock_width_us = 0; long stats_all[100]; long stats_clock[100]; bool jack_stopped = false; bool dumping = false; bool init_clock = true; #ifdef JACK_SUPPORT double jack_ticks_converted = 0.0; double jack_ticks_converted_last = 0.0; double jack_ticks_delta = 0.0; #endif for( int i=0; i<100; i++ ){ stats_all[i] = 0; stats_clock[i] = 0; } /* if we are in the performance view, we care about starting from the offset */ if ( m_playback_mode && !m_jack_running){ current_tick = m_starting_tick; clock_tick = m_starting_tick; set_orig_ticks( m_starting_tick ); } int ppqn = m_master_bus.get_ppqn(); #ifndef __WIN32__ /* get start time position */ clock_gettime(CLOCK_REALTIME, &last); if ( global_stats ) stats_last_clock_us= (last.tv_sec * 1000000) + (last.tv_nsec / 1000); #else /* get start time position */ /* timeGetTime() returns a "DWORD" type (= unsigned long)*/ last = timeGetTime(); if ( global_stats ) stats_last_clock_us= last * 1000; #endif while( m_running ){ /************************************ Get delta time ( current - last ) Get delta ticks from time Add to current_ticks Compute prebuffer ticks play from current tick to prebuffer **************************************/ if ( global_stats ){ #ifndef __WIN32__ clock_gettime(CLOCK_REALTIME, &stats_loop_start); #else stats_loop_start = timeGetTime(); #endif } /* delta time */ #ifndef __WIN32__ clock_gettime(CLOCK_REALTIME, ¤t); delta.tv_sec = (current.tv_sec - last.tv_sec ); delta.tv_nsec = (current.tv_nsec - last.tv_nsec ); long delta_us = (delta.tv_sec * 1000000) + (delta.tv_nsec / 1000); #else current = timeGetTime(); //printf( "current [0x%x]\n", current ); delta = current - last; long delta_us = delta * 1000; //printf( " delta [0x%x]\n", delta ); #endif /* delta time to ticks */ /* bpm */ int bpm = m_master_bus.get_bpm(); /* get delta ticks, delta_ticks_f is in 1000th of a tick */ long long delta_tick_num = bpm * ppqn * delta_us + delta_tick_frac; long long delta_tick_denom = 60000000; long delta_tick = (long)(delta_tick_num / delta_tick_denom); delta_tick_frac = (long)(delta_tick_num % delta_tick_denom); if (m_usemidiclock) { delta_tick = m_midiclocktick; m_midiclocktick = 0; } if (0 <= m_midiclockpos) { delta_tick = 0; clock_tick = m_midiclockpos; current_tick = m_midiclockpos; total_tick = m_midiclockpos; m_midiclockpos = -1; //init_clock = true; } //printf ( " delta_tick[%lf]\n", delta_tick ); #ifdef JACK_SUPPORT // no init until we get a good lock if ( m_jack_running ){ init_clock = false; m_jack_transport_state = jack_transport_query( m_jack_client, &m_jack_pos ); m_jack_frame_current = jack_get_current_transport_frame( m_jack_client ); if ( m_jack_transport_state_last == JackTransportStarting && m_jack_transport_state == JackTransportRolling ){ m_jack_frame_last = m_jack_frame_current; //printf ("[Start Playback]\n" ); dumping = true; m_jack_tick = m_jack_pos.frame * m_jack_pos.ticks_per_beat * m_jack_pos.beats_per_minute / (m_jack_pos.frame_rate * 60.0); /* convert ticks */ jack_ticks_converted = m_jack_tick * ((double) c_ppqn / (m_jack_pos.ticks_per_beat * m_jack_pos.beat_type / 4.0 )); set_orig_ticks( (long) jack_ticks_converted ); current_tick = clock_tick = total_tick = jack_ticks_converted_last = jack_ticks_converted; init_clock = true; if ( m_looping && m_playback_mode ){ //printf( "left[%lf] right[%lf]\n", (double) get_left_tick(), (double) get_right_tick() ); if ( current_tick >= get_right_tick() ){ while ( current_tick >= get_right_tick() ){ double size = get_right_tick() - get_left_tick(); current_tick = current_tick - size; //printf( "> current_tick[%lf]\n", current_tick ); } reset_sequences(); set_orig_ticks( (long)current_tick ); } } } if ( m_jack_transport_state_last == JackTransportRolling && m_jack_transport_state == JackTransportStopped ){ m_jack_transport_state_last = JackTransportStopped; //printf ("[Stop Playback]\n" ); jack_stopped = true; } //----- Jack transport is Rolling Now --------- /* transport is in a sane state if dumping == true */ if ( dumping ) { m_jack_frame_current = jack_get_current_transport_frame( m_jack_client ); //printf( " frame[%7d]", m_jack_pos.frame ); //printf( " current_transport_frame[%7d]", m_jack_frame_current ); // if we are moving ahead if ( (m_jack_frame_current > m_jack_frame_last)){ m_jack_tick += (m_jack_frame_current - m_jack_frame_last) * m_jack_pos.ticks_per_beat * m_jack_pos.beats_per_minute / (m_jack_pos.frame_rate * 60.0); //printf ( "m_jack_tick += (m_jack_frame_current[%lf] - m_jack_frame_last[%lf]) *\n", // (double) m_jack_frame_current, (double) m_jack_frame_last ); //printf( "m_jack_pos.ticks_per_beat[%lf] * m_jack_pos.beats_per_minute[%lf] / \n(m_jack_pos.frame_rate[%lf] * 60.0\n", (double) m_jack_pos.ticks_per_beat, (double) m_jack_pos.beats_per_minute, (double) m_jack_pos.frame_rate); m_jack_frame_last = m_jack_frame_current; } /* convert ticks */ jack_ticks_converted = m_jack_tick * ((double) c_ppqn / (m_jack_pos.ticks_per_beat * m_jack_pos.beat_type / 4.0 )); //printf ( "jack_ticks_conv[%lf] = \n", jack_ticks_converted ); //printf ( " m_jack_tick[%lf] * ((double) c_ppqn[%lf] / \n", m_jack_tick, (double) c_ppqn ); //printf ( " (m_jack_pos.ticks_per_beat[%lf] * m_jack_pos.beat_type[%lf] / 4.0 )\n", // m_jack_pos.ticks_per_beat, m_jack_pos.beat_type ); jack_ticks_delta = jack_ticks_converted - jack_ticks_converted_last; clock_tick += jack_ticks_delta; current_tick += jack_ticks_delta; total_tick += jack_ticks_delta; m_jack_transport_state_last = m_jack_transport_state; jack_ticks_converted_last = jack_ticks_converted; /* printf( "current_tick[%lf] delta[%lf]\n", current_tick, jack_ticks_delta ); */ long pbeat = (long) ((long) m_jack_tick % (long) (m_jack_pos.ticks_per_beat * m_jack_pos.beats_per_bar )); pbeat = pbeat / (long) m_jack_pos.ticks_per_beat; //long ptick = (long) m_jack_tick % (long) m_jack_pos.ticks_per_beat; //long pbar = (long) ((long) m_jack_tick / (m_jack_pos.ticks_per_beat * m_jack_pos.beats_per_bar )); //printf( " bbb [%2d:%2d:%4d]", pbar+1, pbeat+1, ptick ); //printf( " bbb [%2d:%2d:%4d]", m_jack_pos.bar, m_jack_pos.beat, m_jack_pos.tick ); /*double jack_tick = (m_jack_pos.bar-1) * (m_jack_pos.ticks_per_beat * m_jack_pos.beats_per_bar ) + (m_jack_pos.beat-1) * m_jack_pos.ticks_per_beat + m_jack_pos.tick;*/ //printf( " jtick[%8.3f]", m_jack_tick ); //printf( " mtick[%8.3f]", jack_tick ); //printf( " delta[%8.3f]", m_jack_tick - jack_tick ); //printf( "\n"); } /* end if dumping / sane state */ } /* if jack running */ else { #endif /* default if jack is not compiled in, or not running */ /* add delta to current ticks */ clock_tick += delta_tick; current_tick += delta_tick; total_tick += delta_tick; dumping = true; #ifdef JACK_SUPPORT } #endif /* init_clock will be true when we run for the first time, or * as soon as jack gets a good lock on playback */ if (init_clock) { m_master_bus.init_clock( clock_tick ); init_clock = false; } if (dumping) { if ( m_looping && m_playback_mode ) { if ( current_tick >= get_right_tick() ) { double leftover_tick = current_tick - (get_right_tick()); play( get_right_tick() - 1 ); reset_sequences(); set_orig_ticks( get_left_tick() ); current_tick = (double) get_left_tick() + leftover_tick; } } /* play */ play( (long) current_tick ); //printf( "play[%d]\n", current_tick ); /* midi clock */ m_master_bus.clock( clock_tick ); if ( global_stats ){ while ( stats_total_tick <= total_tick ){ /* was there a tick ? */ if ( stats_total_tick % (c_ppqn / 24) == 0 ){ #ifndef __WIN32__ long current_us = (current.tv_sec * 1000000) + (current.tv_nsec / 1000); #else long current_us = current * 1000; #endif stats_clock_width_us = current_us - stats_last_clock_us; stats_last_clock_us = current_us; int index = stats_clock_width_us / 300; if ( index >= 100 ) index = 99; stats_clock[index]++; } stats_total_tick++; } } } /*********************************** Figure out how much time we need to sleep, and do it ************************************/ /* set last */ last = current; #ifndef __WIN32__ clock_gettime(CLOCK_REALTIME, ¤t); delta.tv_sec = (current.tv_sec - last.tv_sec ); delta.tv_nsec = (current.tv_nsec - last.tv_nsec ); long elapsed_us = (delta.tv_sec * 1000000) + (delta.tv_nsec / 1000); //printf( "elapsed_us[%ld]\n", elapsed_us ); #else current = timeGetTime(); delta = current - last; long elapsed_us = delta * 1000; //printf( " elapsed_us[%ld]\n", elapsed_us ); #endif /* now, we want to trigger every c_thread_trigger_width_ms, and it took us delta_us to play() */ delta_us = (c_thread_trigger_width_ms * 1000) - elapsed_us; //printf( "sleeping_us[%ld]\n", delta_us ); /* check midi clock adjustment */ double next_total_tick = (total_tick + (c_ppqn / 24.0)); double next_clock_delta = (next_total_tick - total_tick - 1); double next_clock_delta_us = (( next_clock_delta ) * 60000000.0f / c_ppqn / bpm ); if ( next_clock_delta_us < (c_thread_trigger_width_ms * 1000.0f * 2.0f) ){ delta_us = (long)next_clock_delta_us; } #ifndef __WIN32__ if ( delta_us > 0.0 ){ delta.tv_sec = (delta_us / 1000000); delta.tv_nsec = (delta_us % 1000000) * 1000; //printf("sleeping() "); nanosleep( &delta, NULL ); } #else if ( delta_us > 0 ){ delta = (delta_us / 1000); //printf(" sleeping() [0x%x]\n", delta); Sleep(delta); } #endif else { if ( global_stats ) printf ("underrun\n" ); } if ( global_stats ){ #ifndef __WIN32__ clock_gettime(CLOCK_REALTIME, &stats_loop_finish); #else stats_loop_finish = timeGetTime(); #endif } if ( global_stats ){ #ifndef __WIN32__ delta.tv_sec = (stats_loop_finish.tv_sec - stats_loop_start.tv_sec ); delta.tv_nsec = (stats_loop_finish.tv_nsec - stats_loop_start.tv_nsec ); long delta_us = (delta.tv_sec * 1000000) + (delta.tv_nsec / 1000); #else delta = stats_loop_finish - stats_loop_start; long delta_us = delta * 1000; #endif int index = delta_us / 100; if ( index >= 100 ) index = 99; stats_all[index]++; if ( delta_us > stats_max ) stats_max = delta_us; if ( delta_us < stats_min ) stats_min = delta_us; stats_avg += delta_us; stats_loop_index++; if ( stats_loop_index > 200 ){ stats_loop_index = 0; stats_avg /= 200; printf("stats_avg[%ld]us stats_min[%ld]us" " stats_max[%ld]us\n", stats_avg, stats_min, stats_max); stats_min = 0x7FFFFFFF; stats_max = 0; stats_avg = 0; } } if (jack_stopped) inner_stop(); } if (global_stats){ printf("\n\n-- trigger width --\n"); for (int i=0; i<100; i++ ){ printf( "[%3d][%8ld]\n", i * 100, stats_all[i] ); } printf("\n\n-- clock width --\n" ); int bpm = m_master_bus.get_bpm(); printf("optimal: [%d]us\n", ((c_ppqn / 24)* 60000000 / c_ppqn / bpm)); for ( int i=0; i<100; i++ ){ printf( "[%3d][%8ld]\n", i * 300, stats_clock[i] ); } } m_tick = 0; m_master_bus.flush(); m_master_bus.stop(); } pthread_exit(0); } void* input_thread_func(void *a_pef ) { /* set our performance */ perform *p = (perform *) a_pef; assert(p); struct sched_param schp; /* * set the process to realtime privs */ if ( global_priority ){ memset(&schp, 0, sizeof(sched_param)); schp.sched_priority = 1; #ifndef __WIN32__ // MinGW RCB if (sched_setscheduler(0, SCHED_FIFO, &schp) != 0) { printf("input_thread_func: couldnt sched_setscheduler" " (FIFO), you need to be root.\n"); pthread_exit(0); } #endif } #ifdef __WIN32__ timeBeginPeriod(1); #endif p->input_func(); #ifdef __WIN32__ timeEndPeriod(1); #endif return 0; } void perform::handle_midi_control( int a_control, bool a_state ) { switch (a_control) { case c_midi_control_bpm_up: //printf ( "bpm up\n" ); set_bpm( get_bpm() + 1 ); break; case c_midi_control_bpm_dn: //printf ( "bpm dn\n" ); set_bpm( get_bpm() - 1 ); break; case c_midi_control_ss_up: //printf ( "ss up\n" ); set_screenset( get_screenset() + 1 ); break; case c_midi_control_ss_dn: //printf ( "ss dn\n" ); set_screenset( get_screenset() - 1 ); break; case c_midi_control_mod_replace: //printf ( "replace\n" ); if ( a_state ) set_sequence_control_status( c_status_replace ); else unset_sequence_control_status( c_status_replace ); break; case c_midi_control_mod_snapshot: //printf ( "snapshot\n" ); if ( a_state ) set_sequence_control_status( c_status_snapshot ); else unset_sequence_control_status( c_status_snapshot ); break; case c_midi_control_mod_queue: //printf ( "queue\n" ); if ( a_state ) set_sequence_control_status( c_status_queue ); else unset_sequence_control_status( c_status_queue ); //andy cases case c_midi_control_mod_gmute: printf ( "gmute\n" ); if (a_state) set_mode_group_mute(); else unset_mode_group_mute(); break; case c_midi_control_mod_glearn: //printf ( "glearn\n" ); if (a_state) set_mode_group_learn(); else unset_mode_group_learn(); break; case c_midi_control_play_ss: //printf ( "play_ss\n" ); set_playing_screenset(); break; default: if ((a_control >= c_seqs_in_set) && (a_control < c_midi_track_ctrl)) { //printf ( "group mute\n" ); select_and_mute_group(a_control - c_seqs_in_set); } break; } } void perform::input_func() { event ev; while (m_inputing) { if ( m_master_bus.poll_for_midi() > 0 ){ do { if (m_master_bus.get_midi_event(&ev) ){ // Obey MidiTimeClock: if (ev.get_status() == EVENT_MIDI_START) { stop(); start(false); m_midiclockrunning = true; m_usemidiclock = true; m_midiclocktick = 0; m_midiclockpos = 0; } // midi continue: start from current pos. else if (ev.get_status() == EVENT_MIDI_CONTINUE) { m_midiclockrunning = true; start(false); //m_usemidiclock = true; } else if (ev.get_status() == EVENT_MIDI_STOP) { // do nothing, just let the system pause // since we're not getting ticks after the stop, the song wont advance // when start is recieved, we'll reset the position, or // when continue is recieved, we wont m_midiclockrunning = false; all_notes_off(); } else if (ev.get_status() == EVENT_MIDI_CLOCK) { if (m_midiclockrunning) m_midiclocktick += 8; } // not tested (todo: test it!) else if (ev.get_status() == EVENT_MIDI_SONG_POS) { unsigned char a, b; ev.get_data(&a, &b); m_midiclockpos = ((int)a << 7) && (int)b; } /* filter system wide messages */ if (ev.get_status() <= EVENT_SYSEX) { if( global_showmidi) ev.print(); /* is there a sequence set ? */ if (m_master_bus.is_dumping()) { ev.set_timestamp(m_tick); /* dump to it */ (m_master_bus.get_sequence())->stream_event(&ev); } /* use it to control our sequencer */ else { for (int i = 0; i < c_midi_controls; i++) { unsigned char data[2] = {0,0}; unsigned char status = ev.get_status(); ev.get_data( &data[0], &data[1] ); if (get_midi_control_toggle(i)->m_active && status == get_midi_control_toggle(i)->m_status && data[0] == get_midi_control_toggle(i)->m_data ){ if (data[1] >= get_midi_control_toggle(i)->m_min_value && data[1] <= get_midi_control_toggle(i)->m_max_value ){ if ( i < c_seqs_in_set ) sequence_playing_toggle( i + m_offset ); } } if ( get_midi_control_on(i)->m_active && status == get_midi_control_on(i)->m_status && data[0] == get_midi_control_on(i)->m_data ){ if ( data[1] >= get_midi_control_on(i)->m_min_value && data[1] <= get_midi_control_on(i)->m_max_value ){ if ( i < c_seqs_in_set ) sequence_playing_on( i + m_offset); else handle_midi_control( i, true ); } else if ( get_midi_control_on(i)->m_inverse_active ){ if ( i < c_seqs_in_set ) sequence_playing_off( i + m_offset ); else handle_midi_control( i, false ); } } if ( get_midi_control_off(i)->m_active && status == get_midi_control_off(i)->m_status && data[0] == get_midi_control_off(i)->m_data ){ if ( data[1] >= get_midi_control_off(i)->m_min_value && data[1] <= get_midi_control_off(i)->m_max_value ){ if ( i < c_seqs_in_set ) sequence_playing_off( i + m_offset ); else handle_midi_control( i, false ); } else if ( get_midi_control_off(i)->m_inverse_active ){ if ( i < c_seqs_in_set ) sequence_playing_on( i + m_offset ); else handle_midi_control( i, true ); } } } } } if (ev.get_status() == EVENT_SYSEX) { if (global_showmidi) ev.print(); if (global_pass_sysex) m_master_bus.sysex(&ev); } } } while (m_master_bus.is_more_input()); } } pthread_exit(0); } void perform::save_playing_state() { for( int i=0; iget_playing(); } else m_sequence_state[i] = false; } } void perform::restore_playing_state() { for( int i=0; iset_playing( m_sequence_state[i] ); } } } void perform::set_sequence_control_status( int a_status ) { if ( a_status & c_status_snapshot ){ save_playing_state( ); } m_control_status |= a_status; } void perform::unset_sequence_control_status( int a_status ) { if ( a_status & c_status_snapshot ){ restore_playing_state( ); } m_control_status &= (~a_status); } void perform::sequence_playing_toggle( int a_sequence ) { if ( is_active(a_sequence) == true ){ assert( m_seqs[a_sequence] ); if ( m_control_status & c_status_queue ){ m_seqs[a_sequence]->toggle_queued(); } else { if ( m_control_status & c_status_replace ){ unset_sequence_control_status( c_status_replace ); off_sequences( ); } m_seqs[a_sequence]->toggle_playing(); } } } void perform::sequence_playing_on( int a_sequence ) { if ( is_active(a_sequence) == true ){ if (m_mode_group && (m_playing_screen == m_screen_set) && (a_sequence >= (m_playing_screen * c_seqs_in_set)) && (a_sequence < ((m_playing_screen + 1) * c_seqs_in_set))) m_tracks_mute_state[a_sequence - m_playing_screen * c_seqs_in_set] = true; assert( m_seqs[a_sequence] ); if (!(m_seqs[a_sequence]->get_playing())) { if (m_control_status & c_status_queue ) { if (!(m_seqs[a_sequence]->get_queued())) m_seqs[a_sequence]->toggle_queued(); } else m_seqs[a_sequence]->set_playing(true); } else { if ((m_seqs[a_sequence]->get_queued()) && (m_control_status & c_status_queue )) m_seqs[a_sequence]->toggle_queued(); } } } void perform::sequence_playing_off( int a_sequence ) { if ( is_active(a_sequence) == true ){ if (m_mode_group && (m_playing_screen == m_screen_set) && (a_sequence >= (m_playing_screen * c_seqs_in_set)) && (a_sequence < ((m_playing_screen + 1) * c_seqs_in_set))) m_tracks_mute_state[a_sequence - m_playing_screen * c_seqs_in_set] = false; assert( m_seqs[a_sequence] ); if (m_seqs[a_sequence]->get_playing()) { if (m_control_status & c_status_queue ) { if (!(m_seqs[a_sequence]->get_queued())) m_seqs[a_sequence]->toggle_queued(); } else m_seqs[a_sequence]->set_playing(false); } else { if ((m_seqs[a_sequence]->get_queued()) && (m_control_status & c_status_queue )) m_seqs[a_sequence]->toggle_queued(); } } } void perform::set_key_event( unsigned int keycode, long sequence_slot ) { // unhook previous binding... std::map::iterator it1 = key_events.find( keycode ); if (it1 != key_events.end()) { std::map::iterator i = key_events_rev.find( it1->second ); if (i != key_events_rev.end()) key_events_rev.erase( i ); key_events.erase( it1 ); } std::map::iterator it2 = key_events_rev.find( sequence_slot ); if (it2 != key_events_rev.end()) { std::map::iterator i = key_events.find( it2->second ); if (i != key_events.end()) key_events.erase( i ); key_events_rev.erase( it2 ); } // set key_events[keycode] = sequence_slot; key_events_rev[sequence_slot] = keycode; } void perform::set_key_group( unsigned int keycode, long group_slot ) { // unhook previous binding... std::map::iterator it1 = key_groups.find( keycode ); if (it1 != key_groups.end()) { std::map::iterator i = key_groups_rev.find( it1->second ); if (i != key_groups_rev.end()) key_groups_rev.erase( i ); key_groups.erase( it1 ); } std::map::iterator it2 = key_groups_rev.find( group_slot ); if (it2 != key_groups_rev.end()) { std::map::iterator i = key_groups.find( it2->second ); if (i != key_groups.end()) key_groups.erase( i ); key_groups_rev.erase( it2 ); } // set key_groups[keycode] = group_slot; key_groups_rev[group_slot] = keycode; } #ifdef JACK_SUPPORT void jack_timebase_callback(jack_transport_state_t state, jack_nframes_t nframes, jack_position_t *pos, int new_pos, void *arg) { static double jack_tick; //static jack_nframes_t last_frame; static jack_nframes_t current_frame; static jack_transport_state_t state_current; static jack_transport_state_t state_last; state_current = state; perform *p = (perform *) arg; current_frame = jack_get_current_transport_frame( p->m_jack_client ); //printf( "jack_timebase_callback() [%d] [%d] [%d]", state, new_pos, current_frame); pos->valid = JackPositionBBT; pos->beats_per_bar = 4; pos->beat_type = 4; pos->ticks_per_beat = c_ppqn * 10; pos->beats_per_minute = p->get_bpm(); /* Compute BBT info from frame number. This is relatively * simple here, but would become complex if we supported tempo * or time signature changes at specific locations in the * transport timeline. */ // if we are in a new position if ( state_last == JackTransportStarting && state_current == JackTransportRolling ){ // printf ( "Starting [%d] [%d]\n", last_frame, current_frame ); double jack_delta_tick = (current_frame) * pos->ticks_per_beat * pos->beats_per_minute / (pos->frame_rate * 60.0); jack_tick = (jack_delta_tick < 0) ? -jack_delta_tick : jack_delta_tick; //last_frame = current_frame; long ptick = 0, pbeat = 0, pbar = 0; pbar = (long) ((long) jack_tick / (pos->ticks_per_beat * pos->beats_per_bar )); pbeat = (long) ((long) jack_tick % (long) (pos->ticks_per_beat * pos->beats_per_bar )); pbeat = pbeat / (long) pos->ticks_per_beat; ptick = (long) jack_tick % (long) pos->ticks_per_beat; // printf( " bbb [%2d:%2d:%4d]\n", pos->bar, pos->beat, pos->tick ); pos->bar = pbar + 1; pos->beat = pbeat + 1; pos->tick = ptick; pos->bar_start_tick = pos->bar * pos->beats_per_bar * pos->ticks_per_beat; } state_last = state_current; } void jack_shutdown(void *arg) { perform *p = (perform *) arg; p->m_jack_running = false; printf("JACK shut down.\nJACK sync Disabled.\n"); } void print_jack_pos( jack_position_t* jack_pos ){ return; printf( "print_jack_pos()\n" ); printf( " bar [%d]\n", jack_pos->bar ); printf( " beat [%d]\n", jack_pos->beat ); printf( " tick [%d]\n", jack_pos->tick ); printf( " bar_start_tick [%lf]\n", jack_pos->bar_start_tick ); printf( " beats_per_bar [%f]\n", jack_pos->beats_per_bar ); printf( " beat_type [%f]\n", jack_pos->beat_type ); printf( " ticks_per_beat [%lf]\n", jack_pos->ticks_per_beat ); printf( " beats_per_minute [%lf]\n", jack_pos->beats_per_minute ); printf( " frame_time [%lf]\n", jack_pos->frame_time ); printf( " next_time [%lf]\n", jack_pos->next_time ); } #if 0 int main () { jack_client_t *client; /* become a new client of the JACK server */ if ((client = jack_client_new("transport tester")) == 0) { fprintf(stderr, "jack server not running?\n"); return 1; } jack_on_shutdown(client, jack_shutdown, 0); jack_set_sync_callback(client, jack_sync_callback, NULL); if (jack_activate(client)) { fprintf(stderr, "cannot activate client"); return 1; } bool cond = false; /* true if we want to fail if there is already a master */ if (jack_set_timebase_callback(client, cond, timebase, NULL) != 0){ printf("Unable to take over timebase or there is already a master.\n"); exit(1); } jack_position_t pos; pos.valid = JackPositionBBT; pos.bar = 0; pos.beat = 0; pos.tick = 0; pos.beats_per_bar = time_beats_per_bar; pos.beat_type = time_beat_type; pos.ticks_per_beat = time_ticks_per_beat; pos.beats_per_minute = time_beats_per_minute; pos.bar_start_tick = 0.0; //jack_transport_reposition( client, &pos ); jack_transport_start (client); //void jack_transport_stop (jack_client_t *client); int bob; scanf ("%d", &bob); jack_transport_stop (client); jack_release_timebase(client); jack_client_close(client); return 0; } #endif #endif seq24-0.9.3/src/perftime.h0000644000175000017500000000447112651156360012170 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #pragma once #include "perform.h" #include "seqtime.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include "globals.h" using namespace Gtk; /* piano time*/ class perftime: public Gtk::DrawingArea { private: Glib::RefPtr m_gc; Glib::RefPtr m_window; Gdk::Color m_black, m_white, m_grey; Glib::RefPtr m_pixmap; perform * const m_mainperf; Adjustment * const m_hadjust; int m_window_x, m_window_y; int m_4bar_offset; int m_snap, m_measure_length; void on_realize(); bool on_expose_event(GdkEventExpose* a_ev); bool on_button_press_event(GdkEventButton* a_ev); bool on_button_release_event(GdkEventButton* a_ev); void on_size_allocate(Gtk::Allocation &a_r ); void update_sizes(); void draw_pixmap_on_window(); void draw_progress_on_window(); void update_pixmap(); int idle_progress(); void change_horz(); public: perftime( perform *a_perf, Adjustment *a_hadjust ); void reset(); void set_scale( int a_scale ); void set_guides( int a_snap, int a_measure ); void increment_size(); }; seq24-0.9.3/src/font.h0000644000175000017500000000313012651156360011312 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #pragma once #include #include #include #include using namespace Gtk; class font { private: Glib::RefPtr m_pixmap; Glib::RefPtr m_black_pixmap; Glib::RefPtr m_white_pixmap; Glib::RefPtr m_clip_mask; public: enum Color { BLACK = 0, WHITE = 1 }; font( ); void init( Glib::RefPtr a_window ); void render_string_on_drawable( Glib::RefPtr m_gc, int x, int y, Glib::RefPtr a_draw, const char *str, font::Color col ); }; extern font *p_font_renderer; seq24-0.9.3/src/midifile.h0000644000175000017500000000306312651156360012133 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #pragma once #include "perform.h" #include #include #include #include class midifile { private: int m_pos; const std::string m_name; /* holds our data */ std::vector m_d; list m_l; unsigned long read_long(); unsigned short read_short(); unsigned char read_byte(); unsigned long read_var(); void write_long( unsigned long ); void write_short( unsigned short ); void write_byte( unsigned char ); public: midifile(const Glib::ustring&); ~midifile(); bool parse( perform *a_perf, int a_screen_set ); bool write( perform *a_perf ); }; seq24-0.9.3/src/mainwnd.cpp0000644000175000017500000007442712651200767012356 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; 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 "mainwnd.h" #include "perform.h" #include "midifile.h" #include "perfedit.h" #include "pixmaps/play2.xpm" #include "pixmaps/stop.xpm" #include "pixmaps/learn.xpm" #include "pixmaps/learn2.xpm" #include "pixmaps/perfedit.xpm" #include "pixmaps/seq24.xpm" #include "pixmaps/seq24_32.xpm" bool is_pattern_playing = false; // tooltip helper, for old vs new gtk... #if GTK_MINOR_VERSION >= 12 # define add_tooltip( obj, text ) obj->set_tooltip_text( text); #else # define add_tooltip( obj, text ) m_tooltips->set_tip( *obj, text ); #endif mainwnd::mainwnd(perform *a_p): m_mainperf(a_p), m_modified(false), m_options(NULL) { set_icon(Gdk::Pixbuf::create_from_xpm_data(seq24_32_xpm)); /* register for notification */ m_mainperf->m_notify.push_back( this ); /* main window */ update_window_title(); #if GTK_MINOR_VERSION < 12 m_tooltips = manage( new Tooltips() ); #endif m_main_wid = manage( new mainwid( m_mainperf )); m_main_time = manage( new maintime( )); m_menubar = manage(new MenuBar()); m_menu_file = manage(new Menu()); m_menubar->items().push_front(MenuElem("_File", *m_menu_file)); m_menu_view = manage( new Menu()); m_menubar->items().push_back(MenuElem("_View", *m_menu_view)); m_menu_help = manage( new Menu()); m_menubar->items().push_back(MenuElem("_Help", *m_menu_help)); /* file menu items */ m_menu_file->items().push_back(MenuElem("_New", Gtk::AccelKey("N"), mem_fun(*this, &mainwnd::file_new))); m_menu_file->items().push_back(MenuElem("_Open...", Gtk::AccelKey("O"), mem_fun(*this, &mainwnd::file_open))); m_menu_file->items().push_back(MenuElem("_Save", Gtk::AccelKey("S"), mem_fun(*this, &mainwnd::file_save))); m_menu_file->items().push_back(MenuElem("Save _as...", mem_fun(*this, &mainwnd::file_save_as))); m_menu_file->items().push_back(SeparatorElem()); m_menu_file->items().push_back(MenuElem("_Import...", mem_fun(*this, &mainwnd::file_import_dialog))); m_menu_file->items().push_back(MenuElem("O_ptions...", mem_fun(*this,&mainwnd::options_dialog))); m_menu_file->items().push_back(SeparatorElem()); m_menu_file->items().push_back(MenuElem("E_xit", Gtk::AccelKey("Q"), mem_fun(*this, &mainwnd::file_exit))); /* view menu items */ m_menu_view->items().push_back(MenuElem("_Song Editor...", Gtk::AccelKey("E"), mem_fun(*this, &mainwnd::open_performance_edit))); /* help menu items */ m_menu_help->items().push_back(MenuElem("_About...", mem_fun(*this, &mainwnd::about_dialog))); /* top line items */ HBox *tophbox = manage( new HBox( false, 0 ) ); tophbox->pack_start(*manage(new Image( Gdk::Pixbuf::create_from_xpm_data(seq24_xpm))), false, false); // adjust placement... VBox *vbox_b = manage( new VBox() ); HBox *hbox3 = manage( new HBox( false, 0 ) ); vbox_b->pack_start( *hbox3, false, false ); tophbox->pack_end( *vbox_b, false, false ); hbox3->set_spacing( 10 ); /* timeline */ hbox3->pack_start( *m_main_time, false, false ); /* group learn button */ m_button_learn = manage( new Button( )); m_button_learn->set_focus_on_click( false ); m_button_learn->set_flags( m_button_learn->get_flags() & ~Gtk::CAN_FOCUS ); m_button_learn->set_image(*manage(new Image( Gdk::Pixbuf::create_from_xpm_data( learn_xpm )))); m_button_learn->signal_clicked().connect( mem_fun(*this, &mainwnd::learn_toggle)); add_tooltip( m_button_learn, "Mute Group Learn\n\n" "Click 'L' then press a mutegroup key to store the mute state of " "the sequences in that key.\n\n" "(see File/Options/Keyboard for available mutegroup keys " "and the corresponding hotkey for the 'L' button)" ); hbox3->pack_end( *m_button_learn, false, false ); /*this seems to be a dirty hack:*/ Button w; hbox3->set_focus_child( w ); // clear the focus not to trigger L via keys /* bottom line items */ HBox *bottomhbox = manage( new HBox(false, 10)); /* container for start+stop buttons */ HBox *startstophbox = manage(new HBox(false, 4)); bottomhbox->pack_start(*startstophbox, Gtk::PACK_SHRINK); /* stop button */ m_button_stop = manage( new Button()); m_button_stop->add(*manage(new Image( Gdk::Pixbuf::create_from_xpm_data( stop_xpm )))); m_button_stop->signal_clicked().connect( mem_fun(*this, &mainwnd::stop_playing)); add_tooltip( m_button_stop, "Stop playing MIDI sequence" ); startstophbox->pack_start(*m_button_stop, Gtk::PACK_SHRINK); /* play button */ m_button_play = manage(new Button() ); m_button_play->add(*manage(new Image( Gdk::Pixbuf::create_from_xpm_data( play2_xpm )))); m_button_play->signal_clicked().connect( mem_fun( *this, &mainwnd::start_playing)); add_tooltip( m_button_play, "Play MIDI sequence" ); startstophbox->pack_start(*m_button_play, Gtk::PACK_SHRINK); /* bpm spin button with label*/ HBox *bpmhbox = manage(new HBox(false, 4)); bottomhbox->pack_start(*bpmhbox, Gtk::PACK_SHRINK); m_adjust_bpm = manage(new Adjustment(m_mainperf->get_bpm(), 20, 500, 1)); m_spinbutton_bpm = manage( new SpinButton( *m_adjust_bpm )); m_spinbutton_bpm->set_editable( false ); m_adjust_bpm->signal_value_changed().connect( mem_fun(*this, &mainwnd::adj_callback_bpm)); add_tooltip( m_spinbutton_bpm, "Adjust beats per minute (BPM) value"); Label* bpmlabel = manage(new Label("_bpm", true)); bpmlabel->set_mnemonic_widget(*m_spinbutton_bpm); bpmhbox->pack_start(*bpmlabel, Gtk::PACK_SHRINK); bpmhbox->pack_start(*m_spinbutton_bpm, Gtk::PACK_SHRINK); /* screen set name edit line */ HBox *notebox = manage(new HBox(false, 4)); bottomhbox->pack_start(*notebox, Gtk::PACK_EXPAND_WIDGET); m_entry_notes = manage( new Entry()); m_entry_notes->signal_changed().connect( mem_fun(*this, &mainwnd::edit_callback_notepad)); m_entry_notes->set_text(*m_mainperf->get_screen_set_notepad( m_mainperf->get_screenset())); add_tooltip( m_entry_notes, "Enter screen set name" ); Label* notelabel = manage(new Label("_Name", true)); notelabel->set_mnemonic_widget(*m_entry_notes); notebox->pack_start(*notelabel, Gtk::PACK_SHRINK); notebox->pack_start(*m_entry_notes, Gtk::PACK_EXPAND_WIDGET); /* sequence set spin button */ HBox *sethbox = manage(new HBox(false, 4)); bottomhbox->pack_start(*sethbox, Gtk::PACK_SHRINK); m_adjust_ss = manage( new Adjustment( 0, 0, c_max_sets - 1, 1 )); m_spinbutton_ss = manage( new SpinButton( *m_adjust_ss )); m_spinbutton_ss->set_editable( false ); m_spinbutton_ss->set_wrap( true ); m_adjust_ss->signal_value_changed().connect( mem_fun(*this, &mainwnd::adj_callback_ss )); add_tooltip( m_spinbutton_ss, "Select screen set" ); Label* setlabel = manage(new Label("_Set", true)); setlabel->set_mnemonic_widget(*m_spinbutton_ss); sethbox->pack_start(*setlabel, Gtk::PACK_SHRINK); sethbox->pack_start(*m_spinbutton_ss, Gtk::PACK_SHRINK); /* song edit button */ m_button_perfedit = manage( new Button( )); m_button_perfedit->add( *manage( new Image( Gdk::Pixbuf::create_from_xpm_data( perfedit_xpm )))); m_button_perfedit->signal_clicked().connect( mem_fun( *this, &mainwnd::open_performance_edit )); add_tooltip( m_button_perfedit, "Show or hide song editor window" ); bottomhbox->pack_end(*m_button_perfedit, Gtk::PACK_SHRINK); /* vertical layout container for window content*/ VBox *contentvbox = new VBox(); contentvbox->set_spacing(10); contentvbox->set_border_width(10); contentvbox->pack_start(*tophbox, Gtk::PACK_SHRINK); contentvbox->pack_start(*m_main_wid, Gtk::PACK_SHRINK); contentvbox->pack_start(*bottomhbox, Gtk::PACK_SHRINK); /*main container for menu and window content */ VBox *mainvbox = new VBox(); mainvbox->pack_start(*m_menubar, false, false ); mainvbox->pack_start( *contentvbox ); /* add main layout box */ this->add (*mainvbox); /* show everything */ show_all(); add_events( Gdk::KEY_PRESS_MASK | Gdk::KEY_RELEASE_MASK ); m_timeout_connect = Glib::signal_timeout().connect( mem_fun(*this, &mainwnd::timer_callback), 25); m_perf_edit = new perfedit( m_mainperf ); m_sigpipe[0] = -1; m_sigpipe[1] = -1; install_signal_handlers(); } mainwnd::~mainwnd() { delete m_perf_edit; delete m_options; if (m_sigpipe[0] != -1) close(m_sigpipe[0]); if (m_sigpipe[1] != -1) close(m_sigpipe[1]); } // This is the GTK timer callback, used to draw our current time and bpm // ondd_events( the main window bool mainwnd::timer_callback( ) { long ticks = m_mainperf->get_tick(); m_main_time->idle_progress( ticks ); m_main_wid->update_markers( ticks ); if ( m_adjust_bpm->get_value() != m_mainperf->get_bpm()){ m_adjust_bpm->set_value( m_mainperf->get_bpm()); } if ( m_adjust_ss->get_value() != m_mainperf->get_screenset() ) { m_main_wid->set_screenset(m_mainperf->get_screenset()); m_adjust_ss->set_value( m_mainperf->get_screenset()); m_entry_notes->set_text(*m_mainperf->get_screen_set_notepad( m_mainperf->get_screenset())); } return true; } void mainwnd::open_performance_edit() { if (m_perf_edit->is_visible()) m_perf_edit->hide(); else { m_perf_edit->init_before_show(); m_perf_edit->show_all(); m_modified = true; } } void mainwnd::options_dialog() { delete m_options; m_options = new options( *this, m_mainperf ); m_options->show_all(); } void mainwnd::start_playing() { m_mainperf->position_jack( false ); m_mainperf->start( false ); m_mainperf->start_jack( ); is_pattern_playing = true; } void mainwnd::stop_playing() { m_mainperf->stop_jack(); m_mainperf->stop(); m_main_wid->update_sequences_on_window(); is_pattern_playing = false; } void mainwnd::on_grouplearnchange(bool state) { /* respond to learn mode change from m_mainperf */ m_button_learn->set_image(*manage(new Image( Gdk::Pixbuf::create_from_xpm_data( state ? learn2_xpm : learn_xpm)))); } void mainwnd::learn_toggle() { if (m_mainperf->is_group_learning()) { m_mainperf->unset_mode_group_learn(); } else { m_mainperf->set_mode_group_learn(); } } /* callback function */ void mainwnd::file_new() { if (is_save()) new_file(); } void mainwnd::new_file() { m_mainperf->clear_all(); m_main_wid->reset(); m_entry_notes->set_text( * m_mainperf->get_screen_set_notepad( m_mainperf->get_screenset() )); global_filename = ""; update_window_title(); m_modified = false; } /* callback function */ void mainwnd::file_save() { save_file(); } /* callback function */ void mainwnd::file_save_as() { Gtk::FileChooserDialog dialog("Save file as", Gtk::FILE_CHOOSER_ACTION_SAVE); dialog.set_transient_for(*this); dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); dialog.add_button(Gtk::Stock::SAVE, Gtk::RESPONSE_OK); Gtk::FileFilter filter_midi; filter_midi.set_name("MIDI files"); filter_midi.add_pattern("*.midi"); filter_midi.add_pattern("*.mid"); dialog.add_filter(filter_midi); Gtk::FileFilter filter_any; filter_any.set_name("Any files"); filter_any.add_pattern("*"); dialog.add_filter(filter_any); dialog.set_current_folder(last_used_dir); int result = dialog.run(); switch (result) { case Gtk::RESPONSE_OK: { std::string fname = dialog.get_filename(); Gtk::FileFilter* current_filter = dialog.get_filter(); if ((current_filter != NULL) && (current_filter->get_name() == "MIDI files")) { // check for MIDI file extension; if missing, add .midi std::string suffix = fname.substr( fname.find_last_of(".") + 1, std::string::npos); toLower(suffix); if ((suffix != "midi") && (suffix != "mid")) fname = fname + ".midi"; } if (Glib::file_test(fname, Glib::FILE_TEST_EXISTS)) { Gtk::MessageDialog warning(*this, "File already exists!\n" "Do you want to overwrite it?", false, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_YES_NO, true); auto result = warning.run(); if (result == Gtk::RESPONSE_NO) return; } global_filename = fname; update_window_title(); save_file(); break; } default: break; } } void mainwnd::open_file(const Glib::ustring& fn) { bool result; m_mainperf->clear_all(); midifile f(fn); result = f.parse(m_mainperf, 0); m_modified = !result; if (!result) { Gtk::MessageDialog errdialog(*this, "Error reading file: " + fn, false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true); errdialog.run(); return; } last_used_dir = fn.substr(0, fn.rfind("/") + 1); global_filename = fn; update_window_title(); m_main_wid->reset(); m_entry_notes->set_text(*m_mainperf->get_screen_set_notepad( m_mainperf->get_screenset())); m_adjust_bpm->set_value( m_mainperf->get_bpm()); } /*callback function*/ void mainwnd::file_open() { if (is_save()) choose_file(); } void mainwnd::choose_file() { Gtk::FileChooserDialog dialog("Open MIDI file", Gtk::FILE_CHOOSER_ACTION_OPEN); dialog.set_transient_for(*this); dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); dialog.add_button(Gtk::Stock::OPEN, Gtk::RESPONSE_OK); Gtk::FileFilter filter_midi; filter_midi.set_name("MIDI files"); filter_midi.add_pattern("*.midi"); filter_midi.add_pattern("*.mid"); dialog.add_filter(filter_midi); Gtk::FileFilter filter_any; filter_any.set_name("Any files"); filter_any.add_pattern("*"); dialog.add_filter(filter_any); dialog.set_current_folder(last_used_dir); int result = dialog.run(); switch(result) { case(Gtk::RESPONSE_OK): open_file(dialog.get_filename()); default: break; } } bool mainwnd::save_file() { bool result = false; if (global_filename == "") { file_save_as(); return true; } midifile f(global_filename); result = f.write(m_mainperf); if (!result) { Gtk::MessageDialog errdialog(*this, "Error writing file.", false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true); errdialog.run(); } m_modified = !result; return result; } int mainwnd::query_save_changes() { Glib::ustring query_str; if (global_filename == "") query_str = "Unnamed file was changed.\nSave changes?"; else query_str = "File '" + global_filename + "' was changed.\n" "Save changes?"; Gtk::MessageDialog dialog(*this, query_str, false, Gtk::MESSAGE_QUESTION, Gtk::BUTTONS_NONE, true); dialog.add_button(Gtk::Stock::YES, Gtk::RESPONSE_YES); dialog.add_button(Gtk::Stock::NO, Gtk::RESPONSE_NO); dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); return dialog.run(); } bool mainwnd::is_save() { bool result = false; if (is_modified()) { int choice = query_save_changes(); switch (choice) { case Gtk::RESPONSE_YES: if (save_file()) result = true; break; case Gtk::RESPONSE_NO: result = true; break; case Gtk::RESPONSE_CANCEL: default: break; } } else result = true; return result; } /* convert string to lower case letters */ void mainwnd::toLower(basic_string& s) { for (basic_string::iterator p = s.begin(); p != s.end(); p++) { *p = tolower(*p); } } void mainwnd::file_import_dialog() { Gtk::FileChooserDialog dialog("Import MIDI file", Gtk::FILE_CHOOSER_ACTION_OPEN); dialog.set_transient_for(*this); Gtk::FileFilter filter_midi; filter_midi.set_name("MIDI files"); filter_midi.add_pattern("*.midi"); filter_midi.add_pattern("*.mid"); dialog.add_filter(filter_midi); Gtk::FileFilter filter_any; filter_any.set_name("Any files"); filter_any.add_pattern("*"); dialog.add_filter(filter_any); dialog.set_current_folder(last_used_dir); ButtonBox *btnbox = dialog.get_action_area(); HBox hbox( false, 2 ); m_adjust_load_offset = manage( new Adjustment( 0, -(c_max_sets - 1), c_max_sets - 1, 1 )); m_spinbutton_load_offset = manage( new SpinButton( *m_adjust_load_offset )); m_spinbutton_load_offset->set_editable( false ); m_spinbutton_load_offset->set_wrap( true ); hbox.pack_end(*m_spinbutton_load_offset, false, false ); hbox.pack_end(*(manage( new Label("Screen Set Offset"))), false, false, 4); btnbox->pack_start(hbox, false, false ); dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); dialog.add_button(Gtk::Stock::OPEN, Gtk::RESPONSE_OK); dialog.show_all_children(); int result = dialog.run(); //Handle the response: switch(result) { case(Gtk::RESPONSE_OK): { try{ midifile f( dialog.get_filename() ); f.parse( m_mainperf, (int) m_adjust_load_offset->get_value() ); } catch(...){ Gtk::MessageDialog errdialog(*this, "Error reading file.", false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true); errdialog.run(); } global_filename = std::string(dialog.get_filename()); update_window_title(); m_modified = true; m_main_wid->reset(); m_entry_notes->set_text(*m_mainperf->get_screen_set_notepad( m_mainperf->get_screenset() )); m_adjust_bpm->set_value( m_mainperf->get_bpm() ); break; } case(Gtk::RESPONSE_CANCEL): break; default: break; } } /*callback function*/ void mainwnd::file_exit() { if (is_save()) { if (is_pattern_playing) stop_playing(); hide(); } } bool mainwnd::on_delete_event(GdkEventAny *a_e) { bool result = is_save(); if (result && is_pattern_playing) stop_playing(); return !result; } void mainwnd::about_dialog() { Gtk::AboutDialog dialog; dialog.set_transient_for(*this); dialog.set_name(PACKAGE_NAME); dialog.set_version(VERSION); dialog.set_comments("Interactive MIDI Sequencer\n"); dialog.set_copyright( "(C) 2002 - 2006 Rob C. Buse\n" "(C) 2008 - 2010 Seq24team"); dialog.set_website( "http://www.filter24.org/seq24\n" "http://edge.launchpad.net/seq24"); std::list list_authors; list_authors.push_back("Rob C. Buse "); list_authors.push_back("Ivan Hernandez "); list_authors.push_back("Guido Scholz "); list_authors.push_back("Jaakko Sipari "); list_authors.push_back("Peter Leigh "); list_authors.push_back("Anthony Green "); list_authors.push_back("Daniel Ellis "); list_authors.push_back("Sebastien Alaiwan "); list_authors.push_back("Kevin Meinert "); list_authors.push_back("Andrea delle Canne "); dialog.set_authors(list_authors); std::list list_documenters; list_documenters.push_back("Dana Olson "); dialog.set_documenters(list_documenters); dialog.show_all_children(); dialog.run(); } void mainwnd::adj_callback_ss( ) { m_mainperf->set_screenset( (int) m_adjust_ss->get_value()); m_main_wid->set_screenset( m_mainperf->get_screenset()); m_entry_notes->set_text(*m_mainperf->get_screen_set_notepad( m_mainperf->get_screenset())); m_modified = true; } void mainwnd::adj_callback_bpm( ) { m_mainperf->set_bpm( (int) m_adjust_bpm->get_value()); m_modified = true; } bool mainwnd::on_key_release_event(GdkEventKey* a_ev) { if ( a_ev->keyval == m_mainperf->m_key_replace ) m_mainperf->unset_sequence_control_status( c_status_replace ); if (a_ev->keyval == m_mainperf->m_key_queue ) m_mainperf->unset_sequence_control_status( c_status_queue ); if ( a_ev->keyval == m_mainperf->m_key_snapshot_1 || a_ev->keyval == m_mainperf->m_key_snapshot_2 ) m_mainperf->unset_sequence_control_status( c_status_snapshot ); if ( a_ev->keyval == m_mainperf->m_key_group_learn ){ m_mainperf->unset_mode_group_learn(); } return false; } void mainwnd::edit_callback_notepad( ) { string text = m_entry_notes->get_text(); m_mainperf->set_screen_set_notepad( m_mainperf->get_screenset(), &text ); m_modified = true; } bool mainwnd::on_key_press_event(GdkEventKey* a_ev) { Gtk::Window::on_key_press_event(a_ev); // control and modifier key combinations matching if ( a_ev->type == GDK_KEY_PRESS ){ if ( global_print_keys ){ printf( "key_press[%d]\n", a_ev->keyval ); fflush( stdout ); } if ( a_ev->keyval == m_mainperf->m_key_bpm_dn ){ m_mainperf->set_bpm( m_mainperf->get_bpm() - 1 ); m_adjust_bpm->set_value( m_mainperf->get_bpm() ); } if ( a_ev->keyval == m_mainperf->m_key_bpm_up ){ m_mainperf->set_bpm( m_mainperf->get_bpm() + 1 ); m_adjust_bpm->set_value( m_mainperf->get_bpm() ); } if ( a_ev->keyval == m_mainperf->m_key_replace ) { m_mainperf->set_sequence_control_status( c_status_replace ); } if ((a_ev->keyval == m_mainperf->m_key_queue ) || (a_ev->keyval == m_mainperf->m_key_keep_queue )) { m_mainperf->set_sequence_control_status( c_status_queue ); } if ( a_ev->keyval == m_mainperf->m_key_snapshot_1 || a_ev->keyval == m_mainperf->m_key_snapshot_2 ) { m_mainperf->set_sequence_control_status( c_status_snapshot ); } if ( a_ev->keyval == m_mainperf->m_key_screenset_dn ){ m_mainperf->set_screenset( m_mainperf->get_screenset() - 1 ); m_main_wid->set_screenset( m_mainperf->get_screenset() ); m_adjust_ss->set_value( m_mainperf->get_screenset() ); m_entry_notes->set_text(*m_mainperf->get_screen_set_notepad( m_mainperf->get_screenset())); } if ( a_ev->keyval == m_mainperf->m_key_screenset_up ){ m_mainperf->set_screenset( m_mainperf->get_screenset() + 1 ); m_main_wid->set_screenset( m_mainperf->get_screenset() ); m_adjust_ss->set_value( m_mainperf->get_screenset() ); m_entry_notes->set_text(*m_mainperf->get_screen_set_notepad( m_mainperf->get_screenset())); } if ( a_ev->keyval == m_mainperf->m_key_set_playing_screenset ){ m_mainperf->set_playing_screenset(); } if ( a_ev->keyval == m_mainperf->m_key_group_on ){ m_mainperf->set_mode_group_mute(); } if ( a_ev->keyval == m_mainperf->m_key_group_off ){ m_mainperf->unset_mode_group_mute(); } if ( a_ev->keyval == m_mainperf->m_key_group_learn ){ m_mainperf->set_mode_group_learn(); } // activate mute group key if (m_mainperf->get_key_groups()->count( a_ev->keyval ) != 0 ) { m_mainperf->select_and_mute_group( m_mainperf->lookup_keygroup_group(a_ev->keyval)); } // mute group learn if (m_mainperf->is_learn_mode() && a_ev->keyval != m_mainperf->m_key_group_learn) { if( m_mainperf->get_key_groups()->count( a_ev->keyval ) != 0 ) { std::ostringstream os; os << "Key \"" << gdk_keyval_name(a_ev->keyval) << "\" (code = " << a_ev->keyval << ") successfully mapped."; Gtk::MessageDialog dialog(*this, "MIDI mute group learn success", false, Gtk::MESSAGE_INFO, Gtk::BUTTONS_OK, true); dialog.set_secondary_text(os.str(), false); dialog.run(); // we miss the keyup msg for learn, force set it off m_mainperf->unset_mode_group_learn(); } else { std::ostringstream os; os << "Key \"" << gdk_keyval_name(a_ev->keyval) << "\" (code = " << a_ev->keyval << ") is not one of the configured mute-group keys.\n" << "To change this see File/Options menu or .seq24rc"; Gtk::MessageDialog dialog(*this, "MIDI mute group learn failed", false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true); dialog.set_secondary_text(os.str(), false); dialog.run(); // we miss the keyup msg for learn, force set it m_mainperf->unset_mode_group_learn(); } } // the start/end key may be the same key (i.e. SPACE) // allow toggling when the same key is mapped to both // triggers (i.e. SPACEBAR) bool dont_toggle = m_mainperf->m_key_start != m_mainperf->m_key_stop; if ( a_ev->keyval == m_mainperf->m_key_start && (dont_toggle || !is_pattern_playing)) { start_playing(); } else if ( a_ev->keyval == m_mainperf->m_key_stop && (dont_toggle || is_pattern_playing)) { stop_playing(); } /* toggle sequence mute/unmute using keyboard keys... */ if (m_mainperf->get_key_events()->count( a_ev->keyval) != 0) { sequence_key(m_mainperf->lookup_keyevent_seq( a_ev->keyval)); } } return false; } void mainwnd::sequence_key( int a_seq ) { int offset = m_mainperf->get_screenset() * c_mainwnd_rows * c_mainwnd_cols; if ( m_mainperf->is_active( a_seq + offset ) ){ m_mainperf->sequence_playing_toggle( a_seq + offset ); } } void mainwnd::update_window_title() { std::string title; if (global_filename == "") title = ( PACKAGE ) + string( " - [unnamed]" ); else title = ( PACKAGE ) + string( " - [" ) + Glib::filename_to_utf8(global_filename) + string( "]" ); set_title ( title.c_str()); } bool mainwnd::is_modified() { return m_modified; } int mainwnd::m_sigpipe[2]; /* Handler for system signals (SIGUSR1, SIGINT...) * Write a message to the pipe and leave as soon as possible */ void mainwnd::handle_signal(int sig) { if (write(m_sigpipe[1], &sig, sizeof(sig)) == -1) { printf("write() failed: %s\n", std::strerror(errno)); } } bool mainwnd::install_signal_handlers() { /*install pipe to forward received system signals*/ if (pipe(m_sigpipe) < 0) { printf("pipe() failed: %s\n", std::strerror(errno)); return false; } /*install notifier to handle pipe messages*/ Glib::signal_io().connect(sigc::mem_fun(*this, &mainwnd::signal_action), m_sigpipe[0], Glib::IO_IN); /*install signal handlers*/ struct sigaction action; memset(&action, 0, sizeof(action)); action.sa_handler = handle_signal; if (sigaction(SIGUSR1, &action, NULL) == -1) { printf("sigaction() failed: %s\n", std::strerror(errno)); return false; } if (sigaction(SIGINT, &action, NULL) == -1) { printf("sigaction() failed: %s\n", std::strerror(errno)); return false; } return true; } bool mainwnd::signal_action(Glib::IOCondition condition) { int message; if ((condition & Glib::IO_IN) == 0) { printf("Error: unexpected IO condition\n"); return false; } if (read(m_sigpipe[0], &message, sizeof(message)) == -1) { printf("read() failed: %s\n", std::strerror(errno)); return false; } switch (message) { case SIGUSR1: save_file(); break; case SIGINT: file_exit(); break; default: printf("Unexpected signal received: %d\n", message); break; } return true; } seq24-0.9.3/src/optionsfile.h0000644000175000017500000000216212651156360012703 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #pragma once #include "perform.h" #include "configfile.h" class optionsfile : public configfile { public: optionsfile(const Glib::ustring& a_name); bool parse( perform *a_perf ); bool write( perform *a_perf ); }; seq24-0.9.3/src/Module.am0000644000175000017500000000271112651157714011747 00000000000000# Makefile.am for seq24 include %D%/pixmaps/Module.am AM_CXXFLAGS = $(GTKMM_CFLAGS) $(JACK_CFLAGS) $(LASH_CFLAGS) -Wall %C%_seq24_LDADD = $(GTKMM_LIBS) $(ALSA_LIBS) $(JACK_LIBS) $(LASH_LIBS) bin_PROGRAMS = %D%/seq24 %C%_seq24_SOURCES = \ %D%/configfile.cpp \ %D%/controllers.h \ %D%/event.cpp \ %D%/font.cpp \ %D%/font.h \ %D%/globals.h \ %D%/keybindentry.cpp \ %D%/lash.cpp \ %D%/configfile.h \ %D%/event.h \ %D%/keybindentry.h \ %D%/lash.h \ %D%/maintime.cpp \ %D%/maintime.h \ %D%/mainwid.cpp \ %D%/mainwid.h \ %D%/mainwnd.cpp \ %D%/mainwnd.h \ %D%/midibus.cpp \ %D%/midibus.h \ %D%/midibus_portmidi.cpp \ %D%/midibus_portmidi.h \ %D%/midifile.cpp \ %D%/midifile.h \ %D%/mutex.cpp \ %D%/mutex.h \ %D%/options.cpp \ %D%/options.h \ %D%/optionsfile.cpp \ %D%/optionsfile.h \ %D%/perfedit.cpp \ %D%/perfedit.h \ %D%/perfnames.cpp \ %D%/perfnames.h \ %D%/perform.cpp \ %D%/perform.h \ %D%/perfroll.cpp \ %D%/perfroll.h \ %D%/perfroll_input.cpp \ %D%/perfroll_input.h \ %D%/perftime.cpp \ %D%/perftime.h \ %D%/seq24.cpp \ %D%/seqdata.cpp \ %D%/seqdata.h \ %D%/seqedit.cpp \ %D%/seqedit.h \ %D%/seqevent.cpp \ %D%/seqevent.h \ %D%/seqkeys.cpp \ %D%/seqkeys.h \ %D%/seqmenu.cpp \ %D%/seqmenu.h \ %D%/seqroll.cpp \ %D%/seqroll.h \ %D%/seqtime.cpp \ %D%/seqtime.h \ %D%/sequence.cpp \ %D%/sequence.h \ %D%/userfile.cpp \ %D%/userfile.h EXTRA_DIST += %D%/configwin32.h seq24-0.9.3/src/seqedit.cpp0000644000175000017500000014616712651156360012357 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #include "seqedit.h" #include "sequence.h" #include "midibus.h" #include "controllers.h" #include "event.h" #include "options.h" #include "pixmaps/play.xpm" #include "pixmaps/q_rec.xpm" #include "pixmaps/rec.xpm" #include "pixmaps/thru.xpm" #include "pixmaps/bus.xpm" #include "pixmaps/midi.xpm" #include "pixmaps/snap.xpm" #include "pixmaps/zoom.xpm" #include "pixmaps/length.xpm" #include "pixmaps/scale.xpm" #include "pixmaps/key.xpm" #include "pixmaps/down.xpm" #include "pixmaps/note_length.xpm" #include "pixmaps/undo.xpm" #include "pixmaps/redo.xpm" #include "pixmaps/quanize.xpm" #include "pixmaps/menu_empty.xpm" #include "pixmaps/menu_full.xpm" #include "pixmaps/sequences.xpm" #include "pixmaps/tools.xpm" #include "pixmaps/seq-editor.xpm" // tooltip helper, for old vs new gtk... #if GTK_MINOR_VERSION >= 12 # define add_tooltip( obj, text ) obj->set_tooltip_text( text); #else # define add_tooltip( obj, text ) m_tooltips->set_tip( *obj, text ); #endif int seqedit::m_initial_zoom = 2; int seqedit::m_initial_snap = c_ppqn / 4; int seqedit::m_initial_note_length = c_ppqn / 4; int seqedit::m_initial_scale = 0; int seqedit::m_initial_key = 0; int seqedit::m_initial_sequence = -1; // Actions const int select_all_notes = 1; const int select_all_events = 2; const int select_inverse_notes = 3; const int select_inverse_events = 4; const int quantize_notes = 5; const int quantize_events = 6; const int tighten_events = 8; const int tighten_notes = 9; const int transpose = 10; const int transpose_h = 12; /* connects to a menu item, tells the performance to launch the timer thread */ void seqedit::menu_action_quantise() { } seqedit::seqedit( sequence *a_seq, perform *a_perf, // mainwid *a_mainwid, int a_pos ) : /* set the performance */ m_seq(a_seq), m_mainperf(a_perf), // m_mainwid(a_mainwid), m_pos(a_pos), m_zoom(m_initial_zoom), m_snap(m_initial_snap), m_note_length(m_initial_note_length), m_scale(m_initial_scale), m_key(m_initial_key), m_sequence(m_initial_sequence) { set_icon(Gdk::Pixbuf::create_from_xpm_data(seq_editor_xpm)); /* main window */ std::string title = "seq24 - "; title.append(m_seq->get_name()); set_title(title); set_size_request(700, 500); m_seq->set_editing( true ); /* scroll bars */ m_vadjust = manage( new Adjustment(55,0, c_num_keys, 1,1,1 )); m_hadjust = manage( new Adjustment(0, 0, 1, 1,1,1 )); m_vscroll_new = manage(new VScrollbar( *m_vadjust )); m_hscroll_new = manage(new HScrollbar( *m_hadjust )); /* get some new objects */ m_seqkeys_wid = manage( new seqkeys( m_seq, m_vadjust )); m_seqtime_wid = manage( new seqtime( m_seq, m_zoom, m_hadjust )); m_seqdata_wid = manage( new seqdata( m_seq, m_zoom, m_hadjust)); m_seqevent_wid = manage( new seqevent( m_seq, m_zoom, m_snap, m_seqdata_wid, m_hadjust)); m_seqroll_wid = manage( new seqroll( m_mainperf, m_seq, m_zoom, m_snap, m_seqdata_wid, m_seqevent_wid, m_seqkeys_wid, m_pos, m_hadjust, m_vadjust )); /* menus */ m_menubar = manage( new MenuBar()); m_menu_tools = manage( new Menu() ); m_menu_zoom = manage( new Menu()); m_menu_snap = manage( new Menu()); m_menu_note_length = manage( new Menu()); m_menu_length = manage( new Menu()); m_menu_bpm = manage( new Menu() ); m_menu_bw = manage( new Menu() ); m_menu_rec_vol = manage( new Menu() ); m_menu_midich = NULL; m_menu_midibus = NULL; m_menu_sequences = NULL; m_menu_key = manage( new Menu()); m_menu_scale = manage( new Menu()); m_menu_data = NULL; create_menus(); /* tooltips */ m_tooltips = manage( new Tooltips( ) ); /* init table, viewports and scroll bars */ m_table = manage( new Table( 7, 4, false)); m_vbox = manage( new VBox( false, 2 )); m_hbox = manage( new HBox( false, 2 )); m_hbox2 = manage( new HBox( false, 2 )); m_hbox3 = manage( new HBox( false, 2 )); HBox *dhbox = manage( new HBox( false, 2 )); m_vbox->set_border_width( 2 ); /* fill table */ m_table->attach( *m_seqkeys_wid, 0, 1, 1, 2, Gtk::SHRINK, Gtk::FILL ); m_table->attach( *m_seqtime_wid, 1, 2, 0, 1, Gtk::FILL, Gtk::SHRINK ); m_table->attach( *m_seqroll_wid , 1, 2, 1, 2, Gtk::FILL | Gtk::SHRINK, Gtk::FILL | Gtk::SHRINK ); m_table->attach( *m_seqevent_wid, 1, 2, 2, 3, Gtk::FILL, Gtk::SHRINK ); m_table->attach( *m_seqdata_wid, 1, 2, 3, 4, Gtk::FILL, Gtk::SHRINK ); m_table->attach( *dhbox, 1, 2, 4, 5, Gtk::FILL | Gtk::EXPAND, Gtk::SHRINK, 0, 2 ); m_table->attach( *m_vscroll_new, 2, 3, 1, 2, Gtk::SHRINK, Gtk::FILL | Gtk::EXPAND ); m_table->attach( *m_hscroll_new, 1, 2, 5, 6, Gtk::FILL | Gtk::EXPAND, Gtk::SHRINK ); /* no expand, just fit the widgets */ /* m_vbox->pack_start(*m_menubar, false, false, 0); */ m_vbox->pack_start(*m_hbox, false, false, 0); m_vbox->pack_start(*m_hbox2, false, false, 0); m_vbox->pack_start(*m_hbox3, false, false, 0); /* exapand, cause rollview expands */ m_vbox->pack_start(*m_table, true, true, 0); /* data button */ m_button_data = manage( new Button( " Event " )); m_button_data->signal_clicked().connect( mem_fun( *this, &seqedit::popup_event_menu)); m_entry_data = manage( new Entry( )); m_entry_data->set_size_request(40,-1); m_entry_data->set_editable( false ); dhbox->pack_start( *m_button_data, false, false ); dhbox->pack_start( *m_entry_data, true, true ); /* play, rec, thru */ m_toggle_play = manage( new ToggleButton() ); m_toggle_play->add( *manage( new Image(Gdk::Pixbuf::create_from_xpm_data( play_xpm )))); m_toggle_play->signal_clicked().connect( mem_fun( *this, &seqedit::play_change_callback)); add_tooltip( m_toggle_play, "Sequence dumps data to midi bus." ); m_toggle_record = manage( new ToggleButton( )); m_toggle_record->add( *manage( new Image(Gdk::Pixbuf::create_from_xpm_data( rec_xpm )))); m_toggle_record->signal_clicked().connect( mem_fun( *this, &seqedit::record_change_callback)); add_tooltip( m_toggle_record, "Records incoming midi data." ); m_toggle_q_rec = manage( new ToggleButton( )); m_toggle_q_rec->add( *manage( new Image(Gdk::Pixbuf::create_from_xpm_data( q_rec_xpm )))); m_toggle_q_rec->signal_clicked().connect( mem_fun( *this, &seqedit::q_rec_change_callback)); add_tooltip( m_toggle_q_rec, "Quantized Record." ); m_button_rec_vol = manage( new Button()); m_button_rec_vol->add( *manage( new Label("Vol"))); m_button_rec_vol->signal_clicked().connect( sigc::bind( mem_fun( *this, &seqedit::popup_menu), m_menu_rec_vol )); add_tooltip( m_button_rec_vol, "Select recording volume" ); m_toggle_thru = manage( new ToggleButton( )); m_toggle_thru->add( *manage( new Image(Gdk::Pixbuf::create_from_xpm_data( thru_xpm )))); m_toggle_thru->signal_clicked().connect( mem_fun( *this, &seqedit::thru_change_callback)); add_tooltip( m_toggle_thru, "Incoming midi data passes " "thru to sequences midi bus and channel." ); m_toggle_play->set_active( m_seq->get_playing()); m_toggle_record->set_active( m_seq->get_recording()); m_toggle_thru->set_active( m_seq->get_thru()); dhbox->pack_end( *m_button_rec_vol, false, false, 4); dhbox->pack_end( *m_toggle_q_rec, false, false, 4); dhbox->pack_end( *m_toggle_record, false, false, 4); dhbox->pack_end( *m_toggle_thru, false, false, 4); dhbox->pack_end( *m_toggle_play, false, false, 4); dhbox->pack_end( *(manage(new VSeparator( ))), false, false, 4); fill_top_bar(); /* add table */ this->add( *m_vbox ); /* show everything */ show_all(); /* sets scroll bar to the middle */ //gfloat middle = m_vscroll->get_adjustment()->get_upper() / 3; //m_vscroll->get_adjustment()->set_value(middle); m_seqroll_wid->set_ignore_redraw(true); set_zoom( m_zoom ); set_snap( m_snap ); set_note_length( m_note_length ); set_background_sequence( m_sequence ); set_bpm( m_seq->get_bpm() ); set_bw( m_seq->get_bw() ); set_measures( get_measures() ); set_midi_channel( m_seq->get_midi_channel() ); set_midi_bus( m_seq->get_midi_bus() ); set_data_type( EVENT_NOTE_ON ); set_scale( m_scale ); set_key( m_key ); m_seqroll_wid->set_ignore_redraw(false); add_events(Gdk::SCROLL_MASK); } void seqedit::create_menus() { using namespace Menu_Helpers; char b[20]; /* zoom */ for (int i = c_min_zoom; i <= c_max_zoom; i*=2) { snprintf(b, sizeof(b), "1:%d", i); m_menu_zoom->items().push_back(MenuElem(b, sigc::bind(mem_fun(*this, &seqedit::set_zoom), i ))); } /* note snap */ m_menu_snap->items().push_back(MenuElem("1", sigc::bind(mem_fun(*this, &seqedit::set_snap), c_ppqn * 4 ))); m_menu_snap->items().push_back(MenuElem("1/2", sigc::bind(mem_fun(*this, &seqedit::set_snap), c_ppqn * 2 ))); m_menu_snap->items().push_back(MenuElem("1/4", sigc::bind(mem_fun(*this, &seqedit::set_snap), c_ppqn * 1 ))); m_menu_snap->items().push_back(MenuElem("1/8", sigc::bind(mem_fun(*this, &seqedit::set_snap), c_ppqn / 2 ))); m_menu_snap->items().push_back(MenuElem("1/16", sigc::bind(mem_fun(*this, &seqedit::set_snap), c_ppqn / 4 ))); m_menu_snap->items().push_back(MenuElem("1/32", sigc::bind(mem_fun(*this, &seqedit::set_snap), c_ppqn / 8 ))); m_menu_snap->items().push_back(MenuElem("1/64", sigc::bind(mem_fun(*this, &seqedit::set_snap), c_ppqn / 16 ))); m_menu_snap->items().push_back(MenuElem("1/128", sigc::bind(mem_fun(*this, &seqedit::set_snap), c_ppqn / 32 ))); m_menu_snap->items().push_back(SeparatorElem()); m_menu_snap->items().push_back(MenuElem("1/3", sigc::bind(mem_fun(*this, &seqedit::set_snap), c_ppqn * 4 / 3 ))); m_menu_snap->items().push_back(MenuElem("1/6", sigc::bind(mem_fun(*this, &seqedit::set_snap), c_ppqn * 2 / 3 ))); m_menu_snap->items().push_back(MenuElem("1/12", sigc::bind(mem_fun(*this, &seqedit::set_snap), c_ppqn * 1 / 3 ))); m_menu_snap->items().push_back(MenuElem("1/24", sigc::bind(mem_fun(*this, &seqedit::set_snap), c_ppqn / 2 / 3 ))); m_menu_snap->items().push_back(MenuElem("1/48", sigc::bind(mem_fun(*this, &seqedit::set_snap), c_ppqn / 4 / 3 ))); m_menu_snap->items().push_back(MenuElem("1/96", sigc::bind(mem_fun(*this, &seqedit::set_snap), c_ppqn / 8 / 3 ))); m_menu_snap->items().push_back(MenuElem("1/192", sigc::bind(mem_fun(*this, &seqedit::set_snap), c_ppqn / 16 / 3 ))); /* note note_length */ m_menu_note_length->items().push_back(MenuElem("1", sigc::bind(mem_fun(*this, &seqedit::set_note_length), c_ppqn * 4 ))); m_menu_note_length->items().push_back(MenuElem("1/2", sigc::bind(mem_fun(*this, &seqedit::set_note_length), c_ppqn * 2 ))); m_menu_note_length->items().push_back(MenuElem("1/4", sigc::bind(mem_fun(*this, &seqedit::set_note_length), c_ppqn * 1 ))); m_menu_note_length->items().push_back(MenuElem("1/8", sigc::bind(mem_fun(*this, &seqedit::set_note_length), c_ppqn / 2 ))); m_menu_note_length->items().push_back(MenuElem("1/16", sigc::bind(mem_fun(*this, &seqedit::set_note_length), c_ppqn / 4 ))); m_menu_note_length->items().push_back(MenuElem("1/32", sigc::bind(mem_fun(*this, &seqedit::set_note_length), c_ppqn / 8 ))); m_menu_note_length->items().push_back(MenuElem("1/64", sigc::bind(mem_fun(*this, &seqedit::set_note_length), c_ppqn / 16 ))); m_menu_note_length->items().push_back(MenuElem("1/128", sigc::bind(mem_fun(*this, &seqedit::set_note_length), c_ppqn / 32 ))); m_menu_note_length->items().push_back(SeparatorElem()); m_menu_note_length->items().push_back(MenuElem("1/3", sigc::bind(mem_fun(*this, &seqedit::set_note_length), c_ppqn * 4 / 3 ))); m_menu_note_length->items().push_back(MenuElem("1/6", sigc::bind(mem_fun(*this, &seqedit::set_note_length), c_ppqn * 2 / 3 ))); m_menu_note_length->items().push_back(MenuElem("1/12", sigc::bind(mem_fun(*this, &seqedit::set_note_length), c_ppqn * 1 / 3 ))); m_menu_note_length->items().push_back(MenuElem("1/24", sigc::bind(mem_fun(*this, &seqedit::set_note_length), c_ppqn / 2 / 3 ))); m_menu_note_length->items().push_back(MenuElem("1/48", sigc::bind(mem_fun(*this, &seqedit::set_note_length), c_ppqn / 4 / 3 ))); m_menu_note_length->items().push_back(MenuElem("1/96", sigc::bind(mem_fun(*this, &seqedit::set_note_length), c_ppqn / 8 / 3 ))); m_menu_note_length->items().push_back(MenuElem("1/192", sigc::bind(mem_fun(*this, &seqedit::set_note_length), c_ppqn / 16 / 3 ))); /* Key */ m_menu_key->items().push_back(MenuElem( c_key_text[0], sigc::bind(mem_fun(*this, &seqedit::set_key), 0 ))); m_menu_key->items().push_back(MenuElem( c_key_text[1], sigc::bind(mem_fun(*this, &seqedit::set_key), 1 ))); m_menu_key->items().push_back(MenuElem( c_key_text[2], sigc::bind(mem_fun(*this, &seqedit::set_key), 2 ))); m_menu_key->items().push_back(MenuElem( c_key_text[3], sigc::bind(mem_fun(*this, &seqedit::set_key), 3 ))); m_menu_key->items().push_back(MenuElem( c_key_text[4], sigc::bind(mem_fun(*this, &seqedit::set_key), 4 ))); m_menu_key->items().push_back(MenuElem( c_key_text[5], sigc::bind(mem_fun(*this, &seqedit::set_key), 5 ))); m_menu_key->items().push_back(MenuElem( c_key_text[6], sigc::bind(mem_fun(*this, &seqedit::set_key), 6 ))); m_menu_key->items().push_back(MenuElem( c_key_text[7], sigc::bind(mem_fun(*this, &seqedit::set_key), 7 ))); m_menu_key->items().push_back(MenuElem( c_key_text[8], sigc::bind(mem_fun(*this, &seqedit::set_key), 8 ))); m_menu_key->items().push_back(MenuElem( c_key_text[9], sigc::bind(mem_fun(*this, &seqedit::set_key), 9 ))); m_menu_key->items().push_back(MenuElem( c_key_text[10], sigc::bind(mem_fun(*this, &seqedit::set_key), 10 ))); m_menu_key->items().push_back(MenuElem( c_key_text[11], sigc::bind(mem_fun(*this, &seqedit::set_key), 11 ))); /* bw */ m_menu_bw->items().push_back(MenuElem("1", sigc::bind(mem_fun(*this, &seqedit::set_bw), 1 ))); m_menu_bw->items().push_back(MenuElem("2", sigc::bind(mem_fun(*this, &seqedit::set_bw), 2 ))); m_menu_bw->items().push_back(MenuElem("4", sigc::bind(mem_fun(*this, &seqedit::set_bw), 4 ))); m_menu_bw->items().push_back(MenuElem("8", sigc::bind(mem_fun(*this, &seqedit::set_bw), 8 ))); m_menu_bw->items().push_back(MenuElem("16", sigc::bind(mem_fun(*this, &seqedit::set_bw), 16 ))); /* record volume */ m_menu_rec_vol->items().push_back(MenuElem("Free", sigc::bind(mem_fun(*this, &seqedit::set_rec_vol), 0))); m_menu_rec_vol->items().push_back(MenuElem("Fixed 8", sigc::bind(mem_fun(*this, &seqedit::set_rec_vol), 127))); m_menu_rec_vol->items().push_back(MenuElem("Fixed 7", sigc::bind(mem_fun(*this, &seqedit::set_rec_vol), 111))); m_menu_rec_vol->items().push_back(MenuElem("Fixed 6", sigc::bind(mem_fun(*this, &seqedit::set_rec_vol), 95))); m_menu_rec_vol->items().push_back(MenuElem("Fixed 5", sigc::bind(mem_fun(*this, &seqedit::set_rec_vol), 79))); m_menu_rec_vol->items().push_back(MenuElem("Fixed 4", sigc::bind(mem_fun(*this, &seqedit::set_rec_vol), 63))); m_menu_rec_vol->items().push_back(MenuElem("Fixed 3", sigc::bind(mem_fun(*this, &seqedit::set_rec_vol), 47))); m_menu_rec_vol->items().push_back(MenuElem("Fixed 2", sigc::bind(mem_fun(*this, &seqedit::set_rec_vol), 31))); m_menu_rec_vol->items().push_back(MenuElem("Fixed 1", sigc::bind(mem_fun(*this, &seqedit::set_rec_vol), 15))); /* music scale */ m_menu_scale->items().push_back(MenuElem(c_scales_text[0], sigc::bind(mem_fun(*this, &seqedit::set_scale), c_scale_off ))); m_menu_scale->items().push_back(MenuElem(c_scales_text[1], sigc::bind(mem_fun(*this, &seqedit::set_scale), c_scale_major ))); m_menu_scale->items().push_back(MenuElem(c_scales_text[2], sigc::bind(mem_fun(*this, &seqedit::set_scale), c_scale_minor ))); /* midi channel menu */ for( int i=0; i<16; i++ ){ snprintf(b, sizeof(b), "%d", i + 1); /* length */ m_menu_length->items().push_back(MenuElem(b, sigc::bind(mem_fun(*this, &seqedit::set_measures), i+1 ))); /* length */ m_menu_bpm->items().push_back(MenuElem(b, sigc::bind(mem_fun(*this, &seqedit::set_bpm), i+1 ))); } m_menu_length->items().push_back(MenuElem("32", sigc::bind(mem_fun(*this, &seqedit::set_measures), 32 ))); m_menu_length->items().push_back(MenuElem("64", sigc::bind(mem_fun(*this, &seqedit::set_measures), 64 ))); //m_menu_tools->items().push_back( SeparatorElem( )); } void seqedit::popup_tool_menu() { using namespace Menu_Helpers; m_menu_tools = manage( new Menu()); /* tools */ Menu *holder; Menu *holder2; holder = manage( new Menu()); holder->items().push_back( MenuElem( "All Notes", sigc::bind(mem_fun(*this, &seqedit::do_action), select_all_notes, 0))); holder->items().push_back( MenuElem( "Inverse Notes", sigc::bind(mem_fun(*this, &seqedit::do_action), select_inverse_notes, 0))); if ( m_editing_status != EVENT_NOTE_ON && m_editing_status != EVENT_NOTE_OFF ){ holder->items().push_back( SeparatorElem( )); holder->items().push_back( MenuElem( "All Events", sigc::bind(mem_fun(*this, &seqedit::do_action), select_all_events, 0))); holder->items().push_back( MenuElem( "Inverse Events", sigc::bind(mem_fun(*this, &seqedit::do_action), select_inverse_events, 0))); } m_menu_tools->items().push_back( MenuElem( "Select", *holder )); holder = manage( new Menu()); holder->items().push_back( MenuElem( "Quantize Selected Notes", sigc::bind(mem_fun(*this, &seqedit::do_action), quantize_notes, 0 ))); holder->items().push_back( MenuElem( "Tighten Selected Notes", sigc::bind(mem_fun(*this, &seqedit::do_action), tighten_notes,0 ))); if ( m_editing_status != EVENT_NOTE_ON && m_editing_status != EVENT_NOTE_OFF ){ holder->items().push_back( SeparatorElem( )); holder->items().push_back( MenuElem( "Quantize Selected Events", sigc::bind(mem_fun(*this, &seqedit::do_action), quantize_events,0 ))); holder->items().push_back( MenuElem( "Tighten Selected Events", sigc::bind(mem_fun(*this, &seqedit::do_action), tighten_events,0 ))); } m_menu_tools->items().push_back( MenuElem( "Modify Time", *holder )); holder = manage( new Menu()); char num[11]; holder2 = manage( new Menu()); for ( int i=-12; i<=12; ++i) { if (i != 0){ snprintf(num, sizeof(num), "%+d [%s]", i, c_interval_text[abs(i)]); holder2->items().push_front( MenuElem( num, sigc::bind(mem_fun(*this,&seqedit::do_action), transpose, i ))); } } holder->items().push_back( MenuElem( "Transpose Selected", *holder2)); holder2 = manage( new Menu()); for ( int i=-7; i<=7; ++i) { if (i != 0){ snprintf(num, sizeof(num), "%+d [%s]", (i<0) ? i-1 : i+1, c_chord_text[abs(i)]); holder2->items().push_front( MenuElem( num, sigc::bind(mem_fun(*this,&seqedit::do_action), transpose_h, i ))); } } if ( m_scale != 0 ){ holder->items().push_back( MenuElem( "Harmonic Transpose Selected", *holder2)); } m_menu_tools->items().push_back( MenuElem( "Modify Pitch", *holder )); m_menu_tools->popup(0,0); } void seqedit::do_action( int a_action, int a_var ) { switch (a_action) { case select_all_notes: m_seq->select_events(EVENT_NOTE_ON, 0); m_seq->select_events(EVENT_NOTE_OFF, 0); break; case select_all_events: m_seq->select_events(m_editing_status, m_editing_cc); break; case select_inverse_notes: m_seq->select_events(EVENT_NOTE_ON, 0, true); m_seq->select_events(EVENT_NOTE_OFF, 0, true); break; case select_inverse_events: m_seq->select_events(m_editing_status, m_editing_cc, true); break; // !!! m_seq->push_undo(); case quantize_notes: m_seq->push_undo(); m_seq->quanize_events(EVENT_NOTE_ON, 0, m_snap, 1 , true); break; case quantize_events: m_seq->push_undo(); m_seq->quanize_events(m_editing_status, m_editing_cc, m_snap, 1); break; case tighten_notes: m_seq->push_undo(); m_seq->quanize_events(EVENT_NOTE_ON, 0, m_snap, 2 , true); break; case tighten_events: m_seq->push_undo(); m_seq->quanize_events(m_editing_status, m_editing_cc, m_snap, 2); break; case transpose: m_seq->push_undo(); m_seq->transpose_notes(a_var, 0); break; case transpose_h: m_seq->push_undo(); m_seq->transpose_notes(a_var, m_scale); break; default: break; } m_seqroll_wid->redraw(); m_seqtime_wid->redraw(); m_seqdata_wid->redraw(); m_seqevent_wid->redraw(); } void seqedit::fill_top_bar() { /* name */ m_entry_name = manage( new Entry( )); m_entry_name->set_max_length(26); m_entry_name->set_width_chars(26); m_entry_name->set_text( m_seq->get_name()); m_entry_name->select_region(0,0); m_entry_name->set_position(0); m_entry_name->signal_changed().connect( mem_fun( *this, &seqedit::name_change_callback)); m_hbox->pack_start( *m_entry_name, true, true ); m_hbox->pack_start( *(manage(new VSeparator( ))), false, false, 4); /* beats per measure */ m_button_bpm = manage( new Button()); m_button_bpm->add( *manage( new Image(Gdk::Pixbuf::create_from_xpm_data( down_xpm )))); m_button_bpm->signal_clicked().connect( sigc::bind( mem_fun( *this, &seqedit::popup_menu), m_menu_bpm )); add_tooltip( m_button_bpm, "Time Signature. Beats per Measure" ); m_entry_bpm = manage( new Entry()); m_entry_bpm->set_width_chars(2); m_entry_bpm->set_editable( false ); m_hbox->pack_start( *m_button_bpm , false, false ); m_hbox->pack_start( *m_entry_bpm , false, false ); m_hbox->pack_start( *(manage(new Label( "/" ))), false, false, 4); /* beat width */ m_button_bw = manage( new Button()); m_button_bw->add( *manage( new Image(Gdk::Pixbuf::create_from_xpm_data( down_xpm )))); m_button_bw->signal_clicked().connect( sigc::bind( mem_fun( *this, &seqedit::popup_menu), m_menu_bw )); add_tooltip( m_button_bw, "Time Signature. Length of Beat" ); m_entry_bw = manage( new Entry()); m_entry_bw->set_width_chars(2); m_entry_bw->set_editable( false ); m_hbox->pack_start( *m_button_bw , false, false ); m_hbox->pack_start( *m_entry_bw , false, false ); /* length */ m_button_length = manage( new Button()); m_button_length->add( *manage( new Image(Gdk::Pixbuf::create_from_xpm_data( length_xpm )))); m_button_length->signal_clicked().connect( sigc::bind( mem_fun( *this, &seqedit::popup_menu), m_menu_length )); add_tooltip( m_button_length, "Sequence length in Bars." ); m_entry_length = manage( new Entry()); m_entry_length->set_width_chars(2); m_entry_length->set_editable( false ); m_hbox->pack_start( *m_button_length , false, false ); m_hbox->pack_start( *m_entry_length , false, false ); m_hbox->pack_start( *(manage(new VSeparator( ))), false, false, 4); /* midi bus */ m_button_bus = manage( new Button()); m_button_bus->add( *manage( new Image(Gdk::Pixbuf::create_from_xpm_data( bus_xpm )))); m_button_bus->signal_clicked().connect( mem_fun( *this, &seqedit::popup_midibus_menu)); add_tooltip( m_button_bus, "Select Output Bus." ); m_entry_bus = manage( new Entry()); m_entry_bus->set_max_length(60); m_entry_bus->set_width_chars(60); m_entry_bus->set_editable( false ); m_hbox->pack_start( *m_button_bus , false, false ); m_hbox->pack_start( *m_entry_bus , true, true ); /* midi channel */ m_button_channel = manage( new Button()); m_button_channel->add( *manage( new Image(Gdk::Pixbuf::create_from_xpm_data( midi_xpm )))); m_button_channel->signal_clicked().connect( mem_fun( *this, &seqedit::popup_midich_menu )); add_tooltip( m_button_channel, "Select Midi channel." ); m_entry_channel = manage( new Entry()); m_entry_channel->set_width_chars(2); m_entry_channel->set_editable( false ); m_hbox->pack_start( *m_button_channel , false, false ); m_hbox->pack_start( *m_entry_channel , false, false ); /* undo */ m_button_undo = manage( new Button()); m_button_undo->add( *manage( new Image(Gdk::Pixbuf::create_from_xpm_data( undo_xpm )))); m_button_undo->signal_clicked().connect( mem_fun( *this, &seqedit::undo_callback)); add_tooltip( m_button_undo, "Undo." ); m_hbox2->pack_start( *m_button_undo , false, false ); /* redo */ m_button_redo = manage( new Button()); m_button_redo->add( *manage( new Image(Gdk::Pixbuf::create_from_xpm_data( redo_xpm )))); m_button_redo->signal_clicked().connect( mem_fun( *this, &seqedit::redo_callback)); add_tooltip( m_button_redo, "Redo." ); m_hbox2->pack_start( *m_button_redo , false, false ); /* quantize shortcut */ m_button_quanize = manage( new Button()); m_button_quanize->add( *manage( new Image(Gdk::Pixbuf::create_from_xpm_data( quanize_xpm )))); m_button_quanize->signal_clicked().connect( sigc::bind(mem_fun(*this, &seqedit::do_action), quantize_notes, 0)); add_tooltip( m_button_quanize, "Quantize Selection." ); m_hbox2->pack_start( *m_button_quanize , false, false ); m_hbox2->pack_start( *(manage(new VSeparator( ))), false, false, 4); /* tools button */ m_button_tools = manage( new Button( )); m_button_tools->add( *manage( new Image(Gdk::Pixbuf::create_from_xpm_data( tools_xpm )))); m_button_tools->signal_clicked().connect( mem_fun( *this, &seqedit::popup_tool_menu )); m_tooltips->set_tip( *m_button_tools, "Tools." ); m_hbox2->pack_start( *m_button_tools , false, false ); m_hbox2->pack_start( *(manage(new VSeparator( ))), false, false, 4); /* snap */ m_button_snap = manage( new Button()); m_button_snap->add( *manage( new Image(Gdk::Pixbuf::create_from_xpm_data( snap_xpm )))); m_button_snap->signal_clicked().connect( sigc::bind( mem_fun( *this, &seqedit::popup_menu), m_menu_snap )); add_tooltip( m_button_snap, "Grid snap." ); m_entry_snap = manage( new Entry()); m_entry_snap->set_width_chars(5); m_entry_snap->set_editable( false ); m_hbox2->pack_start( *m_button_snap , false, false ); m_hbox2->pack_start( *m_entry_snap , false, false ); /* note_length */ m_button_note_length = manage( new Button()); m_button_note_length->add( *manage( new Image(Gdk::Pixbuf::create_from_xpm_data( note_length_xpm )))); m_button_note_length->signal_clicked().connect( sigc::bind( mem_fun( *this, &seqedit::popup_menu), m_menu_note_length )); add_tooltip( m_button_note_length, "Note Length." ); m_entry_note_length = manage( new Entry()); m_entry_note_length->set_width_chars(5); m_entry_note_length->set_editable( false ); m_hbox2->pack_start( *m_button_note_length , false, false ); m_hbox2->pack_start( *m_entry_note_length , false, false ); /* zoom */ m_button_zoom = manage( new Button()); m_button_zoom->add( *manage( new Image(Gdk::Pixbuf::create_from_xpm_data( zoom_xpm )))); m_button_zoom->signal_clicked().connect( sigc::bind( mem_fun( *this, &seqedit::popup_menu), m_menu_zoom )); add_tooltip( m_button_zoom, "Zoom. Pixels to Ticks" ); m_entry_zoom = manage( new Entry()); m_entry_zoom->set_width_chars(4); m_entry_zoom->set_editable( false ); m_hbox2->pack_start( *m_button_zoom , false, false ); m_hbox2->pack_start( *m_entry_zoom , false, false ); m_hbox2->pack_start( *(manage(new VSeparator( ))), false, false, 4); /* key */ m_button_key = manage( new Button()); m_button_key->add( *manage( new Image(Gdk::Pixbuf::create_from_xpm_data( key_xpm )))); m_button_key->signal_clicked().connect( sigc::bind( mem_fun( *this, &seqedit::popup_menu), m_menu_key )); add_tooltip( m_button_key, "Key of Sequence" ); m_entry_key = manage( new Entry()); m_entry_key->set_width_chars(5); m_entry_key->set_editable( false ); m_hbox2->pack_start( *m_button_key , false, false ); m_hbox2->pack_start( *m_entry_key , false, false ); /* music scale */ m_button_scale = manage( new Button()); m_button_scale->add( *manage( new Image(Gdk::Pixbuf::create_from_xpm_data( scale_xpm )))); m_button_scale->signal_clicked().connect( sigc::bind( mem_fun( *this, &seqedit::popup_menu), m_menu_scale )); add_tooltip( m_button_scale, "Musical Scale" ); m_entry_scale = manage( new Entry()); m_entry_scale->set_width_chars(5); m_entry_scale->set_editable( false ); m_hbox2->pack_start( *m_button_scale , false, false ); m_hbox2->pack_start( *m_entry_scale , false, false ); m_hbox2->pack_start( *(manage(new VSeparator( ))), false, false, 4); /* background sequence */ m_button_sequence = manage( new Button()); m_button_sequence->add( *manage( new Image(Gdk::Pixbuf::create_from_xpm_data( sequences_xpm )))); m_button_sequence->signal_clicked().connect( mem_fun( *this, &seqedit::popup_sequence_menu)); add_tooltip( m_button_sequence, "Background Sequence" ); m_entry_sequence = manage( new Entry()); m_entry_sequence->set_width_chars(14); m_entry_sequence->set_editable( false ); m_hbox2->pack_start( *m_button_sequence , false, false ); m_hbox2->pack_start( *m_entry_sequence , true, true ); #if 0 /* Select */ m_radio_select = manage( new RadioButton( "Sel", true )); m_radio_select->signal_clicked().connect( sigc::bind(mem_fun( *this, &seqedit::mouse_action ), e_action_select )); m_hbox3->pack_start( *m_radio_select, false, false ); /* Draw */ m_radio_draw = manage( new RadioButton( "Draw" )); m_radio_draw->signal_clicked().connect( sigc::bind(mem_fun( *this, &seqedit::mouse_action ), e_action_draw )); m_hbox3->pack_start( *m_radio_draw, false, false ); /* Grow */ m_radio_grow = manage( new RadioButton( "Grow" )); m_radio_grow->signal_clicked().connect( sigc::bind(mem_fun( *this, &seqedit::mouse_action ), e_action_grow )); m_hbox3->pack_start( *m_radio_grow, false, false ); /* Stretch */ Gtk::RadioButton::Group g = m_radio_select->get_group(); m_radio_draw->set_group(g); m_radio_grow->set_group(g); #endif } #if 0 void seqedit::mouse_action( mouse_action_e a_action ) { if ( a_action == e_action_select && m_radio_select->get_active()) printf( "mouse_action() select [%d]\n", a_action ); if ( a_action == e_action_draw && m_radio_draw->get_active()) printf( "mouse_action() draw [%d]\n", a_action ); if ( a_action == e_action_grow && m_radio_grow->get_active()) printf( "mouse_action() grow [%d]\n", a_action ); } #endif void seqedit::popup_menu(Menu *a_menu) { a_menu->popup(0,0); } void seqedit::popup_midibus_menu() { using namespace Menu_Helpers; m_menu_midibus = manage( new Menu()); /* midi buses */ mastermidibus *masterbus = m_mainperf->get_master_midi_bus(); for ( int i=0; i< masterbus->get_num_out_buses(); i++ ){ m_menu_midibus->items().push_back(MenuElem( masterbus->get_midi_out_bus_name(i), sigc::bind(mem_fun(*this,&seqedit::set_midi_bus), i))); } m_menu_midibus->popup(0,0); } void seqedit::popup_midich_menu() { using namespace Menu_Helpers; m_menu_midich = manage( new Menu()); int midi_bus = m_seq->get_midi_bus(); char b[16]; /* midi channel menu */ for( int i=0; i<16; i++ ){ snprintf( b, sizeof(b), "%d", i+1 ); std::string name = string(b); int instrument = global_user_midi_bus_definitions[midi_bus].instrument[i]; if ( instrument >= 0 && instrument < c_maxBuses ) { name = name + (string(" (") + global_user_instrument_definitions[instrument].instrument + string(")") ); } m_menu_midich->items().push_back(MenuElem(name, sigc::bind(mem_fun(*this,&seqedit::set_midi_channel), i ))); } m_menu_midich->popup(0,0); } void seqedit::popup_sequence_menu() { using namespace Menu_Helpers; m_menu_sequences = manage( new Menu()); m_menu_sequences->items().push_back(MenuElem("Off", sigc::bind(mem_fun(*this, &seqedit::set_background_sequence), -1))); m_menu_sequences->items().push_back( SeparatorElem( )); for ( int ss=0; ssis_active( i )){ if ( !inserted ){ inserted = true; snprintf(name, sizeof(name), "[%d]", ss); menu_ss = manage( new Menu()); m_menu_sequences->items().push_back(MenuElem(name,*menu_ss)); } sequence *seq = m_mainperf->get_sequence( i ); snprintf(name, sizeof(name),"[%d] %.13s", i, seq->get_name()); menu_ss->items().push_back(MenuElem(name, sigc::bind(mem_fun(*this, &seqedit::set_background_sequence), i))); } } } m_menu_sequences->popup(0,0); } void seqedit::set_background_sequence( int a_seq ) { char name[30]; m_initial_sequence = m_sequence = a_seq; if ( a_seq == -1 || !m_mainperf->is_active( a_seq )){ m_entry_sequence->set_text("Off"); m_seqroll_wid->set_background_sequence( false, 0 ); } if ( m_mainperf->is_active( a_seq )){ sequence *seq = m_mainperf->get_sequence( a_seq ); snprintf(name, sizeof(name),"[%d] %.13s", a_seq, seq->get_name()); m_entry_sequence->set_text(name); m_seqroll_wid->set_background_sequence( true, a_seq ); } } Gtk::Image* seqedit::create_menu_image( bool a_state ) { if ( a_state ) return manage( new Image(Gdk::Pixbuf::create_from_xpm_data( menu_full_xpm ))); else return manage( new Image(Gdk::Pixbuf::create_from_xpm_data( menu_empty_xpm ))); } void seqedit::popup_event_menu() { using namespace Menu_Helpers; /* temp */ char b[20]; bool note_on = false; bool note_off = false; bool aftertouch = false; bool program_change = false; bool channel_pressure = false; bool pitch_wheel = false; bool ccs[128]; memset( ccs, false, sizeof(bool) * 128 ); int midi_bus = m_seq->get_midi_bus(); int midi_ch = m_seq->get_midi_channel(); unsigned char status, cc; m_seq->reset_draw_marker(); while ( m_seq->get_next_event( &status, &cc ) == true ){ switch( status ){ case EVENT_NOTE_OFF: note_off = true; break; case EVENT_NOTE_ON: note_on = true; break; case EVENT_AFTERTOUCH: aftertouch = true; break; case EVENT_CONTROL_CHANGE: ccs[cc] = true; break; case EVENT_PITCH_WHEEL: pitch_wheel = true; break; /* one data item */ case EVENT_PROGRAM_CHANGE: program_change = true; break; case EVENT_CHANNEL_PRESSURE: channel_pressure = true; break; } } m_menu_data = manage( new Menu()); m_menu_data->items().push_back( ImageMenuElem( "Note On Velocity", *create_menu_image( note_on ), sigc::bind(mem_fun(*this, &seqedit::set_data_type), (unsigned char) EVENT_NOTE_ON, 0 ))); m_menu_data->items().push_back( SeparatorElem( )); m_menu_data->items().push_back( ImageMenuElem( "Note Off Velocity", *create_menu_image( note_off ), sigc::bind(mem_fun(*this, &seqedit::set_data_type), (unsigned char) EVENT_NOTE_OFF, 0 ))); m_menu_data->items().push_back( ImageMenuElem( "AfterTouch", *create_menu_image( aftertouch ), sigc::bind(mem_fun(*this, &seqedit::set_data_type), (unsigned char) EVENT_AFTERTOUCH, 0 ))); m_menu_data->items().push_back( ImageMenuElem( "Program Change", *create_menu_image( program_change ), sigc::bind(mem_fun(*this, &seqedit::set_data_type), (unsigned char) EVENT_PROGRAM_CHANGE, 0 ))); m_menu_data->items().push_back( ImageMenuElem( "Channel Pressure", *create_menu_image( channel_pressure ), sigc::bind(mem_fun(*this, &seqedit::set_data_type), (unsigned char) EVENT_CHANNEL_PRESSURE, 0 ))); m_menu_data->items().push_back( ImageMenuElem( "Pitch Wheel", *create_menu_image( pitch_wheel ), sigc::bind(mem_fun(*this, &seqedit::set_data_type), (unsigned char) EVENT_PITCH_WHEEL , 0 ))); m_menu_data->items().push_back( SeparatorElem( )); /* create control change */ for ( int i=0; i<8; i++ ){ snprintf(b, sizeof(b), "Controls %d-%d", (i*16), (i*16) + 15); Menu *menu_cc = manage( new Menu() ); for( int j=0; j<16; j++ ){ string controller_name( c_controller_names[i*16+j] ); int instrument = global_user_midi_bus_definitions[midi_bus].instrument[midi_ch]; if ( instrument > -1 && instrument < c_max_instruments ) { if ( global_user_instrument_definitions[instrument].controllers_active[i*16+j] ) controller_name = global_user_instrument_definitions[instrument].controllers[i*16+j]; } menu_cc->items().push_back( ImageMenuElem( controller_name, *create_menu_image( ccs[i*16+j]), sigc::bind(mem_fun(*this, &seqedit::set_data_type), (unsigned char) EVENT_CONTROL_CHANGE, i*16+j))); } m_menu_data->items().push_back( MenuElem( string(b), *menu_cc )); } m_menu_data->popup(0,0); } //m_option_midich->set_history( m_seq->getMidiChannel() ); //m_option_midibus->set_history( m_seq->getMidiBus()->getID() ); void seqedit::set_midi_channel( int a_midichannel ) { char b[10]; snprintf( b, sizeof(b), "%d", a_midichannel + 1); m_entry_channel->set_text(b); m_seq->set_midi_channel( a_midichannel ); // m_mainwid->update_sequence_on_window( m_pos ); } void seqedit::set_midi_bus( int a_midibus ) { m_seq->set_midi_bus( a_midibus ); mastermidibus *mmb = m_mainperf->get_master_midi_bus(); m_entry_bus->set_text( mmb->get_midi_out_bus_name( a_midibus )); // m_mainwid->update_sequence_on_window( m_pos ); } void seqedit::set_zoom( int a_zoom ) { char b[10]; snprintf(b, sizeof(b), "1:%d", a_zoom); m_entry_zoom->set_text(b); m_zoom = a_zoom; m_initial_zoom = a_zoom; m_seqroll_wid->set_zoom( m_zoom ); m_seqtime_wid->set_zoom( m_zoom ); m_seqdata_wid->set_zoom( m_zoom ); m_seqevent_wid->set_zoom( m_zoom ); } void seqedit::set_snap( int a_snap ) { char b[10]; snprintf(b, sizeof(b), "1/%d", c_ppqn * 4 / a_snap); m_entry_snap->set_text(b); m_snap = a_snap; m_initial_snap = a_snap; m_seqroll_wid->set_snap( m_snap ); m_seqevent_wid->set_snap( m_snap ); m_seq->set_snap_tick(a_snap); } void seqedit::set_note_length( int a_note_length ) { char b[10]; snprintf(b, sizeof(b), "1/%d", c_ppqn * 4 / a_note_length); m_entry_note_length->set_text(b); m_note_length = a_note_length; m_initial_note_length = a_note_length; m_seqroll_wid->set_note_length( m_note_length ); } void seqedit::set_scale( int a_scale ) { m_entry_scale->set_text( c_scales_text[a_scale] ); m_scale = m_initial_scale = a_scale; m_seqroll_wid->set_scale( m_scale ); m_seqkeys_wid->set_scale( m_scale ); } void seqedit::set_key( int a_note ) { m_entry_key->set_text( c_key_text[a_note] ); m_key = m_initial_key = a_note; m_seqroll_wid->set_key( m_key ); m_seqkeys_wid->set_key( m_key ); } void seqedit::apply_length( int a_bpm, int a_bw, int a_measures ) { m_seq->set_length( a_measures * a_bpm * ((c_ppqn * 4) / a_bw) ); m_seqroll_wid->reset(); m_seqtime_wid->reset(); m_seqdata_wid->reset(); m_seqevent_wid->reset(); } long seqedit::get_measures() { long units = ((m_seq->get_bpm() * (c_ppqn * 4)) / m_seq->get_bw() ); long measures = (m_seq->get_length() / units); if (m_seq->get_length() % units != 0) measures++; return measures; } void seqedit::set_measures( int a_length_measures ) { char b[10]; snprintf(b, sizeof(b), "%d", a_length_measures); m_entry_length->set_text(b); m_measures = a_length_measures; apply_length( m_seq->get_bpm(), m_seq->get_bw(), a_length_measures ); } void seqedit::set_bpm( int a_beats_per_measure ) { char b[4]; snprintf(b, sizeof(b), "%d", a_beats_per_measure); m_entry_bpm->set_text(b); if ( a_beats_per_measure != m_seq->get_bpm() ){ long length = get_measures(); m_seq->set_bpm( a_beats_per_measure ); apply_length( a_beats_per_measure, m_seq->get_bw(), length ); } } void seqedit::set_bw( int a_beat_width ) { char b[4]; snprintf(b, sizeof(b), "%d", a_beat_width); m_entry_bw->set_text(b); if ( a_beat_width != m_seq->get_bw()){ long length = get_measures(); m_seq->set_bw( a_beat_width ); apply_length( m_seq->get_bpm(), a_beat_width, length ); } } void seqedit::set_rec_vol( int a_rec_vol ) { m_seq->set_rec_vol( a_rec_vol ); } void seqedit::name_change_callback() { m_seq->set_name( m_entry_name->get_text()); // m_mainwid->update_sequence_on_window( m_pos ); } void seqedit::play_change_callback() { m_seq->set_playing( m_toggle_play->get_active() ); // m_mainwid->update_sequence_on_window( m_pos ); } void seqedit::record_change_callback() { m_mainperf->get_master_midi_bus()->set_sequence_input( true, m_seq ); m_seq->set_recording( m_toggle_record->get_active() ); } void seqedit::q_rec_change_callback() { m_seq->set_quanized_rec( m_toggle_q_rec->get_active() ); } void seqedit::undo_callback() { m_seq->pop_undo( ); m_seqroll_wid->redraw(); m_seqtime_wid->redraw(); m_seqdata_wid->redraw(); m_seqevent_wid->redraw(); } void seqedit::redo_callback() { m_seq->pop_redo( ); m_seqroll_wid->redraw(); m_seqtime_wid->redraw(); m_seqdata_wid->redraw(); m_seqevent_wid->redraw(); } void seqedit::thru_change_callback() { m_mainperf->get_master_midi_bus()->set_sequence_input( true, m_seq ); m_seq->set_thru( m_toggle_thru->get_active() ); } void seqedit::set_data_type( unsigned char a_status, unsigned char a_control ) { m_editing_status = a_status; m_editing_cc = a_control; m_seqevent_wid->set_data_type( a_status, a_control ); m_seqdata_wid->set_data_type( a_status, a_control ); m_seqroll_wid->set_data_type( a_status, a_control ); char text[100]; char hex[20]; char type[80]; snprintf(hex, sizeof(hex), "[0x%02X]", a_status); if ( a_status == EVENT_NOTE_OFF ) snprintf(type, sizeof(type),"Note Off" ); else if ( a_status == EVENT_NOTE_ON ) snprintf(type, sizeof(type),"Note On" ); else if ( a_status == EVENT_AFTERTOUCH ) snprintf(type, sizeof(type), "Aftertouch" ); else if ( a_status == EVENT_CONTROL_CHANGE ) { int midi_bus = m_seq->get_midi_bus(); int midi_ch = m_seq->get_midi_channel(); string controller_name( c_controller_names[a_control] ); int instrument = global_user_midi_bus_definitions[midi_bus].instrument[midi_ch]; if ( instrument > -1 && instrument < c_max_instruments ) { if ( global_user_instrument_definitions[instrument].controllers_active[a_control] ) controller_name = global_user_instrument_definitions[instrument].controllers[a_control]; } snprintf(type, sizeof(type), "Control Change - %s", controller_name.c_str() ); } else if ( a_status == EVENT_PROGRAM_CHANGE ) snprintf(type, sizeof(type), "Program Change"); else if ( a_status == EVENT_CHANNEL_PRESSURE ) snprintf(type, sizeof(type), "Channel Pressure"); else if ( a_status == EVENT_PITCH_WHEEL ) snprintf(type, sizeof(type), "Pitch Wheel"); else snprintf(type, sizeof(type), "Unknown MIDI Event"); snprintf(text, sizeof(text), "%s %s", hex, type ); m_entry_data->set_text( text ); } void seqedit::on_realize() { // we need to do the default realize Gtk::Window::on_realize(); Glib::signal_timeout().connect(mem_fun(*this, &seqedit::timeout), c_redraw_ms); } bool seqedit::timeout() { if (m_seq->get_raise()) { m_seq->set_raise(false); raise(); } if (m_seq->is_dirty_edit() ){ m_seqroll_wid->redraw_events(); m_seqevent_wid->redraw(); m_seqdata_wid->redraw(); } m_seqroll_wid->draw_progress_on_window(); return true; } seqedit::~seqedit() { //m_seq->set_editing( false ); } bool seqedit::on_delete_event(GdkEventAny *a_event) { //printf( "seqedit::on_delete_event()\n" ); m_seq->set_recording( false ); m_mainperf->get_master_midi_bus()->set_sequence_input( false, NULL ); m_seq->set_editing( false ); delete this; return false; } bool seqedit::on_scroll_event( GdkEventScroll* a_ev ) { //printf("seqedit::on_scroll_event(x=%f,y=%f,state=%d)\n", a_ev->x, a_ev->y, a_ev->state); guint modifiers; // Used to filter out caps/num lock etc. modifiers = gtk_accelerator_get_default_mod_mask (); if ((a_ev->state & modifiers) == GDK_CONTROL_MASK) { if (a_ev->direction == GDK_SCROLL_DOWN) { if (m_zoom*2 <= c_max_zoom) set_zoom(m_zoom*2); } else if (a_ev->direction == GDK_SCROLL_UP) { if (m_zoom/2 >= c_min_zoom) set_zoom(m_zoom/2); } return true; } else if ((a_ev->state & modifiers) == GDK_SHIFT_MASK) { double val = m_hadjust->get_value(); double step = m_hadjust->get_step_increment(); double upper = m_hadjust->get_upper(); if (a_ev->direction == GDK_SCROLL_DOWN) { if (val + step < upper) m_hadjust->set_value(val + step); else m_hadjust->set_value(upper); } else if (a_ev->direction == GDK_SCROLL_UP) { m_hadjust->set_value(val - step); } return true; } return false; // Not handled } bool seqedit::on_key_press_event( GdkEventKey* a_ev ) { guint modifiers; // Used to filter out caps/num lock etc. modifiers = gtk_accelerator_get_default_mod_mask (); if ((a_ev->state & modifiers) == GDK_CONTROL_MASK && a_ev->keyval == 'w') return on_delete_event((GdkEventAny*)a_ev); else return Gtk::Window::on_key_press_event(a_ev); } seq24-0.9.3/src/perfedit.h0000644000175000017500000000661712651156360012163 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #pragma once #include "sequence.h" #include "perform.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "globals.h" #include "mainwid.h" #include "perfnames.h" #include "perfroll.h" #include "perftime.h" using namespace Gtk; /* has a seqroll and paino roll */ class perfedit:public Gtk::Window { private: perform * m_mainperf; Table *m_table; VScrollbar *m_vscroll; HScrollbar *m_hscroll; Adjustment *m_vadjust; Adjustment *m_hadjust; perfnames *m_perfnames; perfroll *m_perfroll; perftime *m_perftime; Menu *m_menu_snap; Button *m_button_snap; Entry *m_entry_snap; Button *m_button_stop; Button *m_button_play; ToggleButton *m_button_loop; Button *m_button_expand; Button *m_button_collapse; Button *m_button_copy; Button *m_button_grow; Button *m_button_undo; Button *m_button_bpm; Entry *m_entry_bpm; Button *m_button_bw; Entry *m_entry_bw; HBox *m_hbox; HBox *m_hlbox; Tooltips *m_tooltips; /* time signature, beats per measure, beat width */ Menu *m_menu_bpm; Menu *m_menu_bw; /* set snap to in pulses */ int m_snap; int m_bpm; int m_bw; void set_bpm( int a_beats_per_measure ); void set_bw( int a_beat_width ); void set_snap (int a_snap); void set_guides(); void grow (); void on_realize (); void start_playing (); void stop_playing (); void set_looped (); void expand (); void collapse (); void copy (); void undo (); void popup_menu (Menu * a_menu); bool timeout (); bool on_delete_event (GdkEventAny * a_event); bool on_key_press_event(GdkEventKey* a_ev); public: void init_before_show (); perfedit (perform * a_perf); ~perfedit (); }; seq24-0.9.3/src/mainwid.h0000644000175000017500000000641612651156360012006 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #include "globals.h" #include "perform.h" #include "seqmenu.h" class seqedit; #pragma once #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace Gtk; const int c_seqarea_seq_x = c_text_x * 13; const int c_seqarea_seq_y = c_text_y * 2; /* piano roll */ class mainwid : public Gtk::DrawingArea, public seqmenu { private: Glib::RefPtr m_gc; Glib::RefPtr m_window; Gdk::Color m_black, m_white, m_grey, m_dk_grey; Gdk::Color m_background, m_foreground; Glib::RefPtr m_pixmap; GdkRectangle m_old; GdkRectangle m_selected; int m_screenset; perform * const m_mainperf; sequence m_clipboard; sequence m_moving_seq; int m_window_x, m_window_y; bool m_button_down; bool m_moving; /* when highlighting a bunch of events */ /* where the dragging started */ int m_drop_x; int m_drop_y; int m_current_x; int m_current_y; int m_old_seq; long m_last_tick_x[c_max_sequence]; bool m_last_playing[c_max_sequence]; static const char m_seq_to_char[c_seqs_in_set]; void on_realize(); bool on_expose_event(GdkEventExpose* a_ev); bool on_button_press_event(GdkEventButton* a_ev); bool on_button_release_event(GdkEventButton* a_ev); bool on_motion_notify_event(GdkEventMotion* a_p0); bool on_focus_in_event(GdkEventFocus*); bool on_focus_out_event(GdkEventFocus*); void draw_sequence_on_pixmap( int a_seq ); void draw_sequences_on_pixmap(); void fill_background_window(); void draw_pixmap_on_window(); void draw_sequence_pixmap_on_window( int a_seq ); int seq_from_xy( int a_x, int a_y ); int timeout(); void redraw( int a_seq ); public: mainwid( perform *a_p ); ~mainwid( ); void reset(); //int get_screenset( ); void set_screenset( int a_ss ); void update_sequence_on_window( int a_seq ); void update_sequences_on_window( ); void update_markers( int a_ticks ); void draw_marker_on_sequence( int a_seq, int a_tick ); }; seq24-0.9.3/src/perfedit.cpp0000644000175000017500000003215312651156360012510 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #include "perfedit.h" #include "sequence.h" #include "pixmaps/snap.xpm" #include "pixmaps/play2.xpm" #include "pixmaps/stop.xpm" #include "pixmaps/expand.xpm" #include "pixmaps/collapse.xpm" #include "pixmaps/loop.xpm" #include "pixmaps/copy.xpm" #include "pixmaps/undo.xpm" #include "pixmaps/down.xpm" #include "pixmaps/perfedit.xpm" using namespace sigc; // tooltip helper, for old vs new gtk... #if GTK_MINOR_VERSION >= 12 # define add_tooltip( obj, text ) obj->set_tooltip_text( text); #else # define add_tooltip( obj, text ) m_tooltips->set_tip( *obj, text ); #endif perfedit::perfedit( perform *a_perf ) { using namespace Menu_Helpers; set_icon(Gdk::Pixbuf::create_from_xpm_data(perfedit_xpm)); /* set the performance */ m_snap = c_ppqn / 4; m_mainperf = a_perf; /* main window */ set_title( "seq24 - Song Editor"); set_size_request(700, 400); /* tooltips */ m_tooltips = manage( new Tooltips( ) ); m_vadjust = manage( new Adjustment(0,0,1,1,1,1 )); m_hadjust = manage( new Adjustment(0,0,1,1,1,1 )); m_vscroll = manage(new VScrollbar( *m_vadjust )); m_hscroll = manage(new HScrollbar( *m_hadjust )); m_perfnames = manage( new perfnames( m_mainperf, m_vadjust )); m_perfroll = manage( new perfroll( m_mainperf, m_hadjust, m_vadjust )); m_perftime = manage( new perftime( m_mainperf, m_hadjust )); /* init table, viewports and scroll bars */ m_table = manage( new Table( 6, 3, false)); m_table->set_border_width( 2 ); m_hbox = manage( new HBox( false, 2 )); m_hlbox = manage( new HBox( false, 2 )); m_hlbox->set_border_width( 2 ); m_button_grow = manage( new Button()); m_button_grow->add( *manage( new Arrow( Gtk::ARROW_RIGHT, Gtk::SHADOW_OUT ))); m_button_grow->signal_clicked().connect( mem_fun( *this, &perfedit::grow)); add_tooltip( m_button_grow, "Increase size of Grid." ); /* fill table */ m_table->attach( *m_hlbox, 0, 3, 0, 1, Gtk::FILL, Gtk::SHRINK, 2, 0 ); // shrink was 0 m_table->attach( *m_perfnames, 0, 1, 2, 3, Gtk::SHRINK, Gtk::FILL ); m_table->attach( *m_perftime, 1, 2, 1, 2, Gtk::FILL, Gtk::SHRINK ); m_table->attach( *m_perfroll, 1, 2, 2, 3, Gtk::FILL | Gtk::SHRINK, Gtk::FILL | Gtk::SHRINK ); m_table->attach( *m_vscroll, 2, 3, 2, 3, Gtk::SHRINK, Gtk::FILL | Gtk::EXPAND ); m_table->attach( *m_hbox, 0, 1, 3, 4, Gtk::FILL, Gtk::SHRINK, 0, 2 ); m_table->attach( *m_hscroll, 1, 2, 3, 4, Gtk::FILL | Gtk::EXPAND, Gtk::SHRINK ); m_table->attach( *m_button_grow, 2, 3, 3, 4, Gtk::SHRINK, Gtk::SHRINK ); m_menu_snap = manage( new Menu()); m_menu_snap->items().push_back(MenuElem("1/1", sigc::bind(mem_fun(*this,&perfedit::set_snap), 1 ))); m_menu_snap->items().push_back(MenuElem("1/2", sigc::bind(mem_fun(*this,&perfedit::set_snap), 2 ))); m_menu_snap->items().push_back(MenuElem("1/4", sigc::bind(mem_fun(*this,&perfedit::set_snap), 4 ))); m_menu_snap->items().push_back(MenuElem("1/8", sigc::bind(mem_fun(*this,&perfedit::set_snap), 8 ))); m_menu_snap->items().push_back(MenuElem("1/16", sigc::bind(mem_fun(*this,&perfedit::set_snap), 16 ))); m_menu_snap->items().push_back(MenuElem("1/32", sigc::bind(mem_fun(*this,&perfedit::set_snap), 32 ))); /* snap */ m_button_snap = manage( new Button()); m_button_snap->add( *manage( new Image(Gdk::Pixbuf::create_from_xpm_data( snap_xpm )))); m_button_snap->signal_clicked().connect( sigc::bind( mem_fun( *this, &perfedit::popup_menu), m_menu_snap )); add_tooltip( m_button_snap, "Grid snap. (Fraction of Measure Length)" ); m_entry_snap = manage( new Entry()); m_entry_snap->set_size_request( 40, -1 ); m_entry_snap->set_editable( false ); m_menu_bpm = manage( new Menu() ); m_menu_bw = manage( new Menu() ); /* bw */ m_menu_bw->items().push_back(MenuElem("1", sigc::bind(mem_fun(*this,&perfedit::set_bw), 1 ))); m_menu_bw->items().push_back(MenuElem("2", sigc::bind(mem_fun(*this,&perfedit::set_bw), 2 ))); m_menu_bw->items().push_back(MenuElem("4", sigc::bind(mem_fun(*this,&perfedit::set_bw), 4 ))); m_menu_bw->items().push_back(MenuElem("8", sigc::bind(mem_fun(*this,&perfedit::set_bw), 8 ))); m_menu_bw->items().push_back(MenuElem("16", sigc::bind(mem_fun(*this,&perfedit::set_bw), 16 ))); char b[20]; for( int i=0; i<16; i++ ){ snprintf( b, sizeof(b), "%d", i+1 ); /* length */ m_menu_bpm->items().push_back(MenuElem(b, sigc::bind(mem_fun(*this,&perfedit::set_bpm), i+1 ))); } /* beats per measure */ m_button_bpm = manage( new Button()); m_button_bpm->add( *manage( new Image(Gdk::Pixbuf::create_from_xpm_data( down_xpm )))); m_button_bpm->signal_clicked().connect( sigc::bind( mem_fun( *this, &perfedit::popup_menu), m_menu_bpm )); add_tooltip( m_button_bpm, "Time Signature. Beats per Measure" ); m_entry_bpm = manage( new Entry()); m_entry_bpm->set_width_chars(2); m_entry_bpm->set_editable( false ); /* beat width */ m_button_bw = manage( new Button()); m_button_bw->add( *manage( new Image(Gdk::Pixbuf::create_from_xpm_data( down_xpm )))); m_button_bw->signal_clicked().connect( sigc::bind( mem_fun( *this, &perfedit::popup_menu), m_menu_bw )); add_tooltip( m_button_bw, "Time Signature. Length of Beat" ); m_entry_bw = manage( new Entry()); m_entry_bw->set_width_chars(2); m_entry_bw->set_editable( false ); /* undo */ m_button_undo = manage( new Button()); m_button_undo->add( *manage( new Image(Gdk::Pixbuf::create_from_xpm_data( undo_xpm )))); m_button_undo->signal_clicked().connect( mem_fun( *this, &perfedit::undo)); add_tooltip( m_button_undo, "Undo." ); /* expand */ m_button_expand = manage( new Button()); m_button_expand->add(*manage( new Image(Gdk::Pixbuf::create_from_xpm_data( expand_xpm )))); m_button_expand->signal_clicked().connect( mem_fun( *this, &perfedit::expand)); add_tooltip( m_button_expand, "Expand between L and R markers." ); /* collapse */ m_button_collapse = manage( new Button()); m_button_collapse->add(*manage( new Image(Gdk::Pixbuf::create_from_xpm_data( collapse_xpm )))); m_button_collapse->signal_clicked().connect( mem_fun( *this, &perfedit::collapse)); add_tooltip( m_button_collapse, "Collapse between L and R markers." ); /* copy */ m_button_copy = manage( new Button()); m_button_copy->add(*manage( new Image(Gdk::Pixbuf::create_from_xpm_data( copy_xpm )))); m_button_copy->signal_clicked().connect( mem_fun( *this, &perfedit::copy )); add_tooltip( m_button_copy, "Expand and copy between L and R markers." ); m_button_loop = manage( new ToggleButton() ); m_button_loop->add(*manage( new Image(Gdk::Pixbuf::create_from_xpm_data( loop_xpm )))); m_button_loop->signal_toggled().connect( mem_fun( *this, &perfedit::set_looped )); add_tooltip( m_button_loop, "Play looped between L and R." ); m_button_stop = manage( new Button() ); m_button_stop->add(*manage( new Image(Gdk::Pixbuf::create_from_xpm_data( stop_xpm )))); m_button_stop->signal_clicked().connect( mem_fun( *this, &perfedit::stop_playing)); add_tooltip( m_button_stop, "Stop playing." ); m_button_play = manage( new Button() ); m_button_play->add(*manage( new Image(Gdk::Pixbuf::create_from_xpm_data( play2_xpm )))); m_button_play->signal_clicked().connect( mem_fun( *this, &perfedit::start_playing)); add_tooltip( m_button_play, "Begin playing at L marker." ); m_hlbox->pack_end( *m_button_copy , false, false ); m_hlbox->pack_end( *m_button_expand , false, false ); m_hlbox->pack_end( *m_button_collapse , false, false ); m_hlbox->pack_end( *m_button_undo , false, false ); m_hlbox->pack_start( *m_button_stop , false, false ); m_hlbox->pack_start( *m_button_play , false, false ); m_hlbox->pack_start( *m_button_loop , false, false ); m_hlbox->pack_start( *(manage(new VSeparator( ))), false, false, 4); m_hlbox->pack_start( *m_button_bpm , false, false ); m_hlbox->pack_start( *m_entry_bpm , false, false ); m_hlbox->pack_start( *(manage(new Label( "/" ))), false, false, 4); m_hlbox->pack_start( *m_button_bw , false, false ); m_hlbox->pack_start( *m_entry_bw , false, false ); m_hlbox->pack_start( *(manage(new Label( "x" ))), false, false, 4); m_hlbox->pack_start( *m_button_snap , false, false ); m_hlbox->pack_start( *m_entry_snap , false, false ); /* add table */ this->add( *m_table ); m_snap = 8; m_bpm = 4; m_bw = 4; set_snap( 8 ); set_bpm( 4 ); set_bw( 4 ); add_events( Gdk::KEY_PRESS_MASK | Gdk::KEY_RELEASE_MASK ); } bool perfedit::on_key_press_event(GdkEventKey* a_ev) { bool event_was_handled = false; if ( a_ev->type == GDK_KEY_PRESS ){ if ( global_print_keys ){ printf( "key_press[%d] == %s\n", a_ev->keyval, gdk_keyval_name( a_ev->keyval ) ); } // the start/end key may be the same key (i.e. SPACE) // allow toggling when the same key is mapped to both triggers (i.e. SPACEBAR) bool dont_toggle = m_mainperf->m_key_start != m_mainperf->m_key_stop; if ( a_ev->keyval == m_mainperf->m_key_start && (dont_toggle || !m_mainperf->is_running()) ) { start_playing(); return true; } else if ( a_ev->keyval == m_mainperf->m_key_stop && (dont_toggle || m_mainperf->is_running()) ) { stop_playing(); return true; } if(a_ev->keyval == m_mainperf->m_key_start || a_ev->keyval == m_mainperf->m_key_stop) event_was_handled = true; } if(!event_was_handled) { return Gtk::Window::on_key_press_event(a_ev); } return false; } void perfedit::undo() { m_mainperf->pop_trigger_undo(); m_perfroll->queue_draw(); } void perfedit::start_playing() { m_mainperf->position_jack( true ); m_mainperf->start_jack( ); m_mainperf->start( true ); } void perfedit::stop_playing() { m_mainperf->stop_jack(); m_mainperf->stop(); } void perfedit::collapse() { m_mainperf->push_trigger_undo(); m_mainperf->move_triggers( false ); m_perfroll->queue_draw(); } void perfedit::copy() { m_mainperf->push_trigger_undo(); m_mainperf->copy_triggers( ); m_perfroll->queue_draw(); } void perfedit::expand() { m_mainperf->push_trigger_undo(); m_mainperf->move_triggers( true ); m_perfroll->queue_draw(); } void perfedit::set_looped() { m_mainperf->set_looping( m_button_loop->get_active()); } void perfedit::popup_menu(Menu *a_menu) { a_menu->popup(0,0); } void perfedit::set_guides() { long measure_ticks = (c_ppqn * 4) * m_bpm / m_bw; long snap_ticks = measure_ticks / m_snap; long beat_ticks = (c_ppqn * 4) / m_bw; m_perfroll->set_guides( snap_ticks, measure_ticks, beat_ticks ); m_perftime->set_guides( snap_ticks, measure_ticks ); } void perfedit::set_snap( int a_snap ) { char b[10]; snprintf( b, sizeof(b), "1/%d", a_snap ); m_entry_snap->set_text(b); m_snap = a_snap; set_guides(); } void perfedit::set_bpm( int a_beats_per_measure ) { char b[10]; snprintf(b, sizeof(b), "%d", a_beats_per_measure ); m_entry_bpm->set_text(b); m_bpm = a_beats_per_measure; set_guides(); } void perfedit::set_bw( int a_beat_width ) { char b[10]; snprintf(b, sizeof(b), "%d", a_beat_width ); m_entry_bw->set_text(b); m_bw = a_beat_width; set_guides(); } void perfedit::on_realize() { // we need to do the default realize Gtk::Window::on_realize(); Glib::signal_timeout().connect(mem_fun(*this,&perfedit::timeout ), c_redraw_ms); } void perfedit::grow() { m_perfroll->increment_size(); m_perftime->increment_size(); } void perfedit::init_before_show() { m_perfroll->init_before_show(); //m_perftime->init_before_show(); } bool perfedit::timeout() { m_perfroll->redraw_dirty_sequences(); m_perfroll->draw_progress(); m_perfnames->redraw_dirty_sequences(); return true; } perfedit::~perfedit() { } bool perfedit::on_delete_event(GdkEventAny *a_event) { return false; } seq24-0.9.3/src/seqdata.cpp0000644000175000017500000003014012651156360012322 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #include "event.h" #include "seqdata.h" #include "font.h" seqdata::seqdata(sequence *a_seq, int a_zoom, Gtk::Adjustment *a_hadjust): //m_text_font_5_7(Gdk_Font( c_font_5_7 )), m_black(Gdk::Color("black")), m_white(Gdk::Color("white")), m_grey(Gdk::Color("grey")), m_seq(a_seq), m_zoom(a_zoom), m_hadjust(a_hadjust), m_scroll_offset_ticks(0), m_scroll_offset_x(0), m_dragging(false) { add_events( Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK | Gdk::POINTER_MOTION_MASK | Gdk::LEAVE_NOTIFY_MASK | Gdk::SCROLL_MASK ); // in the construor you can only allocate colors, // get_window() returns 0 because we have not be realized Glib::RefPtr colormap = get_default_colormap(); colormap->alloc_color( m_black ); colormap->alloc_color( m_white ); colormap->alloc_color( m_grey ); set_flags(Gtk::CAN_FOCUS ); set_double_buffered( false ); set_size_request( 10, c_dataarea_y ); } void seqdata::update_sizes() { if( is_realized() ) { /* create pixmaps with window dimentions */ m_pixmap = Gdk::Pixmap::create( m_window, m_window_x, m_window_y, -1 ); update_pixmap(); queue_draw(); } } void seqdata::reset() { update_sizes(); update_pixmap(); queue_draw(); } void seqdata::redraw() { update_pixmap(); queue_draw(); } void seqdata::on_realize() { // we need to do the default realize Gtk::DrawingArea::on_realize(); // Now we can allocate any additional resources we need m_window = get_window(); m_gc = Gdk::GC::create( m_window ); m_window->clear(); m_hadjust->signal_value_changed().connect( mem_fun( *this, &seqdata::change_horz )); for( int i=0; iset_foreground( m_white ); m_numbers[i]->draw_rectangle(m_gc,true, 0, 0, 6, 30 ); char val[5]; snprintf(val, sizeof(val), "%3d\n", i); char num[6]; memset( num, 0, 6); num[0] = val[0]; num[2] = val[1]; num[4] = val[2]; p_font_renderer->render_string_on_drawable(m_gc, 0, 0, m_numbers[i], &num[0], font::BLACK ); p_font_renderer->render_string_on_drawable(m_gc, 0, 8, m_numbers[i], &num[2], font::BLACK ); p_font_renderer->render_string_on_drawable(m_gc, 0, 16, m_numbers[i], &num[4], font::BLACK ); } update_sizes(); } void seqdata::set_zoom( int a_zoom ) { if ( m_zoom != a_zoom ){ m_zoom = a_zoom; reset(); } } void seqdata::set_data_type( unsigned char a_status, unsigned char a_control = 0 ) { m_status = a_status; m_cc = a_control; this->redraw(); } void seqdata::update_pixmap() { draw_events_on_pixmap(); } void seqdata::draw_events_on( Glib::RefPtr a_draw ) { long tick; unsigned char d0,d1; int event_x; int event_height; bool selected; int start_tick = m_scroll_offset_ticks ; int end_tick = (m_window_x * m_zoom) + m_scroll_offset_ticks; //printf( "draw_events_on\n" ); m_gc->set_foreground( m_white ); a_draw->draw_rectangle(m_gc,true, 0, 0, m_window_x, m_window_y ); m_gc->set_foreground( m_black ); m_seq->reset_draw_marker(); while ( m_seq->get_next_event( m_status, m_cc, &tick, &d0, &d1, &selected ) == true ) { if ( tick >= start_tick && tick <= end_tick ){ /* turn into screen corrids */ event_x = tick / m_zoom; /* generate the value */ event_height = d1; if ( m_status == EVENT_PROGRAM_CHANGE || m_status == EVENT_CHANNEL_PRESSURE ){ event_height = d0; } m_gc->set_line_attributes( 2, Gdk::LINE_SOLID, Gdk::CAP_NOT_LAST, Gdk::JOIN_MITER ); /* draw vert lines */ a_draw->draw_line(m_gc, event_x - m_scroll_offset_x +1, c_dataarea_y - event_height, event_x - m_scroll_offset_x + 1, c_dataarea_y ); a_draw->draw_drawable(m_gc, m_numbers[event_height], 0,0, event_x + 3 - m_scroll_offset_x, c_dataarea_y - 25, 6,30); } } } void seqdata::draw_events_on_pixmap() { draw_events_on( m_pixmap ); } void seqdata::draw_pixmap_on_window() { queue_draw(); } int seqdata::idle_redraw() { /* no flicker, redraw */ if ( !m_dragging ){ draw_events_on( m_window ); draw_events_on( m_pixmap ); } return true; } bool seqdata::on_expose_event(GdkEventExpose* a_e) { m_window->draw_drawable(m_gc, m_pixmap, a_e->area.x, a_e->area.y, a_e->area.x, a_e->area.y, a_e->area.width, a_e->area.height ); return true; } /* takes screen corrdinates, give us notes and ticks */ void seqdata::convert_x( int a_x, long *a_tick ) { *a_tick = a_x * m_zoom; } bool seqdata::on_scroll_event( GdkEventScroll* a_ev ) { guint modifiers; // Used to filter out caps/num lock etc. modifiers = gtk_accelerator_get_default_mod_mask (); /* This scroll event only handles basic scrolling without any * modifier keys such as GDK_CONTROL_MASK or GDK_SHIFT_MASK */ if ((a_ev->state & modifiers) != 0) return false; if ( a_ev->direction == GDK_SCROLL_UP ){ m_seq->increment_selected( m_status, m_cc ); } if ( a_ev->direction == GDK_SCROLL_DOWN ){ m_seq->decrement_selected( m_status, m_cc ); } update_pixmap(); queue_draw(); return true; } bool seqdata::on_button_press_event(GdkEventButton* a_p0) { if ( a_p0->type == GDK_BUTTON_PRESS ){ m_seq->push_undo(); /* set values for line */ m_drop_x = (int) a_p0->x + m_scroll_offset_x; m_drop_y = (int) a_p0->y; /* reset box that holds dirty redraw spot */ m_old.x = 0; m_old.y = 0; m_old.width = 0; m_old.height = 0; m_dragging = true; } return true; } bool seqdata::on_button_release_event(GdkEventButton* a_p0) { m_current_x = (int) a_p0->x + m_scroll_offset_x; m_current_y = (int) a_p0->y; if ( m_dragging ){ long tick_s, tick_f; if ( m_current_x < m_drop_x ){ swap( m_current_x, m_drop_x ); swap( m_current_y, m_drop_y ); } convert_x( m_drop_x, &tick_s ); convert_x( m_current_x, &tick_f ); m_seq->change_event_data_range( tick_s, tick_f, m_status, m_cc, c_dataarea_y - m_drop_y -1, c_dataarea_y - m_current_y-1 ); /* convert x,y to ticks, then set events in range */ m_dragging = false; } update_pixmap(); queue_draw(); return true; } // Takes two points, returns a Xwin rectangle void seqdata::xy_to_rect( int a_x1, int a_y1, int a_x2, int a_y2, int *a_x, int *a_y, int *a_w, int *a_h ) { /* checks mins / maxes.. the fills in x,y and width and height */ if ( a_x1 < a_x2 ){ *a_x = a_x1; *a_w = a_x2 - a_x1; } else { *a_x = a_x2; *a_w = a_x1 - a_x2; } if ( a_y1 < a_y2 ){ *a_y = a_y1; *a_h = a_y2 - a_y1; } else { *a_y = a_y2; *a_h = a_y1 - a_y2; } } bool seqdata::on_motion_notify_event(GdkEventMotion* a_p0) { if ( m_dragging ){ m_current_x = (int) a_p0->x + m_scroll_offset_x; m_current_y = (int) a_p0->y; long tick_s, tick_f; int adj_x_min, adj_x_max, adj_y_min, adj_y_max; if ( m_current_x < m_drop_x ){ adj_x_min = m_current_x; adj_y_min = m_current_y; adj_x_max = m_drop_x; adj_y_max = m_drop_y; } else { adj_x_max = m_current_x; adj_y_max = m_current_y; adj_x_min = m_drop_x; adj_y_min = m_drop_y; } convert_x( adj_x_min, &tick_s ); convert_x( adj_x_max, &tick_f ); m_seq->change_event_data_range( tick_s, tick_f, m_status, m_cc, c_dataarea_y - adj_y_min -1, c_dataarea_y - adj_y_max -1 ); /* convert x,y to ticks, then set events in range */ update_pixmap(); draw_events_on( m_window ); draw_line_on_window(); } return true; } bool seqdata::on_leave_notify_event(GdkEventCrossing* p0) { // m_dragging = false; update_pixmap(); queue_draw(); return true; } void seqdata::draw_line_on_window() { int x,y,w,h; m_gc->set_foreground( m_black ); m_gc->set_line_attributes( 1, Gdk::LINE_SOLID, Gdk::CAP_NOT_LAST, Gdk::JOIN_MITER ); /* replace old */ m_window->draw_drawable(m_gc, m_pixmap, m_old.x, m_old.y, m_old.x, m_old.y, m_old.width + 1, m_old.height + 1 ); xy_to_rect ( m_drop_x, m_drop_y, m_current_x, m_current_y, &x, &y, &w, &h ); x -= m_scroll_offset_x; m_old.x = x; m_old.y = y; m_old.width = w; m_old.height = h; m_gc->set_foreground(m_black); m_window->draw_line(m_gc, m_current_x - m_scroll_offset_x, m_current_y, m_drop_x - m_scroll_offset_x, m_drop_y ); } void seqdata::change_horz( ) { m_scroll_offset_ticks = (int) m_hadjust->get_value(); m_scroll_offset_x = m_scroll_offset_ticks / m_zoom; update_pixmap(); force_draw(); } void seqdata::on_size_allocate(Gtk::Allocation& a_r ) { Gtk::DrawingArea::on_size_allocate( a_r ); m_window_x = a_r.get_width(); m_window_y = a_r.get_height(); update_sizes(); } void seqdata::force_draw() { m_window->draw_drawable(m_gc, m_pixmap, 0, 0, 0, 0, m_window_x, m_window_y ); } seq24-0.9.3/src/perform.h0000644000175000017500000002542712651156360012033 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #pragma once class perform; #include "globals.h" #include "event.h" #include "midibus.h" #include "midifile.h" #include "sequence.h" #ifndef __WIN32__ # include #endif #include /* if we have jack, include the jack headers */ #ifdef JACK_SUPPORT #include #include #ifdef JACK_SESSION #include #endif #endif /* class contains sequences that make up a live set */ class midi_control { public: bool m_active; bool m_inverse_active; long m_status; long m_data; long m_min_value; long m_max_value; }; const int c_status_replace = 0x01; const int c_status_snapshot = 0x02; const int c_status_queue = 0x04; const int c_midi_track_ctrl = c_seqs_in_set * 2; const int c_midi_control_bpm_up = c_midi_track_ctrl ; const int c_midi_control_bpm_dn = c_midi_track_ctrl + 1; const int c_midi_control_ss_up = c_midi_track_ctrl + 2; const int c_midi_control_ss_dn = c_midi_track_ctrl + 3; const int c_midi_control_mod_replace = c_midi_track_ctrl + 4; const int c_midi_control_mod_snapshot = c_midi_track_ctrl + 5; const int c_midi_control_mod_queue = c_midi_track_ctrl + 6; //andy midi_control_mod_mute_group const int c_midi_control_mod_gmute = c_midi_track_ctrl + 7; //andy learn_mute_toggle_mode const int c_midi_control_mod_glearn = c_midi_track_ctrl + 8; //andy play only this screen set const int c_midi_control_play_ss = c_midi_track_ctrl + 9; const int c_midi_controls = c_midi_track_ctrl + 10;//7 struct performcallback { virtual void on_grouplearnchange(bool state) {} }; class perform { private: //andy mute group bool m_mute_group[c_gmute_tracks]; bool m_tracks_mute_state[c_seqs_in_set]; bool m_mode_group; bool m_mode_group_learn; int m_mute_group_selected; //andy playing screen int m_playing_screen; /* vector of sequences */ sequence *m_seqs[c_max_sequence]; bool m_seqs_active[ c_max_sequence ]; bool m_was_active_main[ c_max_sequence ]; bool m_was_active_edit[ c_max_sequence ]; bool m_was_active_perf[ c_max_sequence ]; bool m_was_active_names[ c_max_sequence ]; bool m_sequence_state[ c_max_sequence ]; /* our midibus */ mastermidibus m_master_bus; /* pthread info */ pthread_t m_out_thread; pthread_t m_in_thread; bool m_out_thread_launched; bool m_in_thread_launched; bool m_running; bool m_inputing; bool m_outputing; bool m_looping; bool m_playback_mode; int thread_trigger_width_ms; long m_left_tick; long m_right_tick; long m_starting_tick; long m_tick; bool m_usemidiclock; bool m_midiclockrunning; // stopped or started int m_midiclocktick; int m_midiclockpos; bool m_show_ui_sequence_key; void set_running( bool a_running ); void set_playback_mode( bool a_playback_mode ); string m_screen_set_notepad[c_max_sets]; midi_control m_midi_cc_toggle[ c_midi_controls ]; midi_control m_midi_cc_on[ c_midi_controls ]; midi_control m_midi_cc_off[ c_midi_controls ]; int m_offset; int m_control_status; int m_screen_set; condition_var m_condition_var; // do not access these directly, use set/lookup below std::map key_events; std::map key_groups; std::map key_events_rev; // reverse lookup, keep this in sync!! std::map key_groups_rev; // reverse lookup, keep this in sync!! #ifdef JACK_SUPPORT jack_client_t *m_jack_client; jack_nframes_t m_jack_frame_current, m_jack_frame_last; jack_position_t m_jack_pos; jack_transport_state_t m_jack_transport_state; jack_transport_state_t m_jack_transport_state_last; double m_jack_tick; #ifdef JACK_SESSION public: jack_session_event_t *m_jsession_ev; bool jack_session_event(); private: #endif #endif bool m_jack_running; bool m_jack_master; void inner_start( bool a_state ); void inner_stop(); public: bool is_running(); bool is_learn_mode() const { return m_mode_group_learn; } // can register here for events... std::vector m_notify; unsigned int m_key_bpm_up; unsigned int m_key_bpm_dn; unsigned int m_key_replace; unsigned int m_key_queue; unsigned int m_key_keep_queue; unsigned int m_key_snapshot_1; unsigned int m_key_snapshot_2; unsigned int m_key_screenset_up; unsigned int m_key_screenset_dn; unsigned int m_key_set_playing_screenset; unsigned int m_key_group_on; unsigned int m_key_group_off; unsigned int m_key_group_learn; unsigned int m_key_start; unsigned int m_key_stop; bool show_ui_sequence_key() const { return m_show_ui_sequence_key; } perform(); ~perform(); void init(); void clear_all(); void launch_input_thread(); void launch_output_thread(); void init_jack(); void deinit_jack(); void add_sequence( sequence *a_seq, int a_perf ); void delete_sequence( int a_num ); bool is_sequence_in_edit( int a_num ); void clear_sequence_triggers( int a_seq ); long get_tick( ) { return m_tick; }; void set_left_tick( long a_tick ); long get_left_tick(); void set_starting_tick( long a_tick ); long get_starting_tick(); void set_right_tick( long a_tick ); long get_right_tick(); void move_triggers( bool a_direction ); void copy_triggers( ); void push_trigger_undo(); void pop_trigger_undo(); void print(); midi_control *get_midi_control_toggle( unsigned int a_seq ); midi_control *get_midi_control_on( unsigned int a_seq ); midi_control *get_midi_control_off( unsigned int a_seq ); void handle_midi_control( int a_control, bool a_state ); void set_screen_set_notepad( int a_screen_set, string *a_note ); string *get_screen_set_notepad( int a_screen_set ); void set_screenset( int a_ss ); int get_screenset(); void set_playing_screenset(); int get_playing_screenset(); void mute_group_tracks (); void select_and_mute_group (int a_g_group); void set_mode_group_mute (); void select_group_mute (int a_g_mute); void set_mode_group_learn (); void unset_mode_group_learn (); bool is_group_learning(void) { return m_mode_group_learn; } void select_mute_group ( int a_group ); void unset_mode_group_mute (); void start( bool a_state ); void stop(); void start_jack(); void stop_jack(); void position_jack( bool a_state ); void off_sequences(); void all_notes_off(); void set_active(int a_sequence, bool a_active); void set_was_active( int a_sequence ); bool is_active(int a_sequence); bool is_dirty_main (int a_sequence); bool is_dirty_edit (int a_sequence); bool is_dirty_perf (int a_sequence); bool is_dirty_names (int a_sequence); void new_sequence( int a_sequence ); /* plays all notes to Curent tick */ void play( long a_tick ); void set_orig_ticks( long a_tick ); sequence * get_sequence( int a_sequence ); void reset_sequences(); void set_bpm(int a_bpm); int get_bpm( ); void set_looping( bool a_looping ){ m_looping = a_looping; }; void set_sequence_control_status( int a_status ); void unset_sequence_control_status( int a_status ); void sequence_playing_toggle( int a_sequence ); void sequence_playing_on( int a_sequence ); void sequence_playing_off( int a_sequence ); void set_group_mute_state (int a_g_track, bool a_mute_state); bool get_group_mute_state (int a_g_track); void mute_all_tracks(); mastermidibus* get_master_midi_bus( ); void output_func(); void input_func(); long get_max_trigger(); void set_offset( int a_offset ); void save_playing_state(); void restore_playing_state(); const std::map *get_key_events(void) const { return &key_events; }; const std::map *get_key_groups(void) const { return &key_groups; }; void set_key_event( unsigned int keycode, long sequence_slot ); void set_key_group( unsigned int keycode, long group_slot ); // getters of keyboard mapping for sequence and groups, // if not found, returns something "safe" (so use get_key()->count() to see if it's there first) unsigned int lookup_keyevent_key( long seqnum ) { if (key_events_rev.count( seqnum )) return key_events_rev[seqnum]; else return '?';} long lookup_keyevent_seq( unsigned int keycode ) { if (key_events.count( keycode )) return key_events[keycode]; else return 0; } unsigned int lookup_keygroup_key( long groupnum ) { if (key_groups_rev.count( groupnum )) return key_groups_rev[groupnum]; else return '?'; } long lookup_keygroup_group( unsigned int keycode ) { if (key_groups.count( keycode )) return key_groups[keycode]; else return 0; } friend class midifile; friend class optionsfile; friend class options; #ifdef JACK_SUPPORT friend int jack_sync_callback(jack_transport_state_t state, jack_position_t *pos, void *arg); friend void jack_shutdown(void *arg); friend void jack_timebase_callback(jack_transport_state_t state, jack_nframes_t nframes, jack_position_t *pos, int new_pos, void *arg); #endif }; /* located in perform.C */ extern void *output_thread_func(void *a_p); extern void *input_thread_func(void *a_p); #ifdef JACK_SUPPORT int jack_sync_callback(jack_transport_state_t state, jack_position_t *pos, void *arg); void print_jack_pos( jack_position_t* jack_pos ); void jack_shutdown(void *arg); void jack_timebase_callback(jack_transport_state_t state, jack_nframes_t nframes, jack_position_t *pos, int new_pos, void *arg); int jack_process_callback(jack_nframes_t nframes, void* arg); #ifdef JACK_SESSION void jack_session_callback(jack_session_event_t *ev, void *arg); #endif #endif seq24-0.9.3/src/config.h.in0000644000175000017500000000427212651206575012232 00000000000000/* src/config.h.in. Generated from configure.ac by autoheader. */ /* define if the compiler supports basic C++11 syntax */ #undef HAVE_CXX11 /* Define to 1 if you have the header file. */ #undef HAVE_GETOPT_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `asound' library (-lasound). */ #undef HAVE_LIBASOUND /* Define to 1 if you have the `gtkmm-2.4' library (-lgtkmm-2.4). */ #undef HAVE_LIBGTKMM_2_4 /* Define to 1 if you have the `rt' library (-lrt). */ #undef HAVE_LIBRT /* Define to 1 if you have the `sigc-2.0' library (-lsigc-2.0). */ #undef HAVE_LIBSIGC_2_0 /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to enable JACK session support */ #undef JACK_SESSION /* Define to enable JACK driver */ #undef JACK_SUPPORT /* Define to enable LASH support */ #undef LASH_SUPPORT /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* gnu source */ #undef _GNU_SOURCE /* Define to empty if `const' does not conform to ANSI C. */ #undef const seq24-0.9.3/src/seqkeys.cpp0000644000175000017500000002243112651156360012370 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #include "seqkeys.h" #include "font.h" seqkeys::seqkeys(sequence *a_seq, Gtk::Adjustment *a_vadjust ): m_black(Gdk::Color("black")), m_white(Gdk::Color("white")), m_grey(Gdk::Color("grey")), m_seq(a_seq), m_vadjust(a_vadjust), m_scroll_offset_key(0), m_scroll_offset_y(0), m_hint_state(false), m_keying(false), m_scale(0), m_key(0) { add_events( Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK | Gdk::ENTER_NOTIFY_MASK | Gdk::LEAVE_NOTIFY_MASK | Gdk::POINTER_MOTION_MASK | Gdk::SCROLL_MASK); /* set default size */ set_size_request( c_keyarea_x +1, 10 ); //m_window_x = 10; //m_window_y = c_keyarea_y; // in the construor you can only allocate colors, // get_window() returns 0 because we have not be realized Glib::RefPtr colormap = get_default_colormap(); colormap->alloc_color( m_black ); colormap->alloc_color( m_white ); colormap->alloc_color( m_grey ); set_double_buffered( false ); } void seqkeys::on_realize() { // we need to do the default realize Gtk::DrawingArea::on_realize(); // Now we can allocate any additional resources we need m_window = get_window(); m_gc = Gdk::GC::create( m_window ); m_window->clear(); m_pixmap = Gdk::Pixmap::create(m_window, c_keyarea_x, c_keyarea_y, -1 ); update_pixmap(); m_vadjust->signal_value_changed().connect( mem_fun( *this, &seqkeys::change_vert )); change_vert(); } /* sets the music scale */ void seqkeys::set_scale( int a_scale ) { if ( m_scale != a_scale ){ m_scale = a_scale; reset(); } } /* sets the key */ void seqkeys::set_key( int a_key ) { if ( m_key != a_key ){ m_key = a_key; reset(); } } void seqkeys::reset() { update_pixmap(); queue_draw(); } void seqkeys::update_pixmap() { m_gc->set_foreground(m_black); m_pixmap->draw_rectangle(m_gc,true, 0, 0, c_keyarea_x, c_keyarea_y ); m_gc->set_foreground(m_white); m_pixmap->draw_rectangle(m_gc,true, 1, 1, c_keyoffset_x - 1, c_keyarea_y - 2 ); for ( int i=0; iset_foreground(m_white); m_pixmap->draw_rectangle(m_gc,true, c_keyoffset_x + 1, (c_key_y * i) + 1, c_key_x - 2, c_key_y - 1 ); /* the the key in the octave */ int key = (c_num_keys - i - 1) % 12; if ( key == 1 || key == 3 || key == 6 || key == 8 || key == 10 ){ m_gc->set_foreground(m_black); m_pixmap->draw_rectangle(m_gc,true, c_keyoffset_x + 1, (c_key_y * i) + 2, c_key_x - 3, c_key_y - 3 ); } char notes[20]; if ( key == m_key ){ /* notes */ int octave = ((c_num_keys - i - 1) / 12) - 1; if ( octave < 0 ) octave *= -1; snprintf(notes, sizeof(notes), "%2s%1d", c_key_text[key], octave); p_font_renderer->render_string_on_drawable(m_gc, 2, c_key_y * i - 1, m_pixmap, notes, font::BLACK ); } //snprintf(notes, sizeof(notes), "%c %d", c_scales_symbol[m_scale][key], m_scale ); //p_font_renderer->render_string_on_drawable(m_gc, // 2 + (c_text_x * 4), // c_key_y * i - 1, // m_pixmap, notes, font::BLACK ); } } void seqkeys::draw_area() { update_pixmap(); m_window->draw_drawable(m_gc, m_pixmap, 0, m_scroll_offset_y, 0, 0, c_keyarea_x, c_keyarea_y ); } bool seqkeys::on_expose_event(GdkEventExpose* a_e) { m_window->draw_drawable(m_gc, m_pixmap, a_e->area.x, a_e->area.y + m_scroll_offset_y, a_e->area.x, a_e->area.y, a_e->area.width, a_e->area.height ); return true; } void seqkeys::force_draw() { m_window->draw_drawable(m_gc, m_pixmap, 0,m_scroll_offset_y, 0,0, m_window_x, m_window_y ); } /* takes screen corrdinates, give us notes and ticks */ void seqkeys::convert_y( int a_y, int *a_note) { *a_note = (c_rollarea_y - a_y - 2) / c_key_y; } bool seqkeys::on_button_press_event(GdkEventButton *a_e) { int y,note; if ( a_e->type == GDK_BUTTON_PRESS ){ y = (int) a_e->y + m_scroll_offset_y; if ( a_e->button == 1 ){ m_keying = true; convert_y( y,¬e ); m_seq->play_note_on( note ); m_keying_note = note; } } return true; } bool seqkeys::on_button_release_event(GdkEventButton* a_e) { if ( a_e->type == GDK_BUTTON_RELEASE ){ if ( a_e->button == 1 && m_keying ){ m_keying = false; m_seq->play_note_off( m_keying_note ); } } return true; } bool seqkeys::on_motion_notify_event(GdkEventMotion* a_p0) { int y, note; y = (int) a_p0->y + m_scroll_offset_y; convert_y( y,¬e ); set_hint_key( note ); if ( m_keying ){ if ( note != m_keying_note ){ m_seq->play_note_off( m_keying_note ); m_seq->play_note_on( note ); m_keying_note = note; } } return false; } bool seqkeys::on_enter_notify_event(GdkEventCrossing* a_p0) { set_hint_state( true ); return false; } bool seqkeys::on_leave_notify_event(GdkEventCrossing* p0) { if ( m_keying ){ m_keying = false; m_seq->play_note_off( m_keying_note ); } set_hint_state( false ); return true; } /* sets key to grey */ void seqkeys::set_hint_key( int a_key ) { draw_key( m_hint_key, false ); m_hint_key = a_key; if ( m_hint_state ) draw_key( a_key, true ); } /* true == on, false == off */ void seqkeys::set_hint_state( bool a_state ) { m_hint_state = a_state; if ( !a_state ) draw_key( m_hint_key, false ); } /* a_state, false = normal, true = grayed */ void seqkeys::draw_key( int a_key, bool a_state ) { /* the the key in the octave */ int key = a_key % 12; a_key = c_num_keys - a_key - 1; if ( key == 1 || key == 3 || key == 6 || key == 8 || key == 10 ){ m_gc->set_foreground(m_black); } else m_gc->set_foreground(m_white); m_window->draw_rectangle(m_gc,true, c_keyoffset_x + 1, (c_key_y * a_key) + 2 - m_scroll_offset_y, c_key_x - 3, c_key_y - 3 ); if ( a_state ){ m_gc->set_foreground(m_grey); m_window->draw_rectangle(m_gc,true, c_keyoffset_x + 1, (c_key_y * a_key) + 2 - m_scroll_offset_y, c_key_x - 3, c_key_y - 3 ); } } void seqkeys::change_vert( ) { m_scroll_offset_key = (int) m_vadjust->get_value(); m_scroll_offset_y = m_scroll_offset_key * c_key_y, force_draw(); } void seqkeys::on_size_allocate(Gtk::Allocation& a_r ) { Gtk::DrawingArea::on_size_allocate( a_r ); m_window_x = a_r.get_width(); m_window_y = a_r.get_height(); queue_draw(); } bool seqkeys::on_scroll_event( GdkEventScroll* a_ev ) { double val = m_vadjust->get_value(); if ( a_ev->direction == GDK_SCROLL_UP ){ val -= m_vadjust->get_step_increment()/6; } else if ( a_ev->direction == GDK_SCROLL_DOWN ){ val += m_vadjust->get_step_increment()/6; } else { return true; } m_vadjust->clamp_page( val, val + m_vadjust->get_page_size() ); return true; } seq24-0.9.3/src/lash.h0000644000175000017500000000333512651156360011302 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #pragma once #ifdef __WIN32__ #include "configwin32.h" #else #include "config.h" #endif #include "perform.h" #ifdef LASH_SUPPORT #include #endif // LASH_SUPPORT /* all the ifdef skeleton work is done in this class in such a way that any * other part of the code can use this class whether or not lash support is * actually built in (the functions will just do nothing) */ class lash { private: #ifdef LASH_SUPPORT perform *m_perform; lash_client_t *m_client; bool process_events(); void handle_event(lash_event_t* conf); void handle_config(lash_config_t* conf); #endif // LASH_SUPPORT public: lash(int *argc, char ***argv); void set_alsa_client_id(int id); void start(perform* perform); }; /* global lash driver, defined in seq24.cpp and used in midibus.cpp*/ extern lash *lash_driver; seq24-0.9.3/src/seqevent.cpp0000644000175000017500000010666512651156360012552 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #include "event.h" #include "seqevent.h" seqevent::seqevent(sequence *a_seq, int a_zoom, int a_snap, seqdata *a_seqdata_wid, Gtk::Adjustment *a_hadjust): m_black(Gdk::Color("black")), m_white(Gdk::Color("white")), m_grey(Gdk::Color("grey")), m_red(Gdk::Color("orange")), m_hadjust(a_hadjust), m_scroll_offset_ticks(0), m_scroll_offset_x(0), m_seq(a_seq), m_seqdata_wid(a_seqdata_wid), m_zoom(a_zoom), m_snap(a_snap), m_selecting(false), m_moving_init(false), m_moving(false), m_growing(false), m_painting(false), m_paste(false), m_status(EVENT_NOTE_ON) { Glib::RefPtr colormap = get_default_colormap(); colormap->alloc_color( m_black ); colormap->alloc_color( m_white ); colormap->alloc_color( m_grey ); colormap->alloc_color( m_red ); add_events( Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK | Gdk::POINTER_MOTION_MASK | Gdk::KEY_PRESS_MASK | Gdk::KEY_RELEASE_MASK | Gdk::FOCUS_CHANGE_MASK ); set_size_request( 10, c_eventarea_y ); set_double_buffered( false ); memset(&m_old, 0, sizeof m_old); } void seqevent::on_realize() { // we need to do the default realize Gtk::DrawingArea::on_realize(); set_flags( Gtk::CAN_FOCUS ); // Now we can allocate any additional resources we need m_window = get_window(); m_gc = Gdk::GC::create( m_window ); m_window->clear(); m_hadjust->signal_value_changed().connect( mem_fun( *this, &seqevent::change_horz )); update_sizes(); } void seqevent::change_horz( ) { m_scroll_offset_ticks = (int) m_hadjust->get_value(); m_scroll_offset_x = m_scroll_offset_ticks / m_zoom; update_pixmap(); force_draw(); } void seqevent::on_size_allocate(Gtk::Allocation& a_r ) { Gtk::DrawingArea::on_size_allocate( a_r ); m_window_x = a_r.get_width(); m_window_y = a_r.get_height(); update_sizes(); } int seqevent::idle_redraw() { draw_events_on( m_window ); draw_events_on( m_pixmap ); return true; } void seqevent::update_sizes() { if( is_realized() ) { /* create pixmaps with window dimentions */ //printf( "update_sizes() m_window_x[%d] m_window_y[%d]\n", // m_window_x, m_window_y ); m_pixmap = Gdk::Pixmap::create( m_window, m_window_x, m_window_y, -1 ); /* and fill the background ( dotted lines n' such ) */ update_pixmap(); queue_draw(); } } /* basically resets the whole widget as if it was realized again */ void seqevent::reset() { m_scroll_offset_ticks = (int) m_hadjust->get_value(); m_scroll_offset_x = m_scroll_offset_ticks / m_zoom; update_sizes(); update_pixmap(); draw_pixmap_on_window(); } void seqevent::redraw() { m_scroll_offset_ticks = (int) m_hadjust->get_value(); m_scroll_offset_x = m_scroll_offset_ticks / m_zoom; update_pixmap(); draw_pixmap_on_window(); } /* updates background */ void seqevent::draw_background() { //printf ("draw_background()\n" ); /* clear background */ m_gc->set_foreground(m_white); m_pixmap->draw_rectangle(m_gc,true, 0, 0, m_window_x, m_window_y ); /*int measure_length_64ths = m_seq->get_bpm() * 64 / m_seq->get_bw();*/ //printf ( "measure_length_64ths[%d]\n", measure_length_64ths ); //int measures_per_line = (256 / measure_length_64ths) / (32 / m_zoom); //if ( measures_per_line <= 0 int measures_per_line = 1; //printf( "measures_per_line[%d]\n", measures_per_line ); int ticks_per_measure = m_seq->get_bpm() * (4 * c_ppqn) / m_seq->get_bw(); int ticks_per_beat = (4 * c_ppqn) / m_seq->get_bw(); int ticks_per_step = 6 * m_zoom; int ticks_per_m_line = ticks_per_measure * measures_per_line; int start_tick = m_scroll_offset_ticks - (m_scroll_offset_ticks % ticks_per_step ); int end_tick = (m_window_x * m_zoom) + m_scroll_offset_ticks; //printf ( "ticks_per_step[%d] start_tick[%d] end_tick[%d]\n", // ticks_per_step, start_tick, end_tick ); m_gc->set_foreground(m_grey); for ( int i=start_tick; iset_foreground(m_black); m_gc->set_line_attributes( 1, Gdk::LINE_SOLID, Gdk::CAP_NOT_LAST, Gdk::JOIN_MITER ); } else if (i % ticks_per_beat == 0 ){ m_gc->set_foreground(m_grey); m_gc->set_line_attributes( 1, Gdk::LINE_SOLID, Gdk::CAP_NOT_LAST, Gdk::JOIN_MITER ); } else { m_gc->set_foreground(m_grey); m_gc->set_line_attributes( 1, Gdk::LINE_ON_OFF_DASH, Gdk::CAP_NOT_LAST, Gdk::JOIN_MITER ); gint8 dash = 1; m_gc->set_dashes( 0, &dash, 1 ); } m_pixmap->draw_line(m_gc, base_line - m_scroll_offset_x, 0, base_line - m_scroll_offset_x, m_window_y); } /* reset line style */ m_gc->set_line_attributes( 1, Gdk::LINE_SOLID, Gdk::CAP_NOT_LAST, Gdk::JOIN_MITER ); m_gc->set_foreground(m_black); m_pixmap->draw_rectangle(m_gc,false, -1, 0, m_window_x + 1, m_window_y - 1 ); } /* sets zoom, resets */ void seqevent::set_zoom( int a_zoom ) { if ( m_zoom != a_zoom ){ m_zoom = a_zoom; reset(); } } /* simply sets the snap member */ void seqevent::set_snap( int a_snap ) { m_snap = a_snap; } void seqevent::set_data_type( unsigned char a_status, unsigned char a_control = 0 ) { m_status = a_status; m_cc = a_control; this->redraw(); } /* draws background pixmap on main pixmap, then puts the events on */ void seqevent::update_pixmap() { draw_background(); draw_events_on_pixmap(); m_seqdata_wid->update_pixmap(); m_seqdata_wid->draw_pixmap_on_window(); } void seqevent::draw_events_on( Glib::RefPtr a_draw ) { long tick; int x; unsigned char d0,d1; bool selected; /* draw boxes from sequence */ m_gc->set_foreground( m_black ); int start_tick = m_scroll_offset_ticks ; int end_tick = (m_window_x * m_zoom) + m_scroll_offset_ticks; m_seq->reset_draw_marker(); while ( m_seq->get_next_event( m_status, m_cc, &tick, &d0, &d1, &selected ) == true ){ if ( (tick >= start_tick && tick <= end_tick )){ /* turn into screen corrids */ x = tick / m_zoom; m_gc->set_foreground(m_black); a_draw->draw_rectangle(m_gc,true, x - m_scroll_offset_x, (c_eventarea_y - c_eventevent_y)/2, c_eventevent_x, c_eventevent_y ); if ( selected ) m_gc->set_foreground(m_red); else m_gc->set_foreground(m_white); a_draw->draw_rectangle(m_gc,true, x - m_scroll_offset_x + 1, (c_eventarea_y - c_eventevent_y)/2 + 1, c_eventevent_x - 3, c_eventevent_y - 3 ); } } } /* fills main pixmap with events */ void seqevent::draw_events_on_pixmap() { draw_events_on( m_pixmap ); } /* draws pixmap, tells event to do the same */ void seqevent::draw_pixmap_on_window() { /* we changed something on this window, and chances are we need to update the event widget as well */ queue_draw(); // and update our velocity window //m_seqdata_wid->update_pixmap(); //m_seqdata_wid->draw_pixmap_on_window(); // RCB ?? } /* checks mins / maxes.. the fills in x,y and width and height */ void seqevent::x_to_w( int a_x1, int a_x2, int *a_x, int *a_w ) { if ( a_x1 < a_x2 ){ *a_x = a_x1; *a_w = a_x2 - a_x1; } else { *a_x = a_x2; *a_w = a_x1 - a_x2; } } void seqevent::draw_selection_on_window() { int x,w; int y = (c_eventarea_y - c_eventevent_y)/2; int h = c_eventevent_y; m_gc->set_line_attributes( 1, Gdk::LINE_SOLID, Gdk::CAP_NOT_LAST, Gdk::JOIN_MITER ); /* replace old */ m_window->draw_drawable(m_gc, m_pixmap, m_old.x, y, m_old.x, y, m_old.width + 1, h + 1 ); if ( m_selecting ){ x_to_w( m_drop_x, m_current_x, &x,&w ); x -= m_scroll_offset_x; m_old.x = x; m_old.width = w; m_gc->set_foreground(m_black); m_window->draw_rectangle(m_gc,false, x, y, w, h ); } if ( m_moving || m_paste ){ int delta_x = m_current_x - m_drop_x; x = m_selected.x + delta_x; x -= m_scroll_offset_x; m_gc->set_foreground(m_black); m_window->draw_rectangle(m_gc,false, x, y, m_selected.width, h ); m_old.x = x; m_old.width = m_selected.width; } } bool seqevent::on_expose_event(GdkEventExpose* e) { m_window->draw_drawable(m_gc, m_pixmap, e->area.x, e->area.y, e->area.x, e->area.y, e->area.width, e->area.height ); draw_selection_on_window(); return true; } void seqevent::force_draw() { m_window->draw_drawable(m_gc, m_pixmap, 0, 0, 0, 0, m_window_x, m_window_y ); draw_selection_on_window(); } void seqevent::start_paste( ) { long tick_s; long tick_f; int note_h; int note_l; int x, w; snap_x( &m_current_x ); snap_y( &m_current_x ); m_drop_x = m_current_x; m_drop_y = m_current_y; m_paste = true; /* get the box that selected elements are in */ m_seq->get_clipboard_box( &tick_s, ¬e_h, &tick_f, ¬e_l ); /* convert box to X,Y values */ convert_t( tick_s, &x ); convert_t( tick_f, &w ); /* w is actually corrids now, so we have to change */ w = w-x; /* set the m_selected rectangle to hold the x,y,w,h of our selected events */ m_selected.x = x; m_selected.width=w; m_selected.y = (c_eventarea_y - c_eventevent_y)/2; m_selected.height = c_eventevent_y; /* adjust for clipboard being shifted to tick 0 */ m_selected.x += m_drop_x; } /* takes screen corrdinates, give us notes and ticks */ void seqevent::convert_x( int a_x, long *a_tick ) { *a_tick = a_x * m_zoom; } /* notes and ticks to screen corridinates */ void seqevent::convert_t( long a_ticks, int *a_x ) { *a_x = a_ticks / m_zoom; } bool seqevent::on_button_press_event(GdkEventButton* a_ev) { bool result; switch (global_interactionmethod) { case e_fruity_interaction: result = m_fruity_interaction.on_button_press_event(a_ev, *this); case e_seq24_interaction: result = m_seq24_interaction.on_button_press_event(a_ev, *this); default: result = false; } return result; } void seqevent::drop_event( long a_tick ) { unsigned char status = m_status; unsigned char d0 = m_cc; unsigned char d1 = 0x40; if ( m_status == EVENT_AFTERTOUCH ) d0 = 0; if ( m_status == EVENT_PROGRAM_CHANGE ) d0 = 0; /* d0 == new patch */ if ( m_status == EVENT_CHANNEL_PRESSURE ) d0 = 0x40; /* d0 == pressure */ if ( m_status == EVENT_PITCH_WHEEL ) d0 = 0; m_seq->add_event( a_tick, status, d0, d1, true ); } bool seqevent::on_button_release_event(GdkEventButton* a_ev) { bool result; switch (global_interactionmethod) { case e_fruity_interaction: result = m_fruity_interaction.on_button_release_event(a_ev, *this); case e_seq24_interaction: result = m_seq24_interaction.on_button_release_event(a_ev, *this); default: result = false; } return result; } bool seqevent::on_motion_notify_event(GdkEventMotion* a_ev) { bool result; switch (global_interactionmethod) { case e_fruity_interaction: result = m_fruity_interaction.on_motion_notify_event(a_ev, *this); case e_seq24_interaction: result = m_seq24_interaction.on_motion_notify_event(a_ev, *this); default: result = false; } return result; } /* performs a 'snap' on y */ void seqevent::snap_y( int *a_y ) { *a_y = *a_y - (*a_y % c_key_y); } /* performs a 'snap' on x */ void seqevent::snap_x( int *a_x ) { //snap = number pulses to snap to //m_zoom = number of pulses per pixel //so snap / m_zoom = number pixels to snap to int mod = (m_snap / m_zoom); if ( mod <= 0 ) mod = 1; *a_x = *a_x - (*a_x % mod ); } bool seqevent::on_focus_in_event(GdkEventFocus*) { set_flags(Gtk::HAS_FOCUS); return false; } bool seqevent::on_focus_out_event(GdkEventFocus*) { unset_flags(Gtk::HAS_FOCUS); return false; } bool seqevent::on_key_press_event(GdkEventKey* a_p0) { bool ret = false; if ( a_p0->type == GDK_KEY_PRESS ){ if ( a_p0->keyval == GDK_Delete || a_p0->keyval == GDK_BackSpace ){ m_seq->push_undo(); m_seq->mark_selected(); m_seq->remove_marked(); ret = true; } if ( a_p0->state & GDK_CONTROL_MASK ){ /* cut */ if ( a_p0->keyval == GDK_x || a_p0->keyval == GDK_X ){ m_seq->copy_selected(); m_seq->mark_selected(); m_seq->remove_marked(); ret = true; } /* copy */ if ( a_p0->keyval == GDK_c || a_p0->keyval == GDK_C ){ m_seq->copy_selected(); ret = true; } /* paste */ if ( a_p0->keyval == GDK_v || a_p0->keyval == GDK_V ){ start_paste(); ret = true; } /* Undo */ if ( a_p0->keyval == GDK_z || a_p0->keyval == GDK_Z ){ m_seq->pop_undo(); ret = true; } } } if ( ret == true ){ redraw(); m_seq->set_dirty(); return true; } else return false; } ////////////////////////// // interaction methods ////////////////////////// void FruitySeqEventInput::updateMousePtr(seqevent& ths) { // context sensitive mouse long tick_s, tick_w, tick_f, pos; ths.convert_x( ths.m_current_x, &tick_s ); ths.convert_x( c_eventevent_x, &tick_w ); tick_f = tick_s + tick_w; if ( tick_s < 0 ) tick_s = 0; // clamp to 0 if (m_is_drag_pasting || ths.m_selecting || ths.m_moving || ths.m_paste) { ths.get_window()->set_cursor( Gdk::Cursor( Gdk::LEFT_PTR )); } else if (ths.m_seq->intersectEvents( tick_s, tick_f, ths.m_status, pos )) { ths.get_window()->set_cursor( Gdk::Cursor( Gdk::CENTER_PTR )); } else { ths.get_window()->set_cursor( Gdk::Cursor( Gdk::PENCIL )); } } bool FruitySeqEventInput::on_button_press_event(GdkEventButton* a_ev, seqevent& ths) { int x,w,numsel; long tick_s; long tick_f; long tick_w; ths.convert_x( c_eventevent_x, &tick_w ); /* if it was a button press */ /* set values for dragging */ ths.m_drop_x = ths.m_current_x = (int) a_ev->x + ths.m_scroll_offset_x; /* reset box that holds dirty redraw spot */ ths.m_old.x = 0; ths.m_old.y = 0; ths.m_old.width = 0; ths.m_old.height = 0; if ( ths.m_paste ){ ths.snap_x( &ths.m_current_x ); ths.convert_x( ths.m_current_x, &tick_s ); ths.m_paste = false; ths.m_seq->push_undo(); ths.m_seq->paste_selected( tick_s, 0 ); } else { /* left mouse button */ if ( a_ev->button == 1 ) { /* turn x,y in to tick/note */ ths.convert_x( ths.m_drop_x, &tick_s ); /* shift back a few ticks */ tick_f = tick_s + (ths.m_zoom); tick_s -= (tick_w); if ( tick_s < 0 ) tick_s = 0; if ( ! ths.m_seq->select_events( tick_s, tick_f, ths.m_status, ths.m_cc, sequence::e_would_select ) && !(a_ev->state & GDK_CONTROL_MASK) ) { ths.m_painting = true; ths.snap_x( &ths.m_drop_x ); /* turn x,y in to tick/note */ ths.convert_x( ths.m_drop_x, &tick_s ); /* add note, length = little less than snap */ if ( ! ths.m_seq->select_events( tick_s, tick_f, ths.m_status, ths.m_cc, sequence::e_would_select )) { ths.m_seq->push_undo(); ths.drop_event( tick_s ); } } else /* selecting */ { if ( ! ths.m_seq->select_events( tick_s, tick_f, ths.m_status, ths.m_cc, sequence::e_is_selected )) { // if clicking event... if (ths.m_seq->select_events( tick_s, tick_f, ths.m_status, ths.m_cc, sequence::e_would_select ) ) { if ( ! (a_ev->state & GDK_CONTROL_MASK) ) ths.m_seq->unselect(); } // if clicking empty space ... else { // ... unselect all if ctrl-shift not held if (! ((a_ev->state & GDK_CONTROL_MASK) && (a_ev->state & GDK_SHIFT_MASK)) ) ths.m_seq->unselect(); } /* on direct click select only one event */ numsel = ths.m_seq->select_events( tick_s, tick_f, ths.m_status, ths.m_cc, sequence::e_select_one ); // prevent deselect in button_release() if (numsel) m_justselected_one = true; // if nothing selected, start the selection box if (numsel == 0 && (a_ev->state & GDK_CONTROL_MASK)) ths.m_selecting = true; } // if event under cursor is selected if ( ths.m_seq->select_events( tick_s, tick_f, ths.m_status, ths.m_cc, sequence::e_is_selected )) { // grab/move the note if ( !(a_ev->state & GDK_CONTROL_MASK) ) { ths.m_moving_init = true; int note; /* get the box that selected elements are in */ ths.m_seq->get_selected_box( &tick_s, ¬e, &tick_f, ¬e ); tick_f += tick_w; /* convert box to X,Y values */ ths.convert_t( tick_s, &x ); ths.convert_t( tick_f, &w ); /* w is actually corrids now, so we have to change */ w = w-x; /* set the m_selected rectangle to hold the x,y,w,h of our selected events */ ths.m_selected.x = x; ths.m_selected.width=w; ths.m_selected.y = (c_eventarea_y - c_eventevent_y)/2; ths.m_selected.height = c_eventevent_y; /* save offset that we get from the snap above */ int adjusted_selected_x = ths.m_selected.x; ths.snap_x( &adjusted_selected_x ); ths.m_move_snap_offset_x = ( ths.m_selected.x - adjusted_selected_x); /* align selection for drawing */ ths.snap_x( &ths.m_selected.x ); ths.snap_x( &ths.m_current_x ); ths.snap_x( &ths.m_drop_x ); } // ctrl left click when stuff is already selected else if ((a_ev->state & GDK_CONTROL_MASK) && ths.m_seq->select_events( tick_s, tick_f, ths. m_status, ths.m_cc, sequence::e_is_selected )) { m_is_drag_pasting_start = true; } } } } /* end if button == 1 */ if ( a_ev->button == 3 ) { /* turn x,y in to tick/note */ ths.convert_x( ths.m_drop_x, &tick_s ); /* shift back a few ticks */ tick_f = tick_s + (ths.m_zoom); tick_s -= (tick_w); if ( tick_s < 0 ) tick_s = 0; //erase event under cursor if there is one if (ths.m_seq->select_events( tick_s, tick_f, ths.m_status, ths.m_cc, sequence::e_would_select )) { /* remove only the note under the cursor, leave the selection intact */ ths.m_seq->push_undo(); ths.m_seq->select_events( tick_s, tick_f, ths.m_status, ths.m_cc, sequence::e_remove_one ); ths.redraw(); ths.m_seq->set_dirty(); } else /* selecting */ { if ( ! (a_ev->state & GDK_CONTROL_MASK) ) ths.m_seq->unselect(); // nothing selected, start the selection box ths.m_selecting = true; } } } /* if they clicked, something changed */ ths.update_pixmap(); ths.draw_pixmap_on_window(); updateMousePtr( ths ); return true; } bool FruitySeqEventInput::on_button_release_event(GdkEventButton* a_ev, seqevent& ths) { long tick_s; long tick_f; int x,w; ths.grab_focus( ); ths.m_current_x = (int) a_ev->x + ths.m_scroll_offset_x;; if ( ths.m_moving || m_is_drag_pasting ) ths.snap_x( &ths.m_current_x ); int delta_x = ths.m_current_x - ths.m_drop_x; long delta_tick; if ( a_ev->button == 1 ){ int current_x = ths.m_current_x; long t_s, t_f; ths.snap_x( ¤t_x ); ths.convert_x( current_x, &t_s ); /* shift back a few ticks */ t_f = t_s + (ths.m_zoom); if ( t_s < 0 ) t_s = 0; // ctrl-left click button up for select/drag copy/paste // left click button up for ending a move of selected notes if ( m_is_drag_pasting ) { m_is_drag_pasting = false; m_is_drag_pasting_start = false; /* convert deltas into screen corridinates */ ths.m_paste = false; ths.m_seq->push_undo(); ths.m_seq->paste_selected( t_s, 0 ); //m_seq->unselect(); } // ctrl-left click but without movement - select a note if (m_is_drag_pasting_start) { m_is_drag_pasting_start = false; // if ctrl-left click without movement and // if note under cursor is selected, and ctrl is held // and buttondown didn't just select one if (!m_justselected_one && ths.m_seq->select_events( t_s, t_f, ths.m_status, ths.m_cc, sequence::e_is_selected ) && (a_ev->state & GDK_CONTROL_MASK)) { // deselect the event ths.m_seq->select_events( t_s, t_f, ths.m_status, ths.m_cc, sequence::e_deselect ); } } m_justselected_one = false; // clear flag on left button up if ( ths.m_moving ){ /* adjust for snap */ delta_x -= ths.m_move_snap_offset_x; /* convert deltas into screen corridinates */ ths.convert_x( delta_x, &delta_tick ); /* not really notes, but still moves events */ ths.m_seq->push_undo(); ths.m_seq->move_selected_notes( delta_tick, 0 ); } } if ( a_ev->button == 3 || a_ev->button == 1 ){ if ( ths.m_selecting ){ ths.x_to_w( ths.m_drop_x, ths.m_current_x, &x, &w ); ths.convert_x( x, &tick_s ); ths.convert_x( x+w, &tick_f ); ths.m_seq->select_events( tick_s, tick_f, ths.m_status, ths.m_cc, sequence::e_toggle_selection ); } } /* turn off */ ths.m_selecting = false; ths.m_moving = false; ths.m_growing = false; ths.m_moving_init = false; ths.m_painting = false; ths.m_seq->unpaint_all(); /* if they clicked, something changed */ ths.update_pixmap(); ths.draw_pixmap_on_window(); updateMousePtr(ths); return true; } bool FruitySeqEventInput::on_motion_notify_event(GdkEventMotion* a_ev, seqevent& ths) { long tick = 0; ths.m_current_x = (int) a_ev->x + ths.m_scroll_offset_x; if ( ths.m_moving_init ) { ths.m_moving_init = false; ths.m_moving = true; } // context sensitive mouse pointer... updateMousePtr(ths); // ctrl-left click drag on selected note(s) starts a copy/unselect/paste if ( m_is_drag_pasting_start ) { ths.m_seq->copy_selected(); ths.m_seq->unselect(); ths.start_paste(); m_is_drag_pasting_start = false; m_is_drag_pasting = true; } if ( ths.m_selecting || ths.m_moving || ths.m_paste ){ if ( ths.m_moving || ths.m_paste ) ths.snap_x( &ths.m_current_x ); ths.draw_selection_on_window(); } if ( ths.m_painting ) { ths.m_current_x = (int) a_ev->x + ths.m_scroll_offset_x;; ths.snap_x( &ths.m_current_x ); ths.convert_x( ths.m_current_x, &tick ); ths.drop_event( tick ); } return true; } void Seq24SeqEventInput::set_adding( bool a_adding, seqevent& ths ) { if ( a_adding ) { ths.get_window()->set_cursor( Gdk::Cursor( Gdk::PENCIL ) ); m_adding = true; } else { ths.get_window()->set_cursor( Gdk::Cursor( Gdk::LEFT_PTR ) ); m_adding = false; } } bool Seq24SeqEventInput::on_button_press_event(GdkEventButton* a_ev, seqevent& ths) { int x,w,numsel; long tick_s; long tick_f; long tick_w; ths.convert_x( c_eventevent_x, &tick_w ); /* if it was a button press */ /* set values for dragging */ ths.m_drop_x = ths.m_current_x = (int) a_ev->x + ths.m_scroll_offset_x; /* reset box that holds dirty redraw spot */ ths.m_old.x = 0; ths.m_old.y = 0; ths.m_old.width = 0; ths.m_old.height = 0; if ( ths.m_paste ){ ths.snap_x( &ths.m_current_x ); ths.convert_x( ths.m_current_x, &tick_s ); ths.m_paste = false; ths.m_seq->push_undo(); ths.m_seq->paste_selected( tick_s, 0 ); } else { /* left mouse button */ if ( a_ev->button == 1 ){ /* turn x,y in to tick/note */ ths.convert_x( ths.m_drop_x, &tick_s ); /* shift back a few ticks */ tick_f = tick_s + (ths.m_zoom); tick_s -= (tick_w); if ( tick_s < 0 ) tick_s = 0; if ( m_adding ) { ths.m_painting = true; ths.snap_x( &ths.m_drop_x ); /* turn x,y in to tick/note */ ths.convert_x( ths.m_drop_x, &tick_s ); /* add note, length = little less than snap */ if ( ! ths.m_seq->select_events( tick_s, tick_f, ths.m_status, ths.m_cc, sequence::e_would_select )) { ths.m_seq->push_undo(); ths.drop_event( tick_s ); } } else /* selecting */ { if ( ! ths.m_seq->select_events( tick_s, tick_f, ths.m_status, ths.m_cc, sequence::e_is_selected )) { if ( ! (a_ev->state & GDK_CONTROL_MASK) ) { ths.m_seq->unselect(); } numsel = ths.m_seq->select_events( tick_s, tick_f, ths.m_status, ths.m_cc, sequence::e_select_one ); /* if we didnt select anyhing (user clicked empty space) unselect all notes, and start selecting */ /* none selected, start selection box */ if ( numsel == 0 ) { ths.m_selecting = true; } else { /// needs update } } if ( ths.m_seq->select_events( tick_s, tick_f, ths.m_status, ths.m_cc, sequence::e_is_selected )) { ths.m_moving_init = true; int note; /* get the box that selected elements are in */ ths.m_seq->get_selected_box( &tick_s, ¬e, &tick_f, ¬e ); tick_f += tick_w; /* convert box to X,Y values */ ths.convert_t( tick_s, &x ); ths.convert_t( tick_f, &w ); /* w is actually corrids now, so we have to change */ w = w-x; /* set the m_selected rectangle to hold the x,y,w,h of our selected events */ ths.m_selected.x = x; ths.m_selected.width=w; ths.m_selected.y = (c_eventarea_y - c_eventevent_y)/2; ths.m_selected.height = c_eventevent_y; /* save offset that we get from the snap above */ int adjusted_selected_x = ths.m_selected.x; ths.snap_x( &adjusted_selected_x ); ths.m_move_snap_offset_x = ( ths.m_selected.x - adjusted_selected_x); /* align selection for drawing */ ths.snap_x( &ths.m_selected.x ); ths.snap_x( &ths.m_current_x ); ths.snap_x( &ths.m_drop_x ); } } } /* end if button == 1 */ if ( a_ev->button == 3 ){ set_adding( true, ths ); } } /* if they clicked, something changed */ ths.update_pixmap(); ths.draw_pixmap_on_window(); return true; } bool Seq24SeqEventInput::on_button_release_event(GdkEventButton* a_ev, seqevent& ths) { long tick_s; long tick_f; int x,w; ths.grab_focus( ); ths.m_current_x = (int) a_ev->x + ths.m_scroll_offset_x;; if ( ths.m_moving ) ths.snap_x( &ths.m_current_x ); int delta_x = ths.m_current_x - ths.m_drop_x; long delta_tick; if ( a_ev->button == 1 ){ if ( ths.m_selecting ){ ths.x_to_w( ths.m_drop_x, ths.m_current_x, &x, &w ); ths.convert_x( x, &tick_s ); ths.convert_x( x+w, &tick_f ); ths.m_seq->select_events( tick_s, tick_f, ths.m_status, ths.m_cc, sequence::e_select ); } if ( ths.m_moving ){ /* adjust for snap */ delta_x -= ths.m_move_snap_offset_x; /* convert deltas into screen corridinates */ ths.convert_x( delta_x, &delta_tick ); /* not really notes, but still moves events */ ths.m_seq->push_undo(); ths.m_seq->move_selected_notes( delta_tick, 0 ); } set_adding( m_adding, ths ); } if ( a_ev->button == 3 ){ set_adding( false, ths ); } /* turn off */ ths.m_selecting = false; ths.m_moving = false; ths.m_growing = false; ths.m_moving_init = false; ths.m_painting = false; ths.m_seq->unpaint_all(); /* if they clicked, something changed */ ths.update_pixmap(); ths.draw_pixmap_on_window(); return true; } bool Seq24SeqEventInput::on_motion_notify_event(GdkEventMotion* a_ev, seqevent& ths) { long tick = 0; if ( ths.m_moving_init ){ ths.m_moving_init = false; ths.m_moving = true; } if ( ths.m_selecting || ths.m_moving || ths.m_paste ){ ths.m_current_x = (int) a_ev->x + ths.m_scroll_offset_x;; if ( ths.m_moving || ths.m_paste ) ths.snap_x( &ths.m_current_x ); ths.draw_selection_on_window(); } if ( ths.m_painting ) { ths.m_current_x = (int) a_ev->x + ths.m_scroll_offset_x;; ths.snap_x( &ths.m_current_x ); ths.convert_x( ths.m_current_x, &tick ); ths.drop_event( tick ); } return true; } seq24-0.9.3/src/seqtime.cpp0000644000175000017500000001673112651156360012361 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #include "event.h" #include "seqtime.h" #include "font.h" seqtime::seqtime(sequence *a_seq, int a_zoom, Gtk::Adjustment *a_hadjust): m_black(Gdk::Color("black")), m_white(Gdk::Color("white")), m_grey(Gdk::Color("grey")), m_hadjust(a_hadjust), m_scroll_offset_ticks(0), m_scroll_offset_x(0), m_seq(a_seq), m_zoom(a_zoom) { add_events( Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK ); // in the construor you can only allocate colors, // get_window() returns 0 because we have not be realized Glib::RefPtr colormap = get_default_colormap(); colormap->alloc_color( m_black ); colormap->alloc_color( m_white ); colormap->alloc_color( m_grey ); /* set default size */ set_size_request( 10, c_timearea_y ); set_double_buffered( false ); } void seqtime::update_sizes() { /* set these for later */ if( is_realized() ) { m_pixmap = Gdk::Pixmap::create( m_window, m_window_x, m_window_y, -1 ); update_pixmap(); queue_draw(); } } void seqtime::on_realize() { // we need to do the default realize Gtk::DrawingArea::on_realize(); //Gtk::Main::idle.connect(mem_fun(this,&seqtime::idleProgress)); Glib::signal_timeout().connect(mem_fun(*this,&seqtime::idle_progress), 50); // Now we can allocate any additional resources we need m_window = get_window(); m_gc = Gdk::GC::create( m_window ); m_window->clear(); m_hadjust->signal_value_changed().connect( mem_fun( *this, &seqtime::change_horz )); update_sizes(); } void seqtime::change_horz( ) { m_scroll_offset_ticks = (int) m_hadjust->get_value(); m_scroll_offset_x = m_scroll_offset_ticks / m_zoom; update_pixmap(); force_draw(); } void seqtime::on_size_allocate(Gtk::Allocation & a_r ) { Gtk::DrawingArea::on_size_allocate( a_r ); m_window_x = a_r.get_width(); m_window_y = a_r.get_height(); update_sizes(); } bool seqtime::idle_progress( ) { return true; } void seqtime::set_zoom( int a_zoom ) { m_zoom = a_zoom; reset(); } void seqtime::reset() { m_scroll_offset_ticks = (int) m_hadjust->get_value(); m_scroll_offset_x = m_scroll_offset_ticks / m_zoom; update_sizes(); update_pixmap(); draw_pixmap_on_window(); } void seqtime::redraw() { m_scroll_offset_ticks = (int) m_hadjust->get_value(); m_scroll_offset_x = m_scroll_offset_ticks / m_zoom; update_pixmap(); draw_pixmap_on_window(); } void seqtime::update_pixmap() { /* clear background */ m_gc->set_foreground(m_white); m_pixmap->draw_rectangle(m_gc,true, 0, 0, m_window_x, m_window_y ); m_gc->set_foreground(m_black); m_pixmap->draw_line(m_gc, 0, m_window_y - 1, m_window_x, m_window_y - 1 ); // at 32, a bar every measure // at 16 /* zoom 32 16 8 4 1 ml c_ppqn * 1 128 2 64 4 32 16 8 8 16m 8 4 2 1 16 8m 4 2 1 1 32 4m 2 1 1 1 64 2m 1 1 1 1 128 1m 1 1 1 1 */ int measure_length_32nds = m_seq->get_bpm() * 32 / m_seq->get_bw(); //printf ( "measure_length_32nds[%d]\n", measure_length_32nds ); int measures_per_line = (128 / measure_length_32nds) / (32 / m_zoom); if ( measures_per_line <= 0 ) measures_per_line = 1; //printf( "measures_per_line[%d]\n", measures_per_line ); int ticks_per_measure = m_seq->get_bpm() * (4 * c_ppqn) / m_seq->get_bw(); int ticks_per_step = ticks_per_measure * measures_per_line; int start_tick = m_scroll_offset_ticks - (m_scroll_offset_ticks % ticks_per_step ); int end_tick = (m_window_x * m_zoom) + m_scroll_offset_ticks; //printf ( "ticks_per_step[%d] start_tick[%d] end_tick[%d]\n", // ticks_per_step, start_tick, end_tick ); /* draw vert lines */ m_gc->set_foreground(m_black); for ( int i=start_tick; idraw_line(m_gc, base_line - m_scroll_offset_x , 0, base_line - m_scroll_offset_x , m_window_y ); char bar[5]; snprintf(bar, sizeof(bar), "%d", (i/ ticks_per_measure ) + 1); m_gc->set_foreground(m_black); p_font_renderer->render_string_on_drawable(m_gc, base_line + 2 - m_scroll_offset_x , 0, m_pixmap, bar, font::BLACK ); } long end_x = m_seq->get_length() / m_zoom - m_scroll_offset_x; m_gc->set_foreground(m_black); m_pixmap->draw_rectangle(m_gc,true, end_x, 9, 19, 8 ); p_font_renderer->render_string_on_drawable(m_gc, end_x + 1, 9, m_pixmap, "END", font::WHITE ); } void seqtime::draw_pixmap_on_window() { m_window->draw_drawable(m_gc, m_pixmap, 0,0, 0,0, m_window_x, m_window_y ); } bool seqtime::on_expose_event(GdkEventExpose* a_e) { m_window->draw_drawable(m_gc, m_pixmap, a_e->area.x, a_e->area.y, a_e->area.x, a_e->area.y, a_e->area.width, a_e->area.height ); return true; } void seqtime::force_draw() { m_window->draw_drawable(m_gc, m_pixmap, 0,0, 0,0, m_window_x, m_window_y ); } bool seqtime::on_button_press_event(GdkEventButton* p0) { return false; } bool seqtime::on_button_release_event(GdkEventButton* p0) { return false; } seq24-0.9.3/src/seqkeys.h0000644000175000017500000000537712651156360012047 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #pragma once #include "sequence.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include "globals.h" /* holds the left side piano */ class seqkeys : public Gtk::DrawingArea { private: Glib::RefPtr m_gc; Glib::RefPtr m_window; Gdk::Color m_black, m_white, m_grey; Glib::RefPtr m_pixmap; sequence *m_seq; Gtk::Adjustment *m_vadjust; int m_scroll_offset_key; int m_scroll_offset_y; int m_window_x; int m_window_y; void on_realize(); bool on_expose_event(GdkEventExpose* a_ev); bool on_button_press_event(GdkEventButton* a_ev); bool on_button_release_event(GdkEventButton* a_ev); bool on_motion_notify_event(GdkEventMotion* a_p0); bool on_leave_notify_event(GdkEventCrossing* p0); bool on_enter_notify_event(GdkEventCrossing* p0); bool on_scroll_event( GdkEventScroll* a_ev); void draw_area(); void update_pixmap(); void convert_y( int a_y, int *a_note); bool m_hint_state; int m_hint_key; bool m_keying; int m_keying_note; int m_scale; int m_key; void draw_key( int a_key, bool a_state ); void on_size_allocate(Gtk::Allocation&); void change_vert(); void force_draw(); void update_sizes(); void reset(); public: /* sets key to grey */ void set_hint_key( int a_key ); /* true == on, false == off */ void set_hint_state( bool a_state ); seqkeys( sequence *a_seq, Gtk::Adjustment *a_vadjust ); void set_scale( int a_scale ); void set_key( int a_key ); }; seq24-0.9.3/src/lash.cpp0000644000175000017500000000633711721750605011641 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #include #include #include #include "lash.h" #include "midifile.h" lash::lash(int *argc, char ***argv) { #ifdef LASH_SUPPORT m_perform = NULL; m_client = lash_init(lash_extract_args(argc, argv), PACKAGE_NAME, LASH_Config_File, LASH_PROTOCOL(2, 0)); if (m_client == NULL) { fprintf(stderr, "Failed to connect to LASH. " "Session management will not occur.\n"); } else { lash_event_t* event = lash_event_new_with_type(LASH_Client_Name); lash_event_set_string(event, "Seq24"); lash_send_event(m_client, event); printf("[Connected to LASH]\n"); } #endif // LASH_SUPPORT } void lash::set_alsa_client_id(int id) { #ifdef LASH_SUPPORT lash_alsa_client_id(m_client, id); #endif } void lash::start(perform* perform) { #ifdef LASH_SUPPORT m_perform = perform; /* Process any LASH events every 250 msec (arbitrarily chosen interval) */ Glib::signal_timeout().connect(sigc::mem_fun(*this, &lash::process_events), 250); #endif // LASH_SUPPORT } #ifdef LASH_SUPPORT bool lash::process_events() { lash_event_t *ev = NULL; // Process events while ((ev = lash_get_event(m_client)) != NULL) { handle_event(ev); lash_event_destroy(ev); } return true; } void lash::handle_event(lash_event_t* ev) { LASH_Event_Type type = lash_event_get_type(ev); const char *c_str = lash_event_get_string(ev); std::string str = (c_str == NULL) ? "" : c_str; if (type == LASH_Save_File) { midifile f(str + "/seq24.mid"); f.write(m_perform); lash_send_event(m_client, lash_event_new_with_type(LASH_Save_File)); } else if (type == LASH_Restore_File) { midifile f(str + "/seq24.mid"); f.parse(m_perform, 0); lash_send_event(m_client, lash_event_new_with_type(LASH_Restore_File)); } else if (type == LASH_Quit) { m_client = NULL; Gtk::Main::quit(); } else { fprintf(stderr, "Warning: Unhandled LASH event.\n"); } } void lash::handle_config(lash_config_t* conf) { const char *key = NULL; const void *val = NULL; size_t val_size = 0; key = lash_config_get_key(conf); val = lash_config_get_value(conf); val_size = lash_config_get_value_size(conf); } #endif // LASH_SUPPORT seq24-0.9.3/src/seqroll.h0000644000175000017500000001440312651156360012032 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 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. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #pragma once #include "sequence.h" #include "seqkeys.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include "globals.h" #include "seqdata.h" #include "seqevent.h" #include "perform.h" using namespace Gtk; class rect { public: int x, y, height, width; }; class seqroll; struct FruitySeqRollInput { FruitySeqRollInput() : m_adding( false ), m_canadd( true ), m_erase_painting( false ) {} bool on_button_press_event(GdkEventButton* a_ev, seqroll& ths); bool on_button_release_event(GdkEventButton* a_ev, seqroll& ths); bool on_motion_notify_event(GdkEventMotion* a_ev, seqroll& ths); void updateMousePtr(seqroll& ths); bool m_adding; bool m_canadd; bool m_erase_painting; long m_drag_paste_start_pos[2]; }; struct Seq24SeqRollInput { Seq24SeqRollInput() : m_adding( false ) {} bool on_button_press_event(GdkEventButton* a_ev, seqroll& ths); bool on_button_release_event(GdkEventButton* a_ev, seqroll& ths); bool on_motion_notify_event(GdkEventMotion* a_ev, seqroll& ths); void set_adding( bool a_adding, seqroll& ths ); bool m_adding; }; /* piano roll */ class seqroll : public Gtk::DrawingArea { private: friend struct FruitySeqRollInput; FruitySeqRollInput m_fruity_interaction; friend struct Seq24SeqRollInput; Seq24SeqRollInput m_seq24_interaction; Glib::RefPtr m_gc; Glib::RefPtr m_window; Gdk::Color m_black, m_white, m_grey, m_dk_grey, m_red; Glib::RefPtr m_pixmap; Glib::RefPtr m_background; rect m_old; rect m_selected; sequence * const m_seq; sequence * m_clipboard; perform * const m_perform; seqdata * const m_seqdata_wid; seqevent * const m_seqevent_wid; seqkeys * const m_seqkeys_wid; int m_pos; /* one pixel == m_zoom ticks */ int m_zoom; int m_snap; int m_note_length; int m_scale; int m_key; int m_window_x, m_window_y; /* what is the data window currently editing ? */ unsigned char m_status; unsigned char m_cc; /* when highlighting a bunch of events */ bool m_selecting; bool m_moving; bool m_moving_init; bool m_growing; bool m_painting; bool m_paste; bool m_is_drag_pasting; bool m_is_drag_pasting_start; bool m_justselected_one; /* where the dragging started */ int m_drop_x; int m_drop_y; int m_move_delta_x; int m_move_delta_y; int m_current_x; int m_current_y; int m_move_snap_offset_x; int m_old_progress_x; Adjustment * const m_vadjust; Adjustment * const m_hadjust; int m_scroll_offset_ticks; int m_scroll_offset_key; int m_scroll_offset_x; int m_scroll_offset_y; int m_background_sequence; bool m_drawing_background_seq; bool m_ignore_redraw; void on_realize(); bool on_expose_event(GdkEventExpose* a_ev); bool on_button_press_event(GdkEventButton* a_ev); bool on_button_release_event(GdkEventButton* a_ev); bool on_motion_notify_event(GdkEventMotion* a_ev); bool on_key_press_event(GdkEventKey* a_p0); bool on_focus_in_event(GdkEventFocus*); bool on_focus_out_event(GdkEventFocus*); bool on_scroll_event( GdkEventScroll* a_ev); bool on_leave_notify_event (GdkEventCrossing* a_p0); bool on_enter_notify_event (GdkEventCrossing* a_p0); void convert_xy( int a_x, int a_y, long *a_ticks, int *a_note); void convert_tn( long a_ticks, int a_note, int *a_x, int *a_y); void snap_y( int *a_y ); void snap_x( int *a_x ); void xy_to_rect( int a_x1, int a_y1, int a_x2, int a_y2, int *a_x, int *a_y, int *a_w, int *a_h ); void convert_tn_box_to_rect( long a_tick_s, long a_tick_f, int a_note_h, int a_note_l, int *a_x, int *a_y, int *a_w, int *a_h ); void draw_events_on( Glib::RefPtr a_draw ); int idle_progress(); void on_size_allocate(Gtk::Allocation& ); void change_horz(); void change_vert(); void force_draw(); public: void reset(); void redraw(); void redraw_events(); void set_zoom( int a_zoom ); void set_snap( int a_snap ); void set_note_length( int a_note_length ); void set_ignore_redraw(bool a_ignore); void set_scale( int a_scale ); void set_key( int a_key ); void update_sizes(); void update_background(); void draw_background_on_pixmap(); void draw_events_on_pixmap(); void draw_selection_on_window(); void update_pixmap(); int idle_redraw(); void draw_progress_on_window(); void start_paste( ); void set_background_sequence( bool a_state, int a_seq ); seqroll( perform *a_perf, sequence *a_seq, int a_zoom, int a_snap, seqdata *a_seqdata_wid, seqevent *a_seqevent_wid, seqkeys *a_seqkeys_wid, int a_pos, Adjustment *a_hadjust, Adjustment *a_vadjust ); void set_data_type( unsigned char a_status, unsigned char a_control ); ~seqroll( ); }; seq24-0.9.3/src/perfroll.cpp0000644000175000017500000005022212651156360012530 00000000000000//---------------------------------------------------------------------------- // // This file is part of seq24. // // seq24 is free software; you can redistribute it and/or modify // it under the terms of the GNU General)mm Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // seq24 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 seq24; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //----------------------------------------------------------------------------- #include "event.h" #include "perfroll.h" perfroll::perfroll( perform *a_perf, Adjustment * a_hadjust, Adjustment * a_vadjust ) : m_black(Gdk::Color("black")), m_white(Gdk::Color("white")), m_grey(Gdk::Color("grey")), m_lt_grey(Gdk::Color("light grey")), m_mainperf(a_perf), m_old_progress_ticks(0), m_4bar_offset(0), m_sequence_offset(0), m_roll_length_ticks(0), m_drop_sequence(0), m_vadjust(a_vadjust), m_hadjust(a_hadjust), m_moving(false), m_growing(false) { Glib::RefPtr colormap = get_default_colormap(); colormap->alloc_color( m_black ); colormap->alloc_color( m_white ); colormap->alloc_color( m_grey ); colormap->alloc_color( m_lt_grey ); //m_text_font_6_12 = Gdk_Font( c_font_6_12 ); add_events( Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK | Gdk::POINTER_MOTION_MASK | Gdk::KEY_PRESS_MASK | Gdk::KEY_RELEASE_MASK | Gdk::FOCUS_CHANGE_MASK | Gdk::SCROLL_MASK ); set_size_request( 10, 10 ); set_double_buffered( false ); for( int i=0; iget_value() ){ m_4bar_offset = (int) m_hadjust->get_value(); queue_draw(); } } void perfroll::change_vert( ) { if ( m_sequence_offset != (int) m_vadjust->get_value() ){ m_sequence_offset = (int) m_vadjust->get_value(); queue_draw(); } } void perfroll::on_realize() { // we need to do the default realize Gtk::DrawingArea::on_realize(); set_flags( Gtk::CAN_FOCUS ); // Now we can allocate any additional resources we need m_window = get_window(); m_gc = Gdk::GC::create( m_window ); m_window->clear(); update_sizes(); m_hadjust->signal_value_changed().connect( mem_fun( *this, &perfroll::change_horz )); m_vadjust->signal_value_changed().connect( mem_fun( *this, &perfroll::change_vert )); m_background = Gdk::Pixmap::create( m_window, c_perfroll_background_x, c_names_y, -1 ); /* and fill the background ( dotted lines n' such ) */ fill_background_pixmap(); } void perfroll::init_before_show( ) { m_roll_length_ticks = m_mainperf->get_max_trigger(); m_roll_length_ticks = m_roll_length_ticks - ( m_roll_length_ticks % ( c_ppqn * 16 )); m_roll_length_ticks += c_ppqn * 4096; } void perfroll::update_sizes() { int h_bars = m_roll_length_ticks / (c_ppqn * 16); int h_bars_visable = (m_window_x * c_perf_scale_x) / (c_ppqn * 16); m_hadjust->set_lower( 0 ); m_hadjust->set_upper( h_bars ); m_hadjust->set_page_size( h_bars_visable ); m_hadjust->set_step_increment( 1 ); m_hadjust->set_page_increment( 1 ); int h_max_value = h_bars - h_bars_visable; if ( m_hadjust->get_value() > h_max_value ){ m_hadjust->set_value( h_max_value ); } m_vadjust->set_lower( 0 ); m_vadjust->set_upper( c_total_seqs ); m_vadjust->set_page_size( m_window_y / c_names_y ); m_vadjust->set_step_increment( 1 ); m_vadjust->set_page_increment( 1 ); int v_max_value = c_total_seqs - (m_window_y / c_names_y); if ( m_vadjust->get_value() > v_max_value ){ m_vadjust->set_value(v_max_value); } if ( is_realized() ){ m_pixmap = Gdk::Pixmap::create( m_window, m_window_x, m_window_y, -1 ); } queue_draw(); } void perfroll::increment_size() { m_roll_length_ticks += (c_ppqn * 512); update_sizes( ); } /* updates background */ void perfroll::fill_background_pixmap() { /* clear background */ m_gc->set_foreground(m_white); m_background->draw_rectangle(m_gc,true, 0, 0, c_perfroll_background_x, c_names_y ); /* draw horz grey lines */ m_gc->set_foreground(m_grey); gint8 dash = 1; m_gc->set_dashes( 0, &dash, 1 ); m_gc->set_line_attributes( 1, Gdk::LINE_ON_OFF_DASH, Gdk::CAP_NOT_LAST, Gdk::JOIN_MITER ); m_background->draw_line(m_gc, 0, 0, c_perfroll_background_x, 0 ); int beats = m_measure_length / m_beat_length; /* draw vert lines */ for ( int i=0; i< beats ; ){ if ( i == 0 ){ m_gc->set_line_attributes( 1, Gdk::LINE_SOLID, Gdk::CAP_NOT_LAST, Gdk::JOIN_MITER ); } else { m_gc->set_line_attributes( 1, Gdk::LINE_ON_OFF_DASH, Gdk::CAP_NOT_LAST, Gdk::JOIN_MITER ); } m_gc->set_foreground(m_grey); /* solid line on every beat */ m_background->draw_line(m_gc, i * m_beat_length / c_perf_scale_x, 0, i * m_beat_length / c_perf_scale_x, c_names_y ); // jump 2 if 16th notes if ( m_beat_length < c_ppqn/2 ) { i += (c_ppqn / m_beat_length); } else { ++i; } } /* reset line style */ m_gc->set_line_attributes( 1, Gdk::LINE_SOLID, Gdk::CAP_NOT_LAST, Gdk::JOIN_MITER ); } /* simply sets the snap member */ void perfroll::set_guides( int a_snap, int a_measure, int a_beat ) { m_snap = a_snap; m_measure_length = a_measure; m_beat_length = a_beat; if ( is_realized() ){ fill_background_pixmap(); } queue_draw(); } void perfroll::draw_progress() { long tick = m_mainperf->get_tick(); long tick_offset = m_4bar_offset * c_ppqn * 16; int progress_x = ( tick - tick_offset ) / c_perf_scale_x ; int old_progress_x = ( m_old_progress_ticks - tick_offset ) / c_perf_scale_x ; /* draw old */ m_window->draw_drawable(m_gc, m_pixmap, old_progress_x, 0, old_progress_x, 0, 1, m_window_y ); m_gc->set_foreground(m_black); m_window->draw_line(m_gc, progress_x, 0, progress_x, m_window_y); m_old_progress_ticks = tick; } void perfroll::draw_sequence_on( Glib::RefPtr a_draw, int a_sequence ) { long tick_on; long tick_off; long offset; bool selected; long tick_offset = m_4bar_offset * c_ppqn * 16; long x_offset = tick_offset / c_perf_scale_x; if ( a_sequence < c_total_seqs ){ if ( m_mainperf->is_active( a_sequence )){ m_sequence_active[a_sequence] = true; sequence *seq = m_mainperf->get_sequence( a_sequence ); seq->reset_draw_trigger_marker(); a_sequence -= m_sequence_offset; long sequence_length = seq->get_length(); int length_w = sequence_length / c_perf_scale_x; while ( seq->get_next_trigger( &tick_on, &tick_off, &selected, &offset )){ if ( tick_off > 0 ){ long x_on = tick_on / c_perf_scale_x; long x_off = tick_off / c_perf_scale_x; int w = x_off - x_on + 1; int x = x_on; int y = c_names_y * a_sequence + 1; // + 2 int h = c_names_y - 2; // - 4 // adjust to screen corrids x = x - x_offset; if ( selected ) m_gc->set_foreground(m_grey); else m_gc->set_foreground(m_white); a_draw->draw_rectangle(m_gc,true, x, y, w, h ); m_gc->set_foreground(m_black); a_draw->draw_rectangle(m_gc,false, x, y, w, h ); m_gc->set_foreground(m_black); a_draw->draw_rectangle(m_gc,false, x, y, c_perfroll_size_box_w, c_perfroll_size_box_w ); a_draw->draw_rectangle(m_gc,false, x+w-c_perfroll_size_box_w, y+h-c_perfroll_size_box_w, c_perfroll_size_box_w, c_perfroll_size_box_w ); m_gc->set_foreground(m_black); long length_marker_first_tick = ( tick_on - (tick_on % sequence_length) + (offset % sequence_length) - sequence_length); long tick_marker = length_marker_first_tick; while ( tick_marker < tick_off ){ long tick_marker_x = (tick_marker / c_perf_scale_x) - x_offset; if ( tick_marker > tick_on ){ m_gc->set_foreground(m_lt_grey); a_draw->draw_rectangle(m_gc,true, tick_marker_x, y+4, 1, h-8 ); } int lowest_note = seq->get_lowest_note_event( ); int highest_note = seq->get_highest_note_event( ); int height = highest_note - lowest_note; height += 2; int length = seq->get_length( ); long tick_s; long tick_f; int note; bool selected; int velocity; draw_type dt; seq->reset_draw_marker(); m_gc->set_foreground(m_black); while ( (dt = seq->get_next_note_event( &tick_s, &tick_f, ¬e, &selected, &velocity )) != DRAW_FIN ){ int note_y = ((c_names_y-6) - ((c_names_y-6) * (note - lowest_note)) / height) + 1; int tick_s_x = ((tick_s * length_w) / length) + tick_marker_x; int tick_f_x = ((tick_f * length_w) / length) + tick_marker_x; if ( dt == DRAW_NOTE_ON || dt == DRAW_NOTE_OFF ) tick_f_x = tick_s_x + 1; if ( tick_f_x <= tick_s_x ) tick_f_x = tick_s_x + 1; if ( tick_s_x < x ){ tick_s_x = x; } if ( tick_f_x > x + w ){ tick_f_x = x + w; } /* [ ] ----------- --------- ---------------- ------ ------ */ if ( tick_f_x >= x && tick_s_x <= x+w ) m_pixmap->draw_line(m_gc, tick_s_x, y + note_y, tick_f_x, y + note_y ); } tick_marker += sequence_length; } } } } } } void perfroll::draw_background_on( Glib::RefPtr a_draw, int a_sequence ) { long tick_offset = m_4bar_offset * c_ppqn * 16; long first_measure = tick_offset / m_measure_length; a_sequence -= m_sequence_offset; int y = c_names_y * a_sequence; int h = c_names_y; m_gc->set_foreground(m_white); a_draw->draw_rectangle(m_gc,true, 0, y, m_window_x, h ); m_gc->set_foreground(m_black); for ( int i = first_measure; i < first_measure + (m_window_x * c_perf_scale_x / (m_measure_length)) + 1; i++ ) { int x_pos = ((i * m_measure_length) - tick_offset) / c_perf_scale_x; a_draw->draw_drawable(m_gc, m_background, 0, 0, x_pos, y, c_perfroll_background_x, c_names_y ); } } bool perfroll::on_expose_event(GdkEventExpose* e) { int y_s = e->area.y / c_names_y; int y_f = (e->area.y + e->area.height) / c_names_y; for ( int y=y_s; y<=y_f; y++ ){ /* for ( int x=x_s; x<=x_f; x++ ){ m_pixmap->draw_drawable(m_gc, m_background, 0, 0, x * c_perfroll_background_x, c_names_y * y, c_perfroll_background_x, c_names_y ); } */ draw_background_on(m_pixmap, y + m_sequence_offset ); draw_sequence_on(m_pixmap, y + m_sequence_offset ); } m_window->draw_drawable( m_gc, m_pixmap, e->area.x, e->area.y, e->area.x, e->area.y, e->area.width, e->area.height ); return true; } void perfroll::redraw_dirty_sequences() { bool draw = false; int y_s = 0; int y_f = m_window_y / c_names_y; for ( int y=y_s; y<=y_f; y++ ){ int seq = y + m_sequence_offset; // 4am bool dirty = (m_mainperf->is_dirty_perf(seq )); if (dirty) { draw_background_on(m_pixmap,seq ); draw_sequence_on(m_pixmap,seq ); draw = true; } } if ( draw ) m_window->draw_drawable( m_gc, m_pixmap, 0, 0, 0, 0, m_window_x, m_window_y ); } void perfroll::draw_drawable_row( Glib::RefPtr a_dest, Glib::RefPtr a_src, long a_y ) { int s = a_y / c_names_y; a_dest->draw_drawable(m_gc, a_src, 0, c_names_y * s, 0, c_names_y * s, m_window_x, c_names_y ); } void perfroll::start_playing() { // keep in sync with perfedit's start_playing... wish i could call it directly... m_mainperf->position_jack( true ); m_mainperf->start_jack( ); m_mainperf->start( true ); } void perfroll::stop_playing() { // keep in sync with perfedit's stop_playing... wish i could call it directly... m_mainperf->stop_jack(); m_mainperf->stop(); } bool perfroll::on_button_press_event(GdkEventButton* a_ev) { return m_interaction->on_button_press_event(a_ev, *this); } bool perfroll::on_button_release_event(GdkEventButton* a_ev) { return m_interaction->on_button_release_event(a_ev, *this); } bool perfroll::on_scroll_event( GdkEventScroll* a_ev ) { guint modifiers; // Used to filter out caps/num lock etc. modifiers = gtk_accelerator_get_default_mod_mask (); if ((a_ev->state & modifiers) == GDK_SHIFT_MASK) { double val = m_hadjust->get_value(); if ( a_ev->direction == GDK_SCROLL_UP ){ val -= m_hadjust->get_step_increment(); } else if ( a_ev->direction == GDK_SCROLL_DOWN ){ val += m_hadjust->get_step_increment(); } m_hadjust->clamp_page(val, val + m_hadjust->get_page_size()); } else { double val = m_vadjust->get_value(); if ( a_ev->direction == GDK_SCROLL_UP ){ val -= m_vadjust->get_step_increment(); } else if ( a_ev->direction == GDK_SCROLL_DOWN ){ val += m_vadjust->get_step_increment(); } m_vadjust->clamp_page(val, val + m_vadjust->get_page_size()); } return true; } bool perfroll::on_motion_notify_event(GdkEventMotion* a_ev) { return m_interaction->on_motion_notify_event(a_ev, *this); } bool perfroll::on_key_press_event(GdkEventKey* a_p0) { bool ret = false; if ( m_mainperf->is_active( m_drop_sequence)){ if ( a_p0->type == GDK_KEY_PRESS ){ if ( a_p0->keyval == GDK_Delete || a_p0->keyval == GDK_BackSpace ){ m_mainperf->push_trigger_undo(); m_mainperf->get_sequence( m_drop_sequence )->del_selected_trigger(); ret = true; } if ( a_p0->state & GDK_CONTROL_MASK ){ /* cut */ if ( a_p0->keyval == GDK_x || a_p0->keyval == GDK_X ){ m_mainperf->push_trigger_undo(); m_mainperf->get_sequence( m_drop_sequence )->cut_selected_trigger(); ret = true; } /* copy */ if ( a_p0->keyval == GDK_c || a_p0->keyval == GDK_C ){ m_mainperf->get_sequence( m_drop_sequence )->copy_selected_trigger(); ret = true; } /* paste */ if ( a_p0->keyval == GDK_v || a_p0->keyval == GDK_V ){ m_mainperf->push_trigger_undo(); m_mainperf->get_sequence( m_drop_sequence )->paste_trigger(); ret = true; } } } } if ( ret == true ){ fill_background_pixmap(); queue_draw(); return true; } else return false; } /* performs a 'snap' on x */ void perfroll::snap_x( int *a_x ) { // snap = number pulses to snap to // m_scale = number of pulses per pixel // so snap / m_scale = number pixels to snap to int mod = (m_snap / c_perf_scale_x ); if ( mod <= 0 ) mod = 1; *a_x = *a_x - (*a_x % mod ); } void perfroll::convert_x( int a_x, long *a_tick ) { long tick_offset = m_4bar_offset * c_ppqn * 16; *a_tick = a_x * c_perf_scale_x; *a_tick += tick_offset; } void perfroll::convert_xy( int a_x, int a_y, long *a_tick, int *a_seq) { long tick_offset = m_4bar_offset * c_ppqn * 16; *a_tick = a_x * c_perf_scale_x; *a_seq = a_y / c_names_y; *a_tick += tick_offset; *a_seq += m_sequence_offset; if ( *a_seq >= c_total_seqs ) *a_seq = c_total_seqs - 1; if ( *a_seq < 0 ) *a_seq = 0; } bool perfroll::on_focus_in_event(GdkEventFocus*) { set_flags(Gtk::HAS_FOCUS); return false; } bool perfroll::on_focus_out_event(GdkEventFocus*) { unset_flags(Gtk::HAS_FOCUS); return false; } void perfroll::on_size_allocate(Gtk::Allocation& a_r ) { Gtk::DrawingArea::on_size_allocate( a_r ); m_window_x = a_r.get_width(); m_window_y = a_r.get_height(); update_sizes(); } void perfroll::on_size_request(GtkRequisition* a_r ) { } void perfroll::split_trigger( int a_sequence, long a_tick ) { m_mainperf->push_trigger_undo(); m_mainperf->get_sequence( a_sequence )->split_trigger( a_tick ); draw_background_on( m_pixmap, a_sequence ); draw_sequence_on( m_pixmap, a_sequence ); draw_drawable_row( m_window, m_pixmap, m_drop_y); } seq24-0.9.3/m4/0000755000175000017500000000000012651206575010013 500000000000000seq24-0.9.3/m4/ax_cxx_compile_stdcxx.m40000644000175000017500000003270012651156360014572 00000000000000# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html # =========================================================================== # # SYNOPSIS # # AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional]) # # DESCRIPTION # # Check for baseline language coverage in the compiler for the specified # version of the C++ standard. If necessary, add switches to CXXFLAGS to # enable support. VERSION may be '11' (for the C++11 standard) or '14' # (for the C++14 standard). # # The second argument, if specified, indicates whether you insist on an # extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. # -std=c++11). If neither is specified, you get whatever works, with # preference for an extended mode. # # The third argument, if specified 'mandatory' or if left unspecified, # indicates that baseline support for the specified C++ standard is # required and that the macro should error out if no mode with that # support is found. If specified 'optional', then configuration proceeds # regardless, after defining HAVE_CXX${VERSION} if and only if a # supporting mode is found. # # LICENSE # # Copyright (c) 2008 Benjamin Kosnik # Copyright (c) 2012 Zack Weinberg # Copyright (c) 2013 Roy Stogner # Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov # Copyright (c) 2015 Paul Norman # Copyright (c) 2015 Moritz Klammler # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 1 dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro dnl (serial version number 13). AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl m4_if([$1], [11], [], [$1], [14], [], [$1], [17], [m4_fatal([support for C++17 not yet implemented in AX_CXX_COMPILE_STDCXX])], [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl m4_if([$2], [], [], [$2], [ext], [], [$2], [noext], [], [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true], [$3], [mandatory], [ax_cxx_compile_cxx$1_required=true], [$3], [optional], [ax_cxx_compile_cxx$1_required=false], [m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])]) AC_LANG_PUSH([C++])dnl ac_success=no AC_CACHE_CHECK(whether $CXX supports C++$1 features by default, ax_cv_cxx_compile_cxx$1, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], [ax_cv_cxx_compile_cxx$1=yes], [ax_cv_cxx_compile_cxx$1=no])]) if test x$ax_cv_cxx_compile_cxx$1 = xyes; then ac_success=yes fi m4_if([$2], [noext], [], [dnl if test x$ac_success = xno; then for switch in -std=gnu++$1 -std=gnu++0x; do cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, $cachevar, [ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS $switch" AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], [eval $cachevar=yes], [eval $cachevar=no]) CXXFLAGS="$ac_save_CXXFLAGS"]) if eval test x\$$cachevar = xyes; then CXXFLAGS="$CXXFLAGS $switch" ac_success=yes break fi done fi]) m4_if([$2], [ext], [], [dnl if test x$ac_success = xno; then dnl HP's aCC needs +std=c++11 according to: dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf dnl Cray's crayCC needs "-h std=c++11" for switch in -std=c++$1 -std=c++0x +std=c++$1 "-h std=c++$1"; do cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, $cachevar, [ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS $switch" AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], [eval $cachevar=yes], [eval $cachevar=no]) CXXFLAGS="$ac_save_CXXFLAGS"]) if eval test x\$$cachevar = xyes; then CXXFLAGS="$CXXFLAGS $switch" ac_success=yes break fi done fi]) AC_LANG_POP([C++]) if test x$ax_cxx_compile_cxx$1_required = xtrue; then if test x$ac_success = xno; then AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.]) fi else if test x$ac_success = xno; then HAVE_CXX$1=0 AC_MSG_NOTICE([No compiler with C++$1 support was found]) else HAVE_CXX$1=1 AC_DEFINE(HAVE_CXX$1,1, [define if the compiler supports basic C++$1 syntax]) fi AC_SUBST(HAVE_CXX$1) fi ]) dnl Test body for checking C++11 support m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11], _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 ) dnl Test body for checking C++14 support m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14], _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 ) dnl Tests for new features in C++11 m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[ // If the compiler admits that it is not ready for C++11, why torture it? // Hopefully, this will speed up the test. #ifndef __cplusplus #error "This is not a C++ compiler" #elif __cplusplus < 201103L #error "This is not a C++11 compiler" #else namespace cxx11 { namespace test_static_assert { template struct check { static_assert(sizeof(int) <= sizeof(T), "not big enough"); }; } namespace test_final_override { struct Base { virtual void f() {} }; struct Derived : public Base { virtual void f() override {} }; } namespace test_double_right_angle_brackets { template < typename T > struct check {}; typedef check single_type; typedef check> double_type; typedef check>> triple_type; typedef check>>> quadruple_type; } namespace test_decltype { int f() { int a = 1; decltype(a) b = 2; return a + b; } } namespace test_type_deduction { template < typename T1, typename T2 > struct is_same { static const bool value = false; }; template < typename T > struct is_same { static const bool value = true; }; template < typename T1, typename T2 > auto add(T1 a1, T2 a2) -> decltype(a1 + a2) { return a1 + a2; } int test(const int c, volatile int v) { static_assert(is_same::value == true, ""); static_assert(is_same::value == false, ""); static_assert(is_same::value == false, ""); auto ac = c; auto av = v; auto sumi = ac + av + 'x'; auto sumf = ac + av + 1.0; static_assert(is_same::value == true, ""); static_assert(is_same::value == true, ""); static_assert(is_same::value == true, ""); static_assert(is_same::value == false, ""); static_assert(is_same::value == true, ""); return (sumf > 0.0) ? sumi : add(c, v); } } namespace test_noexcept { int f() { return 0; } int g() noexcept { return 0; } static_assert(noexcept(f()) == false, ""); static_assert(noexcept(g()) == true, ""); } namespace test_constexpr { template < typename CharT > unsigned long constexpr strlen_c_r(const CharT *const s, const unsigned long acc) noexcept { return *s ? strlen_c_r(s + 1, acc + 1) : acc; } template < typename CharT > unsigned long constexpr strlen_c(const CharT *const s) noexcept { return strlen_c_r(s, 0UL); } static_assert(strlen_c("") == 0UL, ""); static_assert(strlen_c("1") == 1UL, ""); static_assert(strlen_c("example") == 7UL, ""); static_assert(strlen_c("another\0example") == 7UL, ""); } namespace test_rvalue_references { template < int N > struct answer { static constexpr int value = N; }; answer<1> f(int&) { return answer<1>(); } answer<2> f(const int&) { return answer<2>(); } answer<3> f(int&&) { return answer<3>(); } void test() { int i = 0; const int c = 0; static_assert(decltype(f(i))::value == 1, ""); static_assert(decltype(f(c))::value == 2, ""); static_assert(decltype(f(0))::value == 3, ""); } } namespace test_uniform_initialization { struct test { static const int zero {}; static const int one {1}; }; static_assert(test::zero == 0, ""); static_assert(test::one == 1, ""); } namespace test_lambdas { void test1() { auto lambda1 = [](){}; auto lambda2 = lambda1; lambda1(); lambda2(); } int test2() { auto a = [](int i, int j){ return i + j; }(1, 2); auto b = []() -> int { return '0'; }(); auto c = [=](){ return a + b; }(); auto d = [&](){ return c; }(); auto e = [a, &b](int x) mutable { const auto identity = [](int y){ return y; }; for (auto i = 0; i < a; ++i) a += b--; return x + identity(a + b); }(0); return a + b + c + d + e; } int test3() { const auto nullary = [](){ return 0; }; const auto unary = [](int x){ return x; }; using nullary_t = decltype(nullary); using unary_t = decltype(unary); const auto higher1st = [](nullary_t f){ return f(); }; const auto higher2nd = [unary](nullary_t f1){ return [unary, f1](unary_t f2){ return f2(unary(f1())); }; }; return higher1st(nullary) + higher2nd(nullary)(unary); } } namespace test_variadic_templates { template struct sum; template struct sum { static constexpr auto value = N0 + sum::value; }; template <> struct sum<> { static constexpr auto value = 0; }; static_assert(sum<>::value == 0, ""); static_assert(sum<1>::value == 1, ""); static_assert(sum<23>::value == 23, ""); static_assert(sum<1, 2>::value == 3, ""); static_assert(sum<5, 5, 11>::value == 21, ""); static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); } // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function // because of this. namespace test_template_alias_sfinae { struct foo {}; template using member = typename T::member_type; template void func(...) {} template void func(member*) {} void test(); void test() { func(0); } } } // namespace cxx11 #endif // __cplusplus >= 201103L ]]) dnl Tests for new features in C++14 m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[ // If the compiler admits that it is not ready for C++14, why torture it? // Hopefully, this will speed up the test. #ifndef __cplusplus #error "This is not a C++ compiler" #elif __cplusplus < 201402L #error "This is not a C++14 compiler" #else namespace cxx14 { namespace test_polymorphic_lambdas { int test() { const auto lambda = [](auto&&... args){ const auto istiny = [](auto x){ return (sizeof(x) == 1UL) ? 1 : 0; }; const int aretiny[] = { istiny(args)... }; return aretiny[0]; }; return lambda(1, 1L, 1.0f, '1'); } } namespace test_binary_literals { constexpr auto ivii = 0b0000000000101010; static_assert(ivii == 42, "wrong value"); } namespace test_generalized_constexpr { template < typename CharT > constexpr unsigned long strlen_c(const CharT *const s) noexcept { auto length = 0UL; for (auto p = s; *p; ++p) ++length; return length; } static_assert(strlen_c("") == 0UL, ""); static_assert(strlen_c("x") == 1UL, ""); static_assert(strlen_c("test") == 4UL, ""); static_assert(strlen_c("another\0test") == 7UL, ""); } namespace test_lambda_init_capture { int test() { auto x = 0; const auto lambda1 = [a = x](int b){ return a + b; }; const auto lambda2 = [a = lambda1(x)](){ return a; }; return lambda2(); } } namespace test_digit_seperators { constexpr auto ten_million = 100'000'000; static_assert(ten_million == 100000000, ""); } namespace test_return_type_deduction { auto f(int& x) { return x; } decltype(auto) g(int& x) { return x; } template < typename T1, typename T2 > struct is_same { static constexpr auto value = false; }; template < typename T > struct is_same { static constexpr auto value = true; }; int test() { auto x = 0; static_assert(is_same::value, ""); static_assert(is_same::value, ""); return x; } } } // namespace cxx14 #endif // __cplusplus >= 201402L ]]) seq24-0.9.3/m4/ax_cxx_compile_stdcxx_11.m40000644000175000017500000000317112651156360015073 00000000000000# ============================================================================ # http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html # ============================================================================ # # SYNOPSIS # # AX_CXX_COMPILE_STDCXX_11([ext|noext], [mandatory|optional]) # # DESCRIPTION # # Check for baseline language coverage in the compiler for the C++11 # standard; if necessary, add switches to CXXFLAGS to enable support. # # This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX # macro with the version set to C++11. The two optional arguments are # forwarded literally as the second and third argument respectively. # Please see the documentation for the AX_CXX_COMPILE_STDCXX macro for # more information. If you want to use this macro, you also need to # download the ax_cxx_compile_stdcxx.m4 file. # # LICENSE # # Copyright (c) 2008 Benjamin Kosnik # Copyright (c) 2012 Zack Weinberg # Copyright (c) 2013 Roy Stogner # Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov # Copyright (c) 2015 Paul Norman # Copyright (c) 2015 Moritz Klammler # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 14 include([ax_cxx_compile_stdcxx.m4]) AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [AX_CXX_COMPILE_STDCXX([11], [$1], [$2])]) seq24-0.9.3/compile0000755000175000017500000001624512651156630010775 00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2012-10-14.11; # UTC # Copyright (C) 1999-2013 Free Software Foundation, Inc. # Written by Tom Tromey . # # 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, see . # 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. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: seq24-0.9.3/Makefile.am0000644000175000017500000000027612321052410011431 00000000000000# Makefile.am for seq24 SUBDIRS = MOSTLYCLEANFILES = *~ EXTRA_DIST = README COPYING RTC AUTHORS INSTALL SEQ24 NEWS ChangeLog seq24usr.example include man/Module.am include src/Module.am seq24-0.9.3/TODO0000644000175000017500000000652511060731321010074 00000000000000 <0.9.0> [sequence editor] [X] Ctrl Z undo seq + perf [x] Ctrl + select = adds to selection (roll + event) m_seq->unselect [X] Window Raise on Edit [x] Static clipboard share [X] Do not use selected for internal stuff [X] Midi items are not de-selected after actions are taken (copy too) [x] Paste buffer shouldn't clear [x] paint notes [x] paint events [x] Port Names and number specd in rc file [x] Controllers Speced in rc file eg. (Wavestation MIDI 1) (SuperNova Filter) [ ] Notes Speced in rc file eg. Bass Drum (no black/white) [ ] sorting of events placed into event list 0) Program Changes 1) CC's 2) Notes 3) MSB? LSB? [ ] If Data Entries are placed on same tick, Make Course First ?? [ ] If NRPN or RPN are on same tick, Make Course First ?? [ ] Shuffle Quantize (percent and note from tool options) [x] Keyboard start/stop [ ] Midi start/stop [ ] More scales! [X] Make the sequence editor grow tool stretch over the length. [x] Bump default song length way up. [X] Stretch Notes ( Rubber Band) [ ] Listen to notes as you draw / move? [X] Vertical Lines at grid snap ? [ ] exclusive groups (only one item in row or column can be active) [x] copy and paste between sequences (make clipboard static) [ ] Mouse move on piano roll/key roll, change background a bit ( check with scales on) [ ] Scroll on dragging ? [ ] Event mute ? [x] Stretch w/ Ctrl (Federico) [ ] Change background sequence color [x] Test Maxim Patches w/ wheel mouse Make sure data entry still does its thing w/ wheel 1) when clicking on an event only one (the "topmost") event is selected. useful to decouple two events that are eventually stocked on top one another 2) if there are any events selected, data editor only changes controller. values for these events; if there are no events selected it acts as usual. 3) data editor slope line can be dragged outside of data editor window; controller values are adjusted to fit (0,127). makes it easier setting all controllers to min/max value. 4) mouse wheel scrolls the grid up/down in sequence editor and song editor. MAxim Krikun[+ 5) Scrolling draw [ ] Quantize Button [tools] [ ] Insert data runs. (Using Snap) CC [ ] Randomize CC [ ] Smooth CC [ ] Sharpen CC [ ] Thin. CC [ ] Thick. CC [ ] Reverse. NOTES CC [ ] Delete doubles (Start) NOTES CC [x] Quantize Start NOTES CC [ ] Quantize Length > Big Menu. NOTES [ ] Set Note Lengthi > Big Menu. NOTES [x] Transpose. NOTES [x] Harmonic transpose. NOTES [ ] Multiple Manual Inputs. Selectable from editor. [ ] One mouse button operation (buttons now chose mode) Old buttons still work. Add keyboard shortcuts for Select Draw Erase Grow [ ] options for priority [ ] nologo flag ?? [sysex] [ ] add data buffers to event.cpp [ ] midi files must read/save sysex. [ ] .seq24rc defines known sysex patters [ ] editor has new menu for known sysex and unknown sysex. [ ] known sysex patterns can be changed with data graph [ ] unknown sysex patterns can be edited raw [ ] Implement raw hex editor. [hexeditor] Design for sysex and normal midi data. Edit whole sequence list. Filters? Super flexable << Other >> [ ] Midi file export (render mode) [ ] Song Cue Points Based on Keys or Midi Input