Update portmidi to SVN r227.

This commit is contained in:
lllucius 2013-10-31 07:33:41 +00:00
parent a30f9e913b
commit bb63fa0d07
118 changed files with 15017 additions and 12291 deletions

View File

@ -193,6 +193,15 @@ build system break. Not suitable for upstream, what is needed is more
powerfull autoconf features to pass the right options to portaudio's configure
script, which suffers from the broken-ness of autoconf's subdirectory support
portmidi
-------
http://portmedia.sourceforge.net/
PortMidi is a library for software developers. It supports real-time input
and output of MIDI data using a system-independent interface.
Version in Audacity SVN: SVN snapshot from 227
Patches:
Upstream Version: SVN revision 227
portsmf
-------
http://portmedia.sourceforge.net/

View File

@ -0,0 +1,128 @@
<?xml version="1.0" encoding = "Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="ALL_BUILD"
ProjectGUID="{E1C2664B-91BB-4D4F-868C-433164F81101}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="ALL_BUILD.dir\Debug"
ConfigurationType="10"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".\pm_common;.\porttime;"
ExceptionHandling="0"
PreprocessorDefinitions="CMAKE_INTDIR=\&quot;Debug\&quot;"
AssemblerListingLocation="Debug"
ObjectFile="$(IntDir)\"
/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCResourceCompilerTool"
AdditionalIncludeDirectories=".\pm_common;.\porttime;"
PreprocessorDefinitions="CMAKE_INTDIR=\&quot;Debug\&quot;"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="CMAKE_INTDIR=\&quot;Debug\&quot;"
MkTypLibCompatible="FALSE"
TargetEnvironment="1"
GenerateStublessProxies="TRUE"
TypeLibraryName="$(InputName).tlb"
OutputDirectory="$(IntDir)"
HeaderFileName="$(InputName).h"
DLLDataFileName=""
InterfaceIdentifierFileName="$(InputName)_i.c"
ProxyFileName="$(InputName)_p.c"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCPostBuildEventTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="ALL_BUILD.dir\Release"
ConfigurationType="10"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".\pm_common;.\porttime;"
ExceptionHandling="0"
PreprocessorDefinitions="CMAKE_INTDIR=\&quot;Release\&quot;"
AssemblerListingLocation="Release"
ObjectFile="$(IntDir)\"
/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCResourceCompilerTool"
AdditionalIncludeDirectories=".\pm_common;.\porttime;"
PreprocessorDefinitions="CMAKE_INTDIR=\&quot;Release\&quot;"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="CMAKE_INTDIR=\&quot;Release\&quot;"
MkTypLibCompatible="FALSE"
TargetEnvironment="1"
GenerateStublessProxies="TRUE"
TypeLibraryName="$(InputName).tlb"
OutputDirectory="$(IntDir)"
HeaderFileName="$(InputName).h"
DLLDataFileName=""
InterfaceIdentifierFileName="$(InputName)_i.c"
ProxyFileName="$(InputName)_p.c"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCPostBuildEventTool"/>
</Configuration>
</Configurations>
<Files>
<File
RelativePath=".\CMakeFiles\ALL_BUILD">
</File>
<Filter
Name="CMake Rules"
Filter="">
<File
RelativePath=".\CMakeFiles\ALL_BUILD.rule">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Build all projects"
CommandLine=""
AdditionalDependencies=".\CMakeFiles\ALL_BUILD.rule"
Outputs=".\CMakeFiles\ALL_BUILD"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Build all projects"
CommandLine=""
AdditionalDependencies=".\CMakeFiles\ALL_BUILD.rule"
Outputs=".\CMakeFiles\ALL_BUILD"/>
</FileConfiguration>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,77 @@
# portmidi
# Roger B. Dannenberg
# 20 Sep 2009
cmake_minimum_required(VERSION 2.6)
if(UNIX)
# allow user to set Release or Debug
set(CMAKE_BUILD_TYPE Release CACHE STRING
"Semicolon-separate list of supported configuration types")
# set default directories but don't override cached values...
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CACHEFILE_DIR}/${CMAKE_BUILD_TYPE}
CACHE STRING "libraries go here")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CACHEFILE_DIR}/${CMAKE_BUILD_TYPE}
CACHE STRING "libraries go here")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY
${CMAKE_CACHEFILE_DIR}/${CMAKE_BUILD_TYPE}
CACHE STRING "executables go here")
else(UNIX)
# this does not seem to work for xcode:
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING
"Semicolon-separate list of supported configuration types")
endif(UNIX)
#set(CMAKE_RELATIVE_PATHS ON CACHE STRING "avoid absolute paths" FORCE)
# Clear out the built-in C++ compiler and link flags for each of the
# unused configurations.
set(CMAKE_CXX_FLAGS_MINSIZEREL "" CACHE INTERNAL "Unused")
set(CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL "" CACHE INTERNAL "Unused")
set(CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL "" CACHE INTERNAL "Unused")
set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "" CACHE INTERNAL "Unused")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "" CACHE INTERNAL "Unused")
set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "" CACHE INTERNAL "Unused")
set(CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO "" CACHE INTERNAL "Unused")
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "" CACHE INTERNAL "Unused")
set(CMAKE_OSX_ARCHITECTURES i386 ppc x86_64 CACHE STRING "change to needed architecture for a smaller library" FORCE)
PROJECT(portmidi)
if(UNIX)
# Problem: if there was an old Debug build and you change
# CMAKE_BUILD_TYPE to Release, then the OUTPUT_DIRECTORY's will
# still be Debug. Try to fix this by checking if the DIRECTORY's
# look wrong, and if so, force them to the defaults:
if(CMAKE_BUILD_TYPE MATCHES "Debug")
set(BAD_DIR "Release")
else(CMAKE_BUILD_TYPE MATCHES "Debug")
set(BAD_DIR "Debug")
endif(CMAKE_BUILD_TYPE MATCHES "Debug")
# use library as reference -- if you give it a non-BAD_DIR location
# then every other path is left alone
if(CMAKE_LIBRARY_OUTPUT_DIRECTORY MATCHES ${BAD_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY
${CMAKE_CACHEFILE_DIR}/${CMAKE_BUILD_TYPE}
CACHE STRING "executables go here" FORCE)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY
${CMAKE_CACHEFILE_DIR}/${CMAKE_BUILD_TYPE}
CACHE STRING "libraries go here" FORCE)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY
${CMAKE_CACHEFILE_DIR}/${CMAKE_BUILD_TYPE}
CACHE STRING "libraries go here" FORCE)
endif(CMAKE_LIBRARY_OUTPUT_DIRECTORY MATCHES ${BAD_DIR})
endif(UNIX)
include_directories(pm_common porttime)
add_subdirectory(pm_common)
add_subdirectory(pm_test)
add_subdirectory(pm_dylib)
# Cannot figure out how to make an xcode Java application with CMake
add_subdirectory(pm_java)

View File

@ -1,45 +0,0 @@
## Process this file with automake to produce Makefile.in
# Makefile(.in) for portmidi using Autotools (but not libtool).
# Adapted by Roger Dannenberg from ../portsmf/Makefile.am,
# Written by Richard Ash following Gary Vaughan's Autobook
# tell aclocal that extra macros can be found in autotools/m4/
ACLOCAL_AMFLAGS = -I autotools/m4
# define the output library (link with -lportmidi_s)
lib_LIBRARIES = libportmidi_s.a
# define the source files to use
libportmidi_s_a_SOURCES = pm_common/portmidi.c \
pm_common/pmutil.c \
porttime/ptlinux.c \
pm_linux/pmlinuxalsa.c \
pm_linux/pmlinux.c \
pm_linux/finddefault.c
# and the header files for the library. At the moment these go into the include
# directory directly, it would be much better to have them in a subdirectory
# but that would mean re-organising them here (a subdirectory called portSMF to
# keep headers in, add -I$(srcdir)/portSMF/ to AM_CXXFLAGS, change the paths
# to the headers here and change the name of the variable to nobase_include_...
#include_HEADERS = portmidi/portmidi.h \
# porttime/porttime.h
AM_CFLAGS = -I$(top_srcdir)/pm_common -I$(top_srcdir)/porttime
# files that only really viscous cleans remove
MAINTAINERCLEANFILES = Makefile.in
# other distributed files in case users don't have a complete set of auto*
AUX_DIST = $(ac_aux_dir)/config.guess \
$(ac_aux_dir)/config.sub \
$(ac_aux_dir)/install-sh \
$(ac_aux_dir)/mdate-sh \
$(ac_aux_dir)/missing \
$(ac_aux_dir)/mkinstalldirs \
$(MAINTAINERCLEANFILES)
# Documentation files that should be both distributed and installed in the doc
# directory,
dist_doc_DATA = README.txt license.txt

View File

@ -1,784 +0,0 @@
# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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(.in) for portmidi using Autotools (but not libtool).
# Adapted by Roger Dannenberg from ../portsmf/Makefile.am,
# Written by Richard Ash following Gary Vaughan's Autobook
VPATH = @srcdir@
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 = :
subdir = .
DIST_COMMON = $(am__configure_deps) $(dist_doc_DATA) \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/portmidi-uninstalled.pc.in $(srcdir)/portmidi.pc.in \
$(top_srcdir)/configure autotools/depcomp autotools/install-sh \
autotools/missing
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = \
$(top_srcdir)/autotools/m4/ax_cflags_strict_prototypes.m4 \
$(top_srcdir)/autotools/m4/ax_cflags_warn_all.m4 \
$(top_srcdir)/autotools/m4/ax_cxx_check_flag.m4 \
$(top_srcdir)/autotools/m4/ax_cxxcpp_check_flag.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_CLEAN_FILES = portmidi.pc portmidi-uninstalled.pc
CONFIG_CLEAN_VPATH_FILES =
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__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(docdir)"
LIBRARIES = $(lib_LIBRARIES)
AR = ar
ARFLAGS = cru
libportmidi_s_a_AR = $(AR) $(ARFLAGS)
libportmidi_s_a_LIBADD =
am_libportmidi_s_a_OBJECTS = portmidi.$(OBJEXT) pmutil.$(OBJEXT) \
ptlinux.$(OBJEXT) pmlinuxalsa.$(OBJEXT) pmlinux.$(OBJEXT) \
finddefault.$(OBJEXT)
libportmidi_s_a_OBJECTS = $(am_libportmidi_s_a_OBJECTS)
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/autotools/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(libportmidi_s_a_SOURCES)
DIST_SOURCES = $(libportmidi_s_a_SOURCES)
DATA = $(dist_doc_DATA)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
{ test ! -d "$(distdir)" \
|| { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -fr "$(distdir)"; }; }
DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
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@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
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@
RANLIB = @RANLIB@
SED = @SED@
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@
# tell aclocal that extra macros can be found in autotools/m4/
ACLOCAL_AMFLAGS = -I autotools/m4
# define the output library (link with -lportmidi_s)
lib_LIBRARIES = libportmidi_s.a
# define the source files to use
libportmidi_s_a_SOURCES = pm_common/portmidi.c \
pm_common/pmutil.c \
porttime/ptlinux.c \
pm_linux/pmlinuxalsa.c \
pm_linux/pmlinux.c \
pm_linux/finddefault.c
# and the header files for the library. At the moment these go into the include
# directory directly, it would be much better to have them in a subdirectory
# but that would mean re-organising them here (a subdirectory called portSMF to
# keep headers in, add -I$(srcdir)/portSMF/ to AM_CXXFLAGS, change the paths
# to the headers here and change the name of the variable to nobase_include_...
#include_HEADERS = portmidi/portmidi.h \
# porttime/porttime.h
AM_CFLAGS = -I$(top_srcdir)/pm_common -I$(top_srcdir)/porttime
# files that only really viscous cleans remove
MAINTAINERCLEANFILES = Makefile.in
# other distributed files in case users don't have a complete set of auto*
AUX_DIST = $(ac_aux_dir)/config.guess \
$(ac_aux_dir)/config.sub \
$(ac_aux_dir)/install-sh \
$(ac_aux_dir)/mdate-sh \
$(ac_aux_dir)/missing \
$(ac_aux_dir)/mkinstalldirs \
$(MAINTAINERCLEANFILES)
# Documentation files that should be both distributed and installed in the doc
# directory,
dist_doc_DATA = README.txt license.txt
all: all-am
.SUFFIXES:
.SUFFIXES: .c .o .obj
am--refresh:
@:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
$(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign 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;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
$(am__cd) $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
$(am__aclocal_m4_deps):
portmidi.pc: $(top_builddir)/config.status $(srcdir)/portmidi.pc.in
cd $(top_builddir) && $(SHELL) ./config.status $@
portmidi-uninstalled.pc: $(top_builddir)/config.status $(srcdir)/portmidi-uninstalled.pc.in
cd $(top_builddir) && $(SHELL) ./config.status $@
install-libLIBRARIES: $(lib_LIBRARIES)
@$(NORMAL_INSTALL)
test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
@list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \
list2=; for p in $$list; do \
if test -f $$p; then \
list2="$$list2 $$p"; \
else :; fi; \
done; \
test -z "$$list2" || { \
echo " $(INSTALL_DATA) $$list2 '$(DESTDIR)$(libdir)'"; \
$(INSTALL_DATA) $$list2 "$(DESTDIR)$(libdir)" || exit $$?; }
@$(POST_INSTALL)
@list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \
for p in $$list; do \
if test -f $$p; then \
$(am__strip_dir) \
echo " ( cd '$(DESTDIR)$(libdir)' && $(RANLIB) $$f )"; \
( cd "$(DESTDIR)$(libdir)" && $(RANLIB) $$f ) || exit $$?; \
else :; fi; \
done
uninstall-libLIBRARIES:
@$(NORMAL_UNINSTALL)
@list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
test -n "$$files" || exit 0; \
echo " ( cd '$(DESTDIR)$(libdir)' && rm -f "$$files" )"; \
cd "$(DESTDIR)$(libdir)" && rm -f $$files
clean-libLIBRARIES:
-test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES)
libportmidi_s.a: $(libportmidi_s_a_OBJECTS) $(libportmidi_s_a_DEPENDENCIES)
-rm -f libportmidi_s.a
$(libportmidi_s_a_AR) libportmidi_s.a $(libportmidi_s_a_OBJECTS) $(libportmidi_s_a_LIBADD)
$(RANLIB) libportmidi_s.a
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/finddefault.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pmlinux.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pmlinuxalsa.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pmutil.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/portmidi.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ptlinux.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
portmidi.o: pm_common/portmidi.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT portmidi.o -MD -MP -MF $(DEPDIR)/portmidi.Tpo -c -o portmidi.o `test -f 'pm_common/portmidi.c' || echo '$(srcdir)/'`pm_common/portmidi.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/portmidi.Tpo $(DEPDIR)/portmidi.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pm_common/portmidi.c' object='portmidi.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o portmidi.o `test -f 'pm_common/portmidi.c' || echo '$(srcdir)/'`pm_common/portmidi.c
portmidi.obj: pm_common/portmidi.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT portmidi.obj -MD -MP -MF $(DEPDIR)/portmidi.Tpo -c -o portmidi.obj `if test -f 'pm_common/portmidi.c'; then $(CYGPATH_W) 'pm_common/portmidi.c'; else $(CYGPATH_W) '$(srcdir)/pm_common/portmidi.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/portmidi.Tpo $(DEPDIR)/portmidi.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pm_common/portmidi.c' object='portmidi.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o portmidi.obj `if test -f 'pm_common/portmidi.c'; then $(CYGPATH_W) 'pm_common/portmidi.c'; else $(CYGPATH_W) '$(srcdir)/pm_common/portmidi.c'; fi`
pmutil.o: pm_common/pmutil.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pmutil.o -MD -MP -MF $(DEPDIR)/pmutil.Tpo -c -o pmutil.o `test -f 'pm_common/pmutil.c' || echo '$(srcdir)/'`pm_common/pmutil.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/pmutil.Tpo $(DEPDIR)/pmutil.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pm_common/pmutil.c' object='pmutil.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pmutil.o `test -f 'pm_common/pmutil.c' || echo '$(srcdir)/'`pm_common/pmutil.c
pmutil.obj: pm_common/pmutil.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pmutil.obj -MD -MP -MF $(DEPDIR)/pmutil.Tpo -c -o pmutil.obj `if test -f 'pm_common/pmutil.c'; then $(CYGPATH_W) 'pm_common/pmutil.c'; else $(CYGPATH_W) '$(srcdir)/pm_common/pmutil.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/pmutil.Tpo $(DEPDIR)/pmutil.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pm_common/pmutil.c' object='pmutil.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pmutil.obj `if test -f 'pm_common/pmutil.c'; then $(CYGPATH_W) 'pm_common/pmutil.c'; else $(CYGPATH_W) '$(srcdir)/pm_common/pmutil.c'; fi`
ptlinux.o: porttime/ptlinux.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ptlinux.o -MD -MP -MF $(DEPDIR)/ptlinux.Tpo -c -o ptlinux.o `test -f 'porttime/ptlinux.c' || echo '$(srcdir)/'`porttime/ptlinux.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ptlinux.Tpo $(DEPDIR)/ptlinux.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='porttime/ptlinux.c' object='ptlinux.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ptlinux.o `test -f 'porttime/ptlinux.c' || echo '$(srcdir)/'`porttime/ptlinux.c
ptlinux.obj: porttime/ptlinux.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ptlinux.obj -MD -MP -MF $(DEPDIR)/ptlinux.Tpo -c -o ptlinux.obj `if test -f 'porttime/ptlinux.c'; then $(CYGPATH_W) 'porttime/ptlinux.c'; else $(CYGPATH_W) '$(srcdir)/porttime/ptlinux.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ptlinux.Tpo $(DEPDIR)/ptlinux.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='porttime/ptlinux.c' object='ptlinux.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ptlinux.obj `if test -f 'porttime/ptlinux.c'; then $(CYGPATH_W) 'porttime/ptlinux.c'; else $(CYGPATH_W) '$(srcdir)/porttime/ptlinux.c'; fi`
pmlinuxalsa.o: pm_linux/pmlinuxalsa.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pmlinuxalsa.o -MD -MP -MF $(DEPDIR)/pmlinuxalsa.Tpo -c -o pmlinuxalsa.o `test -f 'pm_linux/pmlinuxalsa.c' || echo '$(srcdir)/'`pm_linux/pmlinuxalsa.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/pmlinuxalsa.Tpo $(DEPDIR)/pmlinuxalsa.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pm_linux/pmlinuxalsa.c' object='pmlinuxalsa.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pmlinuxalsa.o `test -f 'pm_linux/pmlinuxalsa.c' || echo '$(srcdir)/'`pm_linux/pmlinuxalsa.c
pmlinuxalsa.obj: pm_linux/pmlinuxalsa.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pmlinuxalsa.obj -MD -MP -MF $(DEPDIR)/pmlinuxalsa.Tpo -c -o pmlinuxalsa.obj `if test -f 'pm_linux/pmlinuxalsa.c'; then $(CYGPATH_W) 'pm_linux/pmlinuxalsa.c'; else $(CYGPATH_W) '$(srcdir)/pm_linux/pmlinuxalsa.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/pmlinuxalsa.Tpo $(DEPDIR)/pmlinuxalsa.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pm_linux/pmlinuxalsa.c' object='pmlinuxalsa.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pmlinuxalsa.obj `if test -f 'pm_linux/pmlinuxalsa.c'; then $(CYGPATH_W) 'pm_linux/pmlinuxalsa.c'; else $(CYGPATH_W) '$(srcdir)/pm_linux/pmlinuxalsa.c'; fi`
pmlinux.o: pm_linux/pmlinux.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pmlinux.o -MD -MP -MF $(DEPDIR)/pmlinux.Tpo -c -o pmlinux.o `test -f 'pm_linux/pmlinux.c' || echo '$(srcdir)/'`pm_linux/pmlinux.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/pmlinux.Tpo $(DEPDIR)/pmlinux.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pm_linux/pmlinux.c' object='pmlinux.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pmlinux.o `test -f 'pm_linux/pmlinux.c' || echo '$(srcdir)/'`pm_linux/pmlinux.c
pmlinux.obj: pm_linux/pmlinux.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pmlinux.obj -MD -MP -MF $(DEPDIR)/pmlinux.Tpo -c -o pmlinux.obj `if test -f 'pm_linux/pmlinux.c'; then $(CYGPATH_W) 'pm_linux/pmlinux.c'; else $(CYGPATH_W) '$(srcdir)/pm_linux/pmlinux.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/pmlinux.Tpo $(DEPDIR)/pmlinux.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pm_linux/pmlinux.c' object='pmlinux.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pmlinux.obj `if test -f 'pm_linux/pmlinux.c'; then $(CYGPATH_W) 'pm_linux/pmlinux.c'; else $(CYGPATH_W) '$(srcdir)/pm_linux/pmlinux.c'; fi`
finddefault.o: pm_linux/finddefault.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT finddefault.o -MD -MP -MF $(DEPDIR)/finddefault.Tpo -c -o finddefault.o `test -f 'pm_linux/finddefault.c' || echo '$(srcdir)/'`pm_linux/finddefault.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/finddefault.Tpo $(DEPDIR)/finddefault.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pm_linux/finddefault.c' object='finddefault.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o finddefault.o `test -f 'pm_linux/finddefault.c' || echo '$(srcdir)/'`pm_linux/finddefault.c
finddefault.obj: pm_linux/finddefault.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT finddefault.obj -MD -MP -MF $(DEPDIR)/finddefault.Tpo -c -o finddefault.obj `if test -f 'pm_linux/finddefault.c'; then $(CYGPATH_W) 'pm_linux/finddefault.c'; else $(CYGPATH_W) '$(srcdir)/pm_linux/finddefault.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/finddefault.Tpo $(DEPDIR)/finddefault.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pm_linux/finddefault.c' object='finddefault.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o finddefault.obj `if test -f 'pm_linux/finddefault.c'; then $(CYGPATH_W) 'pm_linux/finddefault.c'; else $(CYGPATH_W) '$(srcdir)/pm_linux/finddefault.c'; fi`
install-dist_docDATA: $(dist_doc_DATA)
@$(NORMAL_INSTALL)
test -z "$(docdir)" || $(MKDIR_P) "$(DESTDIR)$(docdir)"
@list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \
done
uninstall-dist_docDATA:
@$(NORMAL_UNINSTALL)
@list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
test -n "$$files" || exit 0; \
echo " ( cd '$(DESTDIR)$(docdir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(docdir)" && rm -f $$files
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
set x; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
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
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
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"
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
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
-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__remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
$(am__remove_distdir)
dist-lzma: distdir
tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
$(am__remove_distdir)
dist-xz: distdir
tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
$(am__remove_distdir)
dist-tarZ: distdir
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__remove_distdir)
dist-shar: distdir
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
$(am__remove_distdir)
dist dist-all: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__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.lzma*) \
lzma -dc $(distdir).tar.lzma | $(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 a+w $(distdir)
mkdir $(distdir)/_build
mkdir $(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 --srcdir=.. --prefix="$$dc_install_base" \
$(DISTCHECK_CONFIGURE_FLAGS) \
&& $(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__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:
@$(am__cd) '$(distuninstallcheck_dir)' \
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|| { 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-am
all-am: Makefile $(LIBRARIES) $(DATA)
installdirs:
for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(docdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
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)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
clean: clean-am
clean-am: clean-generic clean-libLIBRARIES mostlyclean-am
distclean: distclean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-dist_docDATA
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am: install-libLIBRARIES
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-dist_docDATA uninstall-libLIBRARIES
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
clean-generic clean-libLIBRARIES ctags dist dist-all \
dist-bzip2 dist-gzip dist-lzma dist-shar dist-tarZ dist-xz \
dist-zip distcheck distclean distclean-compile \
distclean-generic distclean-tags distcleancheck distdir \
distuninstallcheck dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am \
install-dist_docDATA install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-libLIBRARIES install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
uninstall-am uninstall-dist_docDATA uninstall-libLIBRARIES
# 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:

View File

@ -0,0 +1,128 @@
<?xml version="1.0" encoding = "Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="ZERO_CHECK"
ProjectGUID="{28779535-7541-4FF5-AC12-FAFD66E894EC}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="ZERO_CHECK.dir\Debug"
ConfigurationType="10"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".\pm_common;.\porttime;"
ExceptionHandling="0"
PreprocessorDefinitions="CMAKE_INTDIR=\&quot;Debug\&quot;"
AssemblerListingLocation="Debug"
ObjectFile="$(IntDir)\"
/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCResourceCompilerTool"
AdditionalIncludeDirectories=".\pm_common;.\porttime;"
PreprocessorDefinitions="CMAKE_INTDIR=\&quot;Debug\&quot;"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="CMAKE_INTDIR=\&quot;Debug\&quot;"
MkTypLibCompatible="FALSE"
TargetEnvironment="1"
GenerateStublessProxies="TRUE"
TypeLibraryName="$(InputName).tlb"
OutputDirectory="$(IntDir)"
HeaderFileName="$(InputName).h"
DLLDataFileName=""
InterfaceIdentifierFileName="$(InputName)_i.c"
ProxyFileName="$(InputName)_p.c"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCPostBuildEventTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="ZERO_CHECK.dir\Release"
ConfigurationType="10"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".\pm_common;.\porttime;"
ExceptionHandling="0"
PreprocessorDefinitions="CMAKE_INTDIR=\&quot;Release\&quot;"
AssemblerListingLocation="Release"
ObjectFile="$(IntDir)\"
/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCResourceCompilerTool"
AdditionalIncludeDirectories=".\pm_common;.\porttime;"
PreprocessorDefinitions="CMAKE_INTDIR=\&quot;Release\&quot;"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="CMAKE_INTDIR=\&quot;Release\&quot;"
MkTypLibCompatible="FALSE"
TargetEnvironment="1"
GenerateStublessProxies="TRUE"
TypeLibraryName="$(InputName).tlb"
OutputDirectory="$(IntDir)"
HeaderFileName="$(InputName).h"
DLLDataFileName=""
InterfaceIdentifierFileName="$(InputName)_i.c"
ProxyFileName="$(InputName)_p.c"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCPostBuildEventTool"/>
</Configuration>
</Configurations>
<Files>
<File
RelativePath=".\CMakeFiles\ZERO_CHECK">
</File>
<Filter
Name="CMake Rules"
Filter="">
<File
RelativePath=".\CMakeFiles\ZERO_CHECK.rule">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description=""
CommandLine=""
AdditionalDependencies=".\CMakeFiles\ZERO_CHECK.rule"
Outputs=".\CMakeFiles\ZERO_CHECK"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCustomBuildTool"
Description=""
CommandLine=""
AdditionalDependencies=".\CMakeFiles\ZERO_CHECK.rule"
Outputs=".\CMakeFiles\ZERO_CHECK"/>
</FileConfiguration>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -1,589 +0,0 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2007-03-29.01
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 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, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, 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.
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
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 outputing dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "depcomp $scriptversion"
exit $?
;;
esac
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"
# 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
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 -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## 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).
## - 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 -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
## 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.
tr ' ' '
' < "$tmpdepfile" |
## 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.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -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 -eq 0; then :
else
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 ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
tr '
' ' ' >> $depfile
echo >> $depfile
# The second pass generates a dummy entry for each header file.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> $depfile
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
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.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
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 -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
# Each line is of the form `foo.o: dependent.h'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a tab and a space in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
icc)
# Intel's C compiler understands `-MD -MF file'. However on
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
# ICC 7.0 will fill foo.d with something like
# foo.o: sub/foo.c
# foo.o: sub/foo.h
# which is wrong. We want:
# sub/foo.o: sub/foo.c
# sub/foo.o: sub/foo.h
# sub/foo.c:
# sub/foo.h:
# ICC 7.1 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using \ :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
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.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
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 -eq 0; then :
else
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,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
# Add `dependent.h:' lines.
sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
else
echo "#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.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
# With Tru64 cc, shared objects can also be used to make a
# static library. This mechanism is used in libtool 1.4 series to
# handle both shared and static libraries in a single compilation.
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
#
# With libtool 1.5 this exception was removed, and libtool now
# 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.libs/$base.lo.d # libtool 1.4
tmpdepfile2=$dir$base.o.d # libtool 1.5
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.o.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
tmpdepfile4=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a tab and a space in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
#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 $1 != '--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:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
tr ' ' '
' < "$tmpdepfile" | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
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 $1 != '--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no
for arg in "$@"; do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
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.
-*|$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"
cat < "$tmpdepfile" > "$depfile"
sed '1,2d' "$tmpdepfile" | tr ' ' '
' | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
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 $1 != '--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, regardless of -o,
# because we must use -o when running libtool.
"$@" || exit $?
IFS=" "
for arg
do
case "$arg" in
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
echo " " >> "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
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-end: "$"
# End:

View File

@ -1,519 +0,0 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2006-12-25.00
# 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
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
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
trap '(exit $?); exit' 1 2 13 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 starting with `-'.
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
# Protect names starting with `-'.
case $dst in
-*) dst=./$dst;;
esac
# 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-writeable 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 -z "$d" && 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-end: "$"
# End:

View File

@ -1,173 +0,0 @@
##### http://autoconf-archive.cryp.to/ax_cflags_strict_prototypes.html
#
# SYNOPSIS
#
# AX_CFLAGS_STRICT_PROTOTYPES [(shellvar [,default, [A/NA]]
#
# DESCRIPTION
#
# Try to find a compiler option that requires strict prototypes.
#
# The sanity check is done by looking at sys/signal.h which has a set
# of macro-definitions SIG_DFL and SIG_IGN that are cast to the local
# signal-handler type. If that signal-handler type is not fully
# qualified then the system headers are not seen as strictly
# prototype clean.
#
# For the GNU CC compiler it will be -fstrict-prototypes
# -Wstrict-prototypes The result is added to the shellvar being
# CFLAGS by default.
#
# DEFAULTS:
#
# - $1 shell-variable-to-add-to : CFLAGS
# - $2 add-value-if-not-found : nothing
# - $3 action-if-found : add value to shellvariable
# - $4 action-if-not-found : nothing
#
# LAST MODIFICATION
#
# 2006-12-12
#
# COPYLEFT
#
# Copyright (c) 2006 Guido U. Draheim <guidod@gmx.de>
#
# 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, the respective Autoconf Macro's copyright
# owner gives unlimited permission to copy, distribute and modify the
# configure scripts that are the output of Autoconf when processing
# the Macro. You need not follow the terms of the GNU General Public
# License when using or distributing such scripts, even though
# portions of the text of the Macro appear in them. The GNU General
# Public License (GPL) does govern all other use of the material that
# constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the
# Autoconf Macro released by the Autoconf Macro Archive. When you
# make and distribute a modified version of the Autoconf Macro, you
# may extend this special exception to the GPL to apply to your
# modified version as well.
AC_DEFUN([AX_CFLAGS_STRICT_PROTOTYPES],[dnl
AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_strict_prototypes])dnl
AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for strict prototypes],
VAR,[VAR="no, unknown"
AC_LANG_SAVE
AC_LANG_C
ac_save_[]FLAGS="$[]FLAGS"
for ac_arg dnl
in "-pedantic % -fstrict-prototypes -Wstrict-prototypes" dnl GCC
"-pedantic % -Wstrict-prototypes" dnl try to warn atleast
"-pedantic % -Wmissing-prototypes" dnl or another warning
"-pedantic % -Werror-implicit-function-declaration" dnl
"-pedantic % -Wimplicit-function-declaration" dnl
#
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
AC_TRY_COMPILE([],[return 0;],
[VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
done
case ".$VAR" in
.|.no|.no,*) ;;
*) # sanity check with signal() from sys/signal.h
cp config.log config.tmp
AC_TRY_COMPILE([#include <signal.h>],[
if (signal (SIGINT, SIG_IGN) == SIG_DFL) return 1;
if (signal (SIGINT, SIG_IGN) != SIG_DFL) return 2;],
dnl the original did use test -n `$CC testprogram.c`
[if test `diff config.log config.tmp | grep -i warning | wc -l` != 0
then if test `diff config.log config.tmp | grep -i warning | wc -l` != 1
then VAR="no, suppressed, signal.h," ; fi ; fi],
[VAR="no, suppressed, signal.h"])
rm config.tmp
;;
esac
FLAGS="$ac_save_[]FLAGS"
AC_LANG_RESTORE
])
case ".$VAR" in
.ok|.ok,*) m4_ifvaln($3,$3) ;;
.|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
*) m4_ifvaln($3,$3,[
if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
fi ]) ;;
esac
AS_VAR_POPDEF([VAR])dnl
AS_VAR_POPDEF([FLAGS])dnl
])
dnl the only difference - the LANG selection... and the default FLAGS
AC_DEFUN([AX_CXXFLAGS_STRICT_PROTOTYPES],[dnl
AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_strict_prototypes])dnl
AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for strict prototypes],
VAR,[VAR="no, unknown"
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
ac_save_[]FLAGS="$[]FLAGS"
for ac_arg dnl
in "-pedantic -Werror % -fstrict-prototypes -Wstrict-prototypes" dnl GCC
"-pedantic -Werror % -Wstrict-prototypes" dnl try to warn atleast
"-pedantic -Werror % -Wmissing-prototypes" dnl try to warn atleast
"-pedantic -Werror % -Werror-implicit-function-declaration" dnl
"-pedantic -Werror % -Wimplicit-function-declaration" dnl
"-pedantic % -Wstrict-prototypes %% no, unsupported in C++" dnl oops
#
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
AC_TRY_COMPILE([],[return 0;],
[VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
done
case ".$VAR" in
.|.no|.no,*) ;;
*) # sanity check with signal() from sys/signal.h
cp config.log config.tmp
AC_TRY_COMPILE([#include <signal.h>],[
if (signal (SIGINT, SIG_IGN) == SIG_DFL) return 1;
if (signal (SIGINT, SIG_IGN) != SIG_DFL) return 2;],
dnl the original did use test -n `$CC testprogram.c`
[if test `diff config.log config.tmp | grep -i warning | wc -l` != 0
then if test `diff config.log config.tmp | grep -i warning | wc -l` != 1
then VAR="no, suppressed, signal.h," ; fi ; fi],
[VAR="no, suppressed, signal.h"])
rm config.tmp
;;
esac
FLAGS="$ac_save_[]FLAGS"
AC_LANG_RESTORE
])
case ".$VAR" in
.ok|.ok,*) m4_ifvaln($3,$3) ;;
.|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
*) m4_ifvaln($3,$3,[
if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
fi ]) ;;
esac
AS_VAR_POPDEF([VAR])dnl
AS_VAR_POPDEF([FLAGS])dnl
])

View File

@ -1,158 +0,0 @@
##### http://autoconf-archive.cryp.to/ax_cflags_warn_all.html
#
# SYNOPSIS
#
# AX_CFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])]
#
# DESCRIPTION
#
# Try to find a compiler option that enables most reasonable
# warnings. This macro is directly derived from VL_PROG_CC_WARNINGS
# which is split up into two AX_CFLAGS_WARN_ALL and
# AX_CFLAGS_WARN_ALL_ANSI
#
# For the GNU CC compiler it will be -Wall (and -ansi -pedantic) The
# result is added to the shellvar being CFLAGS by default.
#
# Currently this macro knows about GCC, Solaris C compiler, Digital
# Unix C compiler, C for AIX Compiler, HP-UX C compiler, IRIX C
# compiler, NEC SX-5 (Super-UX 10) C compiler, and Cray J90 (Unicos
# 10.0.0.8) C compiler.
#
# - $1 shell-variable-to-add-to : CFLAGS
# - $2 add-value-if-not-found : nothing
# - $3 action-if-found : add value to shellvariable
# - $4 action-if-not-found : nothing
#
# LAST MODIFICATION
#
# 2006-12-12
#
# COPYLEFT
#
# Copyright (c) 2006 Guido U. Draheim <guidod@gmx.de>
#
# 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, the respective Autoconf Macro's copyright
# owner gives unlimited permission to copy, distribute and modify the
# configure scripts that are the output of Autoconf when processing
# the Macro. You need not follow the terms of the GNU General Public
# License when using or distributing such scripts, even though
# portions of the text of the Macro appear in them. The GNU General
# Public License (GPL) does govern all other use of the material that
# constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the
# Autoconf Macro released by the Autoconf Macro Archive. When you
# make and distribute a modified version of the Autoconf Macro, you
# may extend this special exception to the GPL to apply to your
# modified version as well.
AC_DEFUN([AX_CFLAGS_WARN_ALL],[dnl
AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_warn_all])dnl
AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings],
VAR,[VAR="no, unknown"
AC_LANG_SAVE
AC_LANG_C
ac_save_[]FLAGS="$[]FLAGS"
for ac_arg dnl
in "-pedantic % -Wall" dnl GCC
"-xstrconst % -v" dnl Solaris C
"-std1 % -verbose -w0 -warnprotos" dnl Digital Unix
"-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX
"-ansi -ansiE % -fullwarn" dnl IRIX
"+ESlit % +w1" dnl HP-UX C
"-Xc % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10)
"-h conform % -h msglevel 2" dnl Cray C (Unicos)
#
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
AC_TRY_COMPILE([],[return 0;],
[VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
done
FLAGS="$ac_save_[]FLAGS"
AC_LANG_RESTORE
])
case ".$VAR" in
.ok|.ok,*) m4_ifvaln($3,$3) ;;
.|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
*) m4_ifvaln($3,$3,[
if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
fi ]) ;;
esac
AS_VAR_POPDEF([VAR])dnl
AS_VAR_POPDEF([FLAGS])dnl
])
dnl the only difference - the LANG selection... and the default FLAGS
AC_DEFUN([AX_CXXFLAGS_WARN_ALL],[dnl
AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_warn_all])dnl
AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings],
VAR,[VAR="no, unknown"
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
ac_save_[]FLAGS="$[]FLAGS"
for ac_arg dnl
in "-pedantic % -Wall" dnl GCC
"-xstrconst % -v" dnl Solaris C
"-std1 % -verbose -w0 -warnprotos" dnl Digital Unix
"-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX
"-ansi -ansiE % -fullwarn" dnl IRIX
"+ESlit % +w1" dnl HP-UX C
"-Xc % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10)
"-h conform % -h msglevel 2" dnl Cray C (Unicos)
#
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
AC_TRY_COMPILE([],[return 0;],
[VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
done
FLAGS="$ac_save_[]FLAGS"
AC_LANG_RESTORE
])
case ".$VAR" in
.ok|.ok,*) m4_ifvaln($3,$3) ;;
.|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
*) m4_ifvaln($3,$3,[
if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
fi ]) ;;
esac
AS_VAR_POPDEF([VAR])dnl
AS_VAR_POPDEF([FLAGS])dnl
])
dnl implementation tactics:
dnl the for-argument contains a list of options. The first part of
dnl these does only exist to detect the compiler - usually it is
dnl a global option to enable -ansi or -extrawarnings. All other
dnl compilers will fail about it. That was needed since a lot of
dnl compilers will give false positives for some option-syntax
dnl like -Woption or -Xoption as they think of it is a pass-through
dnl to later compile stages or something. The "%" is used as a
dnl delimimiter. A non-option comment can be given after "%%" marks
dnl which will be shown but not added to the respective C/CXXFLAGS.

View File

@ -1,90 +0,0 @@
##### http://autoconf-archive.cryp.to/ax_cxx_check_flag.html
#
# SYNOPSIS
#
# AX_CXX_CHECK_FLAG(FLAG-TO-CHECK,[PROLOGUE],[BODY],[ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
#
# DESCRIPTION
#
# This macro tests if the C++ compiler supports the flag
# FLAG-TO-CHECK. If successfull execute ACTION-IF-SUCCESS otherwise
# ACTION-IF-FAILURE. PROLOGUE and BODY are optional and should be
# used as in AC_LANG_PROGRAM macro.
#
# This code is inspired from KDE_CHECK_COMPILER_FLAG macro. Thanks to
# Bogdan Drozdowski <bogdandr@op.pl> for testing and bug fixes.
#
# LAST MODIFICATION
#
# 2007-11-26
#
# COPYLEFT
#
# Copyright (c) 2007 Francesco Salvestrini <salvestrini@users.sourceforge.net>
#
# 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, the respective Autoconf Macro's copyright
# owner gives unlimited permission to copy, distribute and modify the
# configure scripts that are the output of Autoconf when processing
# the Macro. You need not follow the terms of the GNU General Public
# License when using or distributing such scripts, even though
# portions of the text of the Macro appear in them. The GNU General
# Public License (GPL) does govern all other use of the material that
# constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the
# Autoconf Macro released by the Autoconf Macro Archive. When you
# make and distribute a modified version of the Autoconf Macro, you
# may extend this special exception to the GPL to apply to your
# modified version as well.
AC_DEFUN([AX_CXX_CHECK_FLAG],[
AC_PREREQ([2.61])
AC_REQUIRE([AC_PROG_CXX])
AC_REQUIRE([AC_PROG_SED])
flag=`echo "$1" | $SED 'y% .=/+-(){}<>:*,%_______________%'`
AC_CACHE_CHECK([whether the C++ compiler accepts the $1 flag],
[ax_cv_cxx_check_flag_$flag],[
AC_LANG_PUSH([C++])
save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $1"
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([$2],[$3])
],[
eval "ax_cv_cxx_check_flag_$flag=yes"
],[
eval "ax_cv_cxx_check_flag_$flag=no"
])
CXXFLAGS="$save_CXXFLAGS"
AC_LANG_POP
])
AS_IF([eval "test \"`echo '$ax_cv_cxx_check_flag_'$flag`\" = yes"],[
:
$4
],[
:
$5
])
])

View File

@ -1,90 +0,0 @@
##### http://autoconf-archive.cryp.to/ax_cxxcpp_check_flag.html
#
# SYNOPSIS
#
# AX_CXXCPP_CHECK_FLAG(FLAG-TO-CHECK,[PROLOGUE],[BODY],[ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
#
# DESCRIPTION
#
# This macro tests if the C++ preprocessor supports the flag
# FLAG-TO-CHECK. If successfull execute ACTION-IF-SUCCESS otherwise
# ACTION-IF-FAILURE. PROLOGUE and BODY are optional and should be
# used as in AC_LANG_PROGRAM macro.
#
# This code is inspired from KDE_CHECK_COMPILER_FLAG macro. Thanks to
# Bogdan Drozdowski <bogdandr@op.pl> for testing and bug fixes.
#
# LAST MODIFICATION
#
# 2007-11-26
#
# COPYLEFT
#
# Copyright (c) 2007 Francesco Salvestrini <salvestrini@users.sourceforge.net>
#
# 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, the respective Autoconf Macro's copyright
# owner gives unlimited permission to copy, distribute and modify the
# configure scripts that are the output of Autoconf when processing
# the Macro. You need not follow the terms of the GNU General Public
# License when using or distributing such scripts, even though
# portions of the text of the Macro appear in them. The GNU General
# Public License (GPL) does govern all other use of the material that
# constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the
# Autoconf Macro released by the Autoconf Macro Archive. When you
# make and distribute a modified version of the Autoconf Macro, you
# may extend this special exception to the GPL to apply to your
# modified version as well.
AC_DEFUN([AX_CXXCPP_CHECK_FLAG],[
AC_PREREQ([2.61])
AC_REQUIRE([AC_PROG_CXXCPP])
AC_REQUIRE([AC_PROG_SED])
flag=`echo "$1" | $SED 'y% .=/+-(){}<>:*,%_______________%'`
AC_CACHE_CHECK([whether the C++ preprocessor accepts the $1 flag],
[ax_cv_cxxcpp_check_flag_$flag],[
AC_LANG_PUSH([C++])
save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $1"
AC_PREPROC_IFELSE([
AC_LANG_PROGRAM([$2],[$3])
],[
eval "ax_cv_cxxcpp_check_flag_$flag=yes"
],[
eval "ax_cv_cxxcpp_check_flag_$flag=no"
])
CXXFLAGS="$save_CXXFLAGS"
AC_LANG_POP
])
AS_IF([eval "test \"`echo '$ax_cv_cxxcpp_check_flag_'$flag`\" = yes"],[
:
$4
],[
:
$5
])
])

View File

@ -1,367 +0,0 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
scriptversion=2006-05-10.23
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
# Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
fi
run=:
sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
# In the cases where this matters, `missing' is being run in the
# srcdir already.
if test -f configure.ac; then
configure_ac=configure.ac
else
configure_ac=configure.in
fi
msg="missing on your system"
case $1 in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
shift
"$@" && exit 0
# Exit code 63 means version mismatch. This often happens
# when the user try to use an ancient version of a tool on
# a file that requires a minimum version. In this case we
# we should proceed has if the program had been absent, or
# if --run hadn't been passed.
if test $? = 63; then
run=:
msg="probably too old"
fi
;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
--run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
autom4te touch the output file, or create a stub one
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
help2man touch the output file
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
tar try tar, gnutar, gtar, then tar without non-portable flags
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
Send bug reports to <bug-automake@gnu.org>."
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
# Now exit if we have it, but it failed. Also exit now if we
# don't have it and --version was passed (most likely to detect
# the program).
case $1 in
lex|yacc)
# Not GNU programs, they don't have --version.
;;
tar)
if test -n "$run"; then
echo 1>&2 "ERROR: \`tar' requires --run"
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
exit 1
fi
;;
*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
# Could not run --version or --help. This is probably someone
# running `$TOOL --version' or `$TOOL --help' to check whether
# $TOOL exists and not knowing $TOOL uses missing.
exit 1
fi
;;
esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case $1 in
aclocal*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
case $f in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
esac
done
touch $touch_files
;;
automake*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
sed 's/\.am$/.in/' |
while read f; do touch "$f"; done
;;
autom4te)
echo 1>&2 "\
WARNING: \`$1' is needed, but is $msg.
You might have modified some files without having the
proper tools for further handling them.
You can get \`$1' as part of \`Autoconf' from any GNU
archive site."
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo "#! /bin/sh"
echo "# Created by GNU Automake missing as a replacement of"
echo "# $ $@"
echo "exit 0"
chmod +x $file
exit 1
fi
;;
bison|yacc)
echo 1>&2 "\
WARNING: \`$1' $msg. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
if test $# -ne 1; then
eval LASTARG="\${$#}"
case $LASTARG in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
if test ! -f y.tab.h; then
echo >y.tab.h
fi
if test ! -f y.tab.c; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
lex|flex)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
if test $# -ne 1; then
eval LASTARG="\${$#}"
case $LASTARG in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
if test ! -f lex.yy.c; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
help2man)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a dependency of a manual page. You may need the
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo ".ab help2man is required to generate this page"
exit 1
fi
;;
makeinfo)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
# The file to touch is that specified with -o ...
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -z "$file"; then
# ... or it is the one specified with @setfilename ...
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '
/^@setfilename/{
s/.* \([^ ]*\) *$/\1/
p
q
}' $infile`
# ... or it is derived from the source name (dir/f.texi becomes f.info)
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
fi
# If the file does not exist, the user really needs makeinfo;
# let's fail without touching anything.
test -f $file || exit 1
touch $file
;;
tar)
shift
# We have already tried tar in the generic part.
# Look for gnutar/gtar before invocation to avoid ugly error
# messages.
if (gnutar --version > /dev/null 2>&1); then
gnutar "$@" && exit 0
fi
if (gtar --version > /dev/null 2>&1); then
gtar "$@" && exit 0
fi
firstarg="$1"
if shift; then
case $firstarg in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" "$@" && exit 0
;;
esac
case $firstarg in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" "$@" && exit 0
;;
esac
fi
echo 1>&2 "\
WARNING: I can't seem to be able to run \`tar' with the given arguments.
You may want to install GNU tar or Free paxutils, or check the
command line arguments."
exit 1
;;
*)
echo 1>&2 "\
WARNING: \`$1' is needed, and is $msg.
You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
it often tells you about the needed prerequisites for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
;;
esac
exit 0
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

File diff suppressed because it is too large Load Diff

View File

@ -1,139 +0,0 @@
dnl
dnl portmidi configure.in script - version not using libtool
dnl
dnl based on portsmf/configure.ac
dnl
dnl Joshua Haberman
dnl Dominic Mazzoni
dnl Richard Ash
dnl Roger B. Dannenberg
dnl
dnl
dnl Instructions: to create "configure" from "configure.in", run:
dnl aclocal
dnl autoconf
dnl Process this file with autoconf to produce a configure script.
dnl Require autoconf >= 2.61
AC_PREREQ(2.61)
dnl Init autoconf and automake
AC_INIT([portmidi],[0.1])
dnl check that we have some source code
AC_CONFIG_SRCDIR([pm_common/portmidi.h])
dnl keep autools files in a subdirectory
AC_CONFIG_AUX_DIR(autotools)
# which also contains a subdir containing macros
AC_CONFIG_MACRO_DIR([autotools/m4])
dnl set up automake
AM_INIT_AUTOMAKE([-Wall foreign])
dnl Audacity policy: don't enable automatic rebuild of configure et al if
dnl sources change
AM_MAINTAINER_MODE([enable])
dnl -------------------------------------------------------
dnl Checks for programs.
dnl -------------------------------------------------------
dnl save $CFLAGS etc. since AC_PROG_CC likes to insert "-g -O2"
dnl if $CFLAGS is blank and it finds GCC
cflags_save="$CFLAGS"
cppflags_save="$CPPFLAGS"
cxxflags_save="$CXXFLAGS"
AC_PROG_CC
AC_LANG([C++])
AC_PROG_CXX
AC_PROG_CXXCPP
CFLAGS="$cflags_save"
CPPFLAGS="$cppflags_save"
CXXFLAGS="$cxxflags_save"
dnl we will need an "install" program to be available
AC_PROG_INSTALL
dnl and ranlib for static libraries
AC_PROG_RANLIB
dnl Make the install prefix available to the program so that the pkg-config file
dnl can be created correctly
AC_PREFIX_DEFAULT(/usr/local)
if [[ $prefix = "NONE" ]] ; then
AC_DEFINE(INSTALL_PREFIX, "/usr/local",
[define as prefix where Audacity is installed])
else
AC_DEFINE_UNQUOTED(INSTALL_PREFIX, "$prefix")
fi
dnl Build Options
AC_ARG_ENABLE(debug,
[AS_HELP_STRING([--enable-debug],
[enable debug support [default=no]])],
debug_preference="$enableval",
debug_preference="no")
dnl ----------------------------------------------------
dnl If user asked for debug, put debug in compiler flags
dnl ----------------------------------------------------
if test x"$debug_preference" = "xyes" ; then
dnl we want debuging on
AC_MSG_NOTICE([Adding -g for debugging to CFLAGS and CXXFLAGS ...])
CFLAGS="${CFLAGS} -g "
CXXFLAGS="${CXXFLAGS} -g "
fi
dnl --------------------------------------------------------------------------
dnl We would like warnings enabled on the builds, but different compilers need
dnl different options for these. This bit tries to work out what flags we
dnl should add to the compiler we are using.
dnl --------------------------------------------------------------------------
dnl Strict prototypes flags for C (only C because doesn't work for C++)
AX_CFLAGS_STRICT_PROTOTYPES(CFLAGS)
dnl Sensible warnings for C
AX_CFLAGS_WARN_ALL(wall_flags)
CFLAGS="${CFLAGS} $wall_flags"
dnl try and use it on C++ as well
AX_CXX_CHECK_FLAG([$wall_flags], [[int foo;]], [[foo = 1;]], cxx_does_wall="yes", cxx_does_wall="no")
if test "x$cxx_does_wall" = "xyes" ; then
dnl can use all warnings flag on the C++ compiler
CXXFLAGS="${CXXFLAGS} $wall_flags"
fi
AX_CXXCPP_CHECK_FLAG([$wall_flags], [[int foo;]], [[foo = 1;]], cpp_does_wall="yes", cpp_does_wall="no")
if test "x$cpp_does_wall" = "xyes" ; then
dnl can use all warnings flag on the C++ pre-processor
CPPFLAGS="${CPPFLAGS} $wall_flags"
fi
dnl --- check for required libraries ---
dnl system libraries
AC_CHECK_FUNCS([strchr memmove])
AC_FUNC_MALLOC
AC_HEADER_STDBOOL
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([stdlib.h assert.h string.h alsa/asoundlib.h])
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_CONFIG_FILES([Makefile portmidi.pc portmidi-uninstalled.pc])
AC_OUTPUT
echo ""
echo "Run 'configure --help' for an explanation of the possible options,"
echo "otherwise run 'make' to build portmidi."
dnl Indentation settings for Vim and Emacs and unique identifier for Arch, a
dnl version control system. Please do not modify past this point.
# Local Variables:
# c-basic-offset: 3
# indent-tabs-mode: nil
# End:
#
# vim: et sts=3 sw=3

View File

@ -0,0 +1,104 @@
README_CL.txt for PortMidi
Roger B. Dannenberg
17 Jan 2007
This is a Common Lisp interface to PortMidi.
On Mac OSX, you need to build PortMidi as a dynamic link library
before you can use PortMidi from Common Lisp.
You can build PortMidi as a dynamic link library by running this:
cd portmidi
make -F pm_mac/Makefile.osx install-with-xcode
This is just a shortcut for:
cd portmidi/pm_mac
sudo xcodebuild -project pm_mac.xcodeproj -configuration Deployment install DSTROOT=/
You can check the file and the architecture for which it is built using:
file /usr/local/lib/libportmidi.dylib
If you've done this install of portmidi, then you should also have
/usr/local/include/portmidi.h
This will be necessary to successfully build the cffi interface below.
To test PortMidi with Common Lisp, I (RBD) am using SBCL, which I
downloaded from http://prdownloads.sourceforge.net/sbcl. Currently, I use
sbcl-0.9.17-x86-darwin-binary.tar.bz2
To install this, I unpacked it by just double-clicking in the finder. Then,
from a command window, I became root using "sudo sh", and then typed:
# INSTALL_ROOT=/usr/local
# sh install.sh
# exit
I also downloaded cffi-061012.tar.gz from
http://common-lisp.net/project/cffi/tarballs/?M=D
To compile cffi, use the following, where "/Lisp/cffi/" is replaced by
the actual directory of cffi, e.g.
"/Users/rbd/sbcl-0.9.17-x86-darwin/cffi-061012":
% sbcl
* (require 'asdf)
* (push "/Lisp/cffi/" asdf:*central-registry*)
* (asdf:oos 'asdf:load-op :cffi)
* (quit)
Download Common Music's portmidi module from cvs and build the c side:
(Replace "/Lisp" with your lisp directory, e.g.
"/Users/rbd/sbcl-0.9.17-x86-darwin". These cvs commands will create
a new directory, portmidi.)
% cd /Lisp
% export CVSROOT=:pserver:anonymous@commonmusic.cvs.sourceforge.net:/cvsroot/commonmusic
% cvs login # press Return at password prompt
% cvs checkout portmidi
% cd portmidi
% ./configure
% make
% cd ..
Now compile/load the portmidi module just like cffi. Again, change
"/Lisp/cffi/" and "/Lisp/portmidi" to correspond to your local file system.
(Note that /Lisp becomes your lisp directory, and "cffi" becomes your
cffi folder name, e.g. "cffi-061012".
% sbcl
* (require 'asdf)
* (push "/Lisp/cffi/" asdf:*central-registry*)
* (asdf:oos 'asdf:load-op :cffi)
* (push "/Lisp/portmidi/" asdf:*central-registry*)
* (asdf:oos 'asdf:load-op :portmidi)
Look in the file /Lisp/portmidi/test.lisp for a test of the lisp interface to
portmidi. For example, while still running sbcl:
* (pm:portmidi) ; initialize portmidi
* (pt:start) ; start time
* (pt:time) ; get time
* (pprint (pm:GetDeviceInfo)) ; get list of devices
((:ID 0 :NAME "IAC Driver Bus 1" :TYPE :INPUT :OPEN NIL)
(:ID 1 :NAME "IAC Driver Bus 1" :TYPE :OUTPUT :OPEN NIL))
Notice that test.lisp assumes MIDI input devices are connected
and uses some hard-wired device numbers, so it may not run
as is without error.
Since test.lisp uses some Common Music calls, I (RBD) wrote a
simpler test, test-no-cm.lisp, which is in the same folder as
this (README_CL.txt) file. To use it, first check that the
values for outid (4) and inid (1) actually match PortMidi device
id's for output and input devices, and make sure the input
device is a keyboard that can generate a middle-C -- otherwise
the program will hang waiting for input. Run sbcl from this
pm_cl folder, and type:
(load "test-no-cm.lisp")
The program pauses frequently by calling (READ), so you
should type t or something, then <RETURN> to continue.
(Thanks to Leigh Smith and Rick Taube)

View File

@ -0,0 +1,384 @@
;;; **********************************************************************
;;; Copyright (C) 2005 Heinrich Taube, <taube (at) uiuc (dot) edu>
;;;
;;; This program is free software; you can redistribute it and/or
;;; modify it under the terms of the Lisp Lesser Gnu Public License.
;;; See http://www.cliki.net/LLGPL for the text of this agreement.
;;; **********************************************************************
;;; A CFFI interface to Portmidi. Should run in most Common Lisp
;;; implementations on Linux, OS X and Windows. For information about
;;; CFFI see http://common-lisp.net/project/cffi/
(in-package :cl-user)
(defvar *libportmidi*
(let ((type #+(or darwin macos macosx) "dylib"
#+(or linux linux-target (and unix pc386) freebsd) "so"
#+(or win32 microsoft-32 cygwin) "dll")
(paths (list "/usr/lib/" "/usr/local/lib/" *load-pathname*)))
(loop for d in paths
for p = (make-pathname :name "libportmidi" :type type
:defaults d)
when (probe-file p) do (return p)
finally
(error "Library \"portmidi.~A\" not found. Fix *libportmidi*."
type))))
;;; linux: guess i need to load porttime.so first (?) osx doesnt seem
;;; to need this lib at all...
#+(or linux (and clisp unix (not macos)))
(let ((lpt (merge-pathnames "libporttime" *libportmidi*)))
(if (probe-file lpt)
(cffi:load-foreign-library lpt)
(error "Porttime: ~a not found. Fix *libportmidi* path." lpt)))
;;; load portmidi lib
(cffi:load-foreign-library *libportmidi*)
(defpackage :portmidi
(:use :common-lisp)
(:nicknames :pm :pt)
(:shadow :initialize :terminate :time :start :stop :abort
:close :read :write :poll)
(:export :Initialize :Terminate
:HasHostError :GetErrorText :GetHostErrorText
:CountDevices :GetDefaultInputDeviceID
:GetDefaultOutputDeviceID :GetDeviceInfo
:Message :Message.status :Message.data1 :Message.data2
:Event.message :Event.timestamp
;; event buffers added to api
:EventBufferNew :EventBufferFree :EventBufferElt
:EventBufferMap
:OpenInput :OpenOutput :SetFilter :SetChannelMask
:Abort :Close :Read :Write :Poll :WriteShort :WriteSysex
;; filtering constants
:filt-active :filt-sysex :filt-clock :filt-play :filt-f9
:filt-fd :filt-reset :filt-note :filt-channel-aftertouch
:filt-poly-aftertouch :filt-program :filt-control
:filt-pitchbend :filt-mtc :filt-song-position
:filt-song-select :filt-tune :filt-tick :filt-undefined
:filt-realtime :filt-aftertouch :filt-systemcommon
;; porttime.
:Start :Stop :Started :Time
;; initialization insurers added to api
:portmidi :*portmidi* ))
(in-package :portmidi)
(cffi:defcstruct pm-device-info
(struct-version :int)
(interf :pointer)
(name :pointer)
(input :int)
(output :int)
(opened :int))
(cffi:define-foreign-type pm-message () ':long)
(cffi:define-foreign-type pm-timestamp () ':long)
(cffi:defcstruct pm-event
(message pm-message)
(timestamp pm-timestamp))
(cffi:define-foreign-type pm-error () ':int)
(cffi:define-foreign-type port-midi-stream () ':void)
(cffi:define-foreign-type pm-device-id () ':int)
(cffi:define-foreign-type pm-time-proc-ptr () ':pointer)
(cffi:defcfun ("Pm_WriteSysEx" pm-write-sys-ex) pm-error (stream :pointer) (when pm-timestamp) (msg :pointer))
(cffi:defcfun ("Pm_WriteShort" pm-write-short) pm-error (stream :pointer) (when pm-timestamp) (msg :long))
(cffi:defcfun ("Pm_Write" pm-write) pm-error (stream :pointer) (buffer :pointer) (length :long))
(cffi:defcfun ("Pm_Poll" pm-poll) pm-error (stream :pointer))
(cffi:defcfun ("Pm_Read" pm-read) pm-error (stream :pointer) (buffer :pointer) (length :long))
(cffi:defcfun ("Pm_Close" pm-close) pm-error (stream :pointer))
(cffi:defcfun ("Pm_Abort" pm-abort) pm-error (stream :pointer))
;(cffi:defcfun ("Pm_SetChannelMask" pm-set-channel-mask) pm-error (stream :pointer) (mask :int))
(cffi:defcfun ("Pm_SetFilter" pm-set-filter) pm-error (stream :pointer) (filters :long))
(cffi:defcfun ("Pm_OpenOutput" pm-open-output) pm-error (stream :pointer) (output-device pm-device-id) (output-driver-info :pointer) (buffer-size :long) (time-proc pm-time-proc-ptr) (time-info :pointer) (latency :long))
(cffi:defcfun ("Pm_OpenInput" pm-open-input) pm-error (stream :pointer) (input-device pm-device-id) (input-driver-info :pointer) (buffer-size :long) (time-proc pm-time-proc-ptr) (time-info :pointer))
(cffi:defcfun ("Pm_GetDeviceInfo" pm-get-device-info) :pointer (id pm-device-id))
(cffi:defcfun ("Pm_GetDefaultOutputDeviceID" pm-get-default-output-device-id) pm-device-id)
(cffi:defcfun ("Pm_GetDefaultInputDeviceID" pm-get-default-input-device-id) pm-device-id)
(cffi:defcfun ("Pm_CountDevices" pm-count-devices) :int)
(cffi:defcfun ("Pm_GetHostErrorText" pm-get-host-error-text) :void (msg :pointer) (len :unsigned-int))
(cffi:defcfun ("Pm_GetErrorText" pm-get-error-text) :pointer (errnum pm-error))
(cffi:defcfun ("Pm_HasHostError" pm-has-host-error) :int (stream :pointer))
(cffi:defcfun ("Pm_Terminate" pm-terminate) pm-error)
(cffi:defcfun ("Pm_Initialize" pm-initialize) pm-error)
;;; porttime.h
(cffi:define-foreign-type pt-error () ':int)
(cffi:define-foreign-type pt-timestamp () ':long)
(cffi:defcfun ("Pt_Start" pt-start) pt-error (a :int) (b :pointer) (c :pointer))
(cffi:defcfun ("Pt_Stop" pt-stop) pt-error )
(cffi:defcfun ("Pt_Started" pt-started) :int)
(cffi:defcfun ("Pt_Time" pt-time) pt-timestamp)
(defconstant true 1)
(defconstant false 0)
(defconstant pmNoError 0)
(defconstant pmHostError -10000)
(defconstant pm-no-device -1)
(defconstant pm-default-sysex-buffer-size 1024)
(defconstant filt-active 1)
(defconstant filt-sysex 2)
(defconstant filt-clock 4)
(defconstant filt-play 8)
(defconstant filt-f9 16)
(defconstant filt-fd 32)
(defconstant filt-reset 64)
(defconstant filt-note 128)
(defconstant filt-channel-aftertouch 256)
(defconstant filt-poly-aftertouch 512)
(defconstant filt-program 1024)
(defconstant filt-control 2048)
(defconstant filt-pitchbend 4096)
(defconstant filt-mtc 8192)
(defconstant filt-song-position 16384)
(defconstant filt-song-select 32768)
(defconstant filt-tune 65536)
(defconstant filt-tick filt-f9)
(defconstant filt-undefined (logior filt-f9 filt-fd))
(defconstant filt-realtime (logior filt-active filt-sysex
filt-clock filt-play
filt-undefined filt-reset))
(defconstant filt-aftertouch (logior filt-channel-aftertouch
filt-poly-aftertouch ))
(defconstant filt-systemcommon (logior filt-mtc filt-song-position
filt-song-select filt-tune))
(defvar *portmidi* nil) ; t if loaded
;;;
;;; utils
;;;
(defvar host-error-text (make-string 256 :initial-element #\*))
(defmacro with-pm-error (form)
(let ((v (gensym)))
`(let ((,v ,form))
(if (not (= ,v pmNoError))
(if (= ,v pmHostError)
(cffi:with-foreign-string (host-error host-error-text)
(pm-get-host-error-text host-error
(length host-error-text))
(error "Host error is: ~a"
(cffi:foreign-string-to-lisp host-error)))
(error (cffi:foreign-string-to-lisp
(pm-get-error-text ,v))))
,v))))
(defun portmidi ()
;; initializer, call before using lib
(or *portmidi*
(progn (pm-initialize)
(setq *portmidi* t))))
(defun Message (status data1 data2)
;; portmidi messages are just unsigneds
(logior (logand (ash data2 16) #xFF0000)
(logand (ash data1 08) #xFF00)
(logand status #xFF)))
(defun Message.status (m)
(logand m #xFF))
(defun Message.data1 (m)
(logand (ash m -08) #xFF))
(defun Message.data2 (m)
(logand (ash m -16) #xFF))
;;; accessors
(defun DeviceInfo.interf (ptr)
(cffi:foreign-string-to-lisp
(cffi:foreign-slot-value ptr 'pm-device-info 'interf)))
(defun DeviceInfo.name (ptr)
(cffi:foreign-string-to-lisp
(cffi:foreign-slot-value ptr 'pm-device-info 'name)))
(defun DeviceInfo.input (ptr)
(if (= (cffi:foreign-slot-value ptr 'pm-device-info 'input) 0)
nil
t))
(defun DeviceInfo.output (ptr)
(if (= (cffi:foreign-slot-value ptr 'pm-device-info 'output) 0)
nil
t))
(defun DeviceInfo.opened (ptr)
(if (= (cffi:foreign-slot-value ptr 'pm-device-info 'opened) 0)
nil
t))
(defun Event.message (e &optional (v nil vp))
(if vp
(progn
(setf (cffi:foreign-slot-value e 'pm-event 'message) v)
v)
(cffi:foreign-slot-value e 'pm-event 'message)))
(defun Event.timestamp (e &optional (v nil vp))
(if vp
(progn
(setf (cffi:foreign-slot-value e 'pm-event 'timestamp) v)
v)
(cffi:foreign-slot-value e 'pm-event 'timestamp)))
;;; functions
(defun Initialize ()
(with-pm-error (pm-initialize)))
(defun terminate ()
(with-pm-error (pm-terminate)))
(defun HasHostError (pms)
(pm-has-host-error pms))
(defun GetErrorText (err)
(pm-get-error-text err))
; how do i do this?
;(progn
; (defalien "pm-GetHostErrorText" void (a c-string) (b unsigned-int))
; (defun GetHostErrorText ()
; (pm-GetHostErrorText 256)))
(defun CountDevices ()
(portmidi)
(pm-count-devices ))
(defun GetDefaultInputDeviceID ()
(let ((id (pm-get-default-input-device-id )))
(if (= id pm-no-device) nil id)))
(defun GetDefaultOutputDeviceID ()
(let ((id (pm-get-default-output-device-id )))
(if (= id pm-no-device) nil id)))
;replaced by lispy version end of file.
;(defun GetDeviceInfo (id) (pm-get-device-info id))
(defun OpenInput (device bufsiz)
;; portmidi: timer must be running before opening
(unless (Started) (Start))
(cffi:with-foreign-object (p1 :pointer)
(let ((err (pm-open-input p1 device (cffi:null-pointer)
bufsiz (cffi:null-pointer) (cffi:null-pointer))))
(if (= err pmNoError)
(cffi:mem-ref p1 :pointer)
(error (pm-get-error-text err))))))
(defun OpenOutput (device bufsiz latency)
(unless (Started) (Start))
(cffi:with-foreign-object (p1 :pointer) ;(p (* PortMidi))
(let ((err (pm-open-output p1 device (cffi:null-pointer)
bufsiz (cffi:null-pointer) (cffi:null-pointer)
latency)))
(if (= err pmNoError)
(cffi:mem-ref p1 :pointer)
(error (pm-get-error-text err))))))
(defun SetFilter (a filts)
(with-pm-error
(pm-set-filter a filts)))
;(defun SetChannelMask (pms mask)
; (with-pm-error (pm-set-channel-mask pms mask)))
(defun Abort (pms)
(with-pm-error (pm-abort pms)))
(defun Close (pms)
(with-pm-error (pm-close pms)))
(defun EventBufferFree (buf)
(cffi:foreign-free buf))
(defun EventBufferNew (len)
(cffi:foreign-alloc 'pm-event :count len))
(defun EventBufferElt (buf i)
;; buf is POINTER to buf
(cffi:mem-aref buf 'pm-event i))
(defun EventBufferSet (buffer index timestamp message)
(setf (cffi:foreign-slot-value
(cffi:mem-aref buffer 'pm-event index) 'pm-event 'timestamp)
timestamp)
(setf (cffi:foreign-slot-value
(cffi:mem-aref buffer 'pm-event index) 'pm-event 'message)
message)
(values))
(defun EventBufferMap (fn buf end)
(loop for i below end
for e = (EventBufferElt buf i)
do (funcall fn (Event.message e) (Event.timestamp e)))
(values))
(defun Read (pms *evbuf len)
(let ((res (pm-read pms *evbuf len)))
(if (< res 0)
(error (pm-get-error-text res))
res)))
(defun Poll (pms)
(let ((res (pm-poll pms)))
(cond ((= res 0) nil)
((= res 1) t)
(t (error (pm-get-error-text res))))))
(defun Write (pms *evbuf len)
(with-pm-error (pm-write pms *evbuf len)))
(defun WriteShort (pms when msg)
(with-pm-error (pm-write-short pms when msg)))
(defun WriteSysex (pms when string)
(cffi:with-foreign-string (ptr string)
(with-pm-error (pm-write-sys-ex pms when ptr))))
;;; porttime.h
(defun Started ()
(let ((res (pt-started)))
(if (= res false) nil t)))
(defun Start ()
;; NB: This has to be called before opening output or input.
;; it seems that if its called 2x we get an error.
(unless (Started)
(with-pm-error (pt-start 1 (cffi:null-pointer) (cffi:null-pointer))))
(values))
(defun Stop ()
(when (Started)
(with-pm-error (pt-stop)))
(values))
(defun Time ()
(pt-time))
(defun GetDeviceInfo (&optional id)
(flet ((getone (id)
(let ((d (pm-get-device-info id)))
(list :id id
:name (DeviceInfo.name d)
:type (if (DeviceInfo.input d) ':input ':output)
:open (DeviceInfo.opened d)))))
;; make sure lib is initialized before checking devices
(portmidi)
(if id (getone id)
(loop for i below (CountDevices)
collect (getone i)))))
(pushnew ':portmidi *features*)

View File

@ -0,0 +1,112 @@
;; this is a half-baked sequence of PortMidi calls to test the interface
;; No calls to Common Music are made, hence test-no-cm.lisp
; setup cffi if it has not been done already
(if (not (boundp '*clpath*))
(load "setup-pm.lisp"))
(defun println (s) (print s) (terpri))
;; initialize portmidi lib
(pm:portmidi)
;; timer testing
(pt:Start )
(pt:Started)
(format t "time is ~A, type something~%" (pt:Time))
(read)
(format t "time is ~A, type something~%" (pt:Time))
(read)
(pt:Time)
(format t "time is ~A, type something~%" (pt:Time))
;; device testing
(pm:CountDevices)
(pprint (pm:GetDeviceInfo ))
(defparameter inid (pm:GetDefaultInputDeviceID ))
(pm:GetDeviceInfo inid)
(defparameter outid (pm:GetDefaultOutputDeviceID ))
(pm:GetDeviceInfo outid)
;; output testing
(defparameter outid 4) ; 4 = my SimpleSynth
(defparameter outdev (pm:OpenOutput outid 100 1000))
(pm:getDeviceInfo outid) ; :OPEN should be T
;; message tests
(defun pm (m &optional (s t))
(format s "#<message :op ~2,'0x :ch ~2,'0d :data1 ~3,'0d :data2 ~3,'0d>"
(ash (logand (pm:Message.status m) #xf0) -4)
(logand (pm:Message.status m) #x0f)
(pm:Message.data1 m)
(pm:Message.data2 m)))
(defparameter on (pm:message #b10010000 60 64))
(terpri)
(pm on)
(pm:Message.status on)
(logand (ash (pm:Message.status on) -4) #x0f)
(pm:Message.data1 on)
(pm:Message.data2 on)
(pm:WriteShort outdev (+ (pm:time) 100) on)
(defparameter off (pm:message #b10000000 60 64))
(terpri)
(pm off)
(terpri)
(println "type something for note off")
(read)
(pm:WriteShort outdev (+ (pm:time) 100) off)
(println "type something to close output device")
(read)
(pm:Close outdev)
;; event buffer testing
(defparameter buff (pm:EventBufferNew 8))
(loop for i below 8 for x = (pm:EventBufferElt buff i)
;; set buffer events
do
(pm:Event.message x (pm:message #b1001000 (+ 60 i) (+ 100 i)))
(pm:Event.timestamp x (* 1000 i)))
(loop for i below 8 for x = (pm:EventBufferElt buff i)
;; check buffer contents
collect (list (pm:Event.timestamp x)
(pm:Message.data1 (pm:Event.message x))
(pm:Message.data2 (pm:Event.message x))))
(pm:EventBufferFree buff)
;; input testing -- requires external midi keyboard
(println (pm:GetDeviceInfo ))
(defparameter inid 1) ; 1 = my external keyboard
(defparameter indev (pm:OpenInput inid 256))
(pm:GetDeviceInfo inid) ; :OPEN should be T
(pm:SetFilter indev pm:filt-realtime) ; ignore active sensing etc.
(println "poll says:")
(println (pm:Poll indev))
(println "play midi keyboard and type something")
(read)
;;
;; ...play midi keyboard, then ...
;;
(println "poll says")
(println (pm:Poll indev))
(defparameter buff (pm:EventBufferNew 32))
(defparameter num (pm:Read indev buff 32))
(println "pm:Read gets")
(println num)
(println "input messages:")
(pm:EventBufferMap (lambda (a b) b (terpri) (pm a))
buff num)
(pm:Poll indev)
(println "play keyboard, to stop, play middle-C")
;;; recv testing
(defparameter pitch 0)
(loop while (/= pitch 60) do
(let ((n (pm:Read indev buff 1)))
(cond ((= n 1)
(pm:EventBufferMap
(lambda (a b)
b (pm a) (terpri)
(setf pitch (pm:Message.data1 a)))
buff n)))))
(pm:EventBufferFree buff)
(pm:Close indev)

View File

@ -0,0 +1,128 @@
# pm_common
# set the build directory for libportmidi.a to be in portmidi, not in
# portmidi/pm_common
if(APPLE OR WIN32)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
# set the build directory for .dylib libraries
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
# the first time CMake configures, save off CMake's built-in flags
if(NOT DEFAULT_DEBUG_FLAGS)
set(DEFAULT_DEBUG_FLAGS ${CMAKE_C_FLAGS_DEBUG} CACHE
STRING "CMake's default debug flags" FORCE)
set(DEFAULT_RELEASE_FLAGS ${CMAKE_C_FLAGS_RELEASE} CACHE
STRING "CMake's default release flags" FORCE)
else(NOT DEFAULT_DEBUG_FLAGS)
message(STATUS "DEFAULT_DEBUG_FLAGS not nil: " ${DEFAULT_DEBUG_FLAGS})
endif(NOT DEFAULT_DEBUG_FLAGS)
else(APPLE OR WIN32)
set(LINUX_FLAGS "-DPMALSA")
endif(APPLE OR WIN32)
if(APPLE)
set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.6.sdk CACHE
PATH "-isysroot parameter for compiler")
set(CMAKE_C_FLAGS "-mmacosx-version-min=10.6" CACHE
STRING "needed in conjunction with CMAKE_OSX_SYSROOT" FORCE)
endif(APPLE)
macro(prepend_path RESULT PATH)
set(${RESULT})
foreach(FILE ${ARGN})
list(APPEND ${RESULT} "${PATH}${FILE}")
endforeach(FILE)
endmacro(prepend_path)
set(CMAKE_C_FLAGS_DEBUG
"${DEFAULT_DEBUG_FLAGS} -DPM_CHECK_ERRORS=1 -DDEBUG ${LINUX_FLAGS}"
CACHE STRING "enable extra checks for debugging" FORCE)
set(CMAKE_C_FLAGS_RELEASE "${DEFAULT_RELEASE_FLAGS} ${LINUX_FLAGS}"
CACHE STRING "flags for release version" FORCE)
# first include the appropriate system-dependent file:
if(UNIX)
# add the -g switch for Linux and Mac OS X (not used in Win32)
set (CMAKE_C_FLAGS_DEBUG "-g ${CMAKE_C_FLAGS_DEBUG}"
CACHE STRING "enable extra checks for debugging" FORCE)
if(APPLE)
set(MACSRC pmmacosxcm pmmac readbinaryplist finddefault)
prepend_path(LIBSRC ../pm_mac/ ${MACSRC})
list(APPEND LIBSRC ../porttime/ptmacosx_mach)
include_directories(${CMAKE_OSX_SYSROOT}/Developer/Headers/FlatCarbon)
set(FRAMEWORK_PATH ${CMAKE_OSX_SYSROOT}/System/Library/Frameworks)
set(COREAUDIO_LIB "${FRAMEWORK_PATH}/CoreAudio.framework")
set(COREFOUNDATION_LIB "${FRAMEWORK_PATH}/CoreFoundation.framework")
set(COREMIDI_LIB "${FRAMEWORK_PATH}/CoreMIDI.framework")
set(CORESERVICES_LIB "${FRAMEWORK_PATH}/CoreServices.framework")
set(PM_NEEDED_LIBS ${COREAUDIO_LIB} ${COREFOUNDATION_LIB}
${COREMIDI_LIB} ${CORESERVICES_LIB}
CACHE INTERNAL "")
set(JAVAVM_LIB "${FRAMEWORK_PATH}/JavaVM.framework")
set(JAVA_INCLUDE_PATHS ${JAVAVM_LIB}/Headers)
message(STATUS "SYSROOT: " ${CMAKE_OSX_SYSROOT})
else(APPLE)
# LINUX settings...
include(FindJNI)
message(STATUS "JAVA_JVM_LIB_PATH is " ${JAVA_JVM_LIB_PATH})
message(STATUS "JAVA_INCLUDE_PATH is " ${JAVA_INCLUDE_PATH})
message(STATUS "JAVA_INCLUDE_PATH2 is " ${JAVA_INCLUDE_PATH2})
message(STATUS "JAVA_JVM_LIBRARY is " ${JAVA_JVM_LIBRARY})
set(JAVA_INCLUDE_PATHS ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})
# libjvm.so is found relative to JAVA_INCLUDE_PATH:
set(JAVAVM_LIB ${JAVA_JVM_LIBRARY}/libjvm.so)
set(LINUXSRC pmlinuxalsa pmlinux finddefault)
prepend_path(LIBSRC ../pm_linux/ ${LINUXSRC})
list(APPEND LIBSRC ../porttime/ptlinux)
set(PM_NEEDED_LIBS pthread asound)
endif(APPLE)
else(UNIX)
if(WIN32)
# /MDd is multithread debug DLL, /MTd is multithread debug
# /MD is multithread DLL, /MT is multithread. Change to static:
include(../pm_win/static.cmake)
include(FindJNI)
set(JAVA_INCLUDE_PATHS ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})
# message(STATUS "JAVA_INCLUDE_PATHS: " ${JAVA_INCLUDE_PATHS})
set(WINSRC pmwin pmwinmm)
prepend_path(LIBSRC ../pm_win/ ${WINSRC})
list(APPEND LIBSRC ../porttime/ptwinmm)
set(PM_NEEDED_LIBS winmm.lib)
endif(WIN32)
endif(UNIX)
set(JNI_EXTRA_LIBS ${PM_NEEDED_LIBS} ${JAVA_JVM_LIBRARY})
# this completes the list of library sources by adding shared code
list(APPEND LIBSRC pmutil portmidi)
# now add the shared files to make the complete list of library sources
add_library(portmidi-static ${LIBSRC})
set_target_properties(portmidi-static PROPERTIES OUTPUT_NAME "portmidi_s")
target_link_libraries(portmidi-static ${PM_NEEDED_LIBS})
# define the jni library
include_directories(${JAVA_INCLUDE_PATHS})
set(JNISRC ${LIBSRC} ../pm_java/pmjni/pmjni.c)
add_library(pmjni SHARED ${JNISRC})
target_link_libraries(pmjni ${JNI_EXTRA_LIBS})
set_target_properties(pmjni PROPERTIES EXECUTABLE_EXTENSION "jnilib")
# install the libraries (Linux and Mac OS X command line)
if(UNIX)
INSTALL(TARGETS portmidi-static pmjni
LIBRARY DESTINATION /usr/local/lib
ARCHIVE DESTINATION /usr/local/lib)
# .h files installed by pm_dylib/CMakeLists.txt, so don't need them here
# INSTALL(FILES portmidi.h ../porttime/porttime.h
# DESTINATION /usr/local/include)
endif(UNIX)

View File

@ -0,0 +1,161 @@
<?xml version="1.0" encoding = "Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="pmjni"
ProjectGUID="{87B548BD-F5CE-4D1F-9181-390966AC5855}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="pmjni.dir\Debug"
ConfigurationType="2"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalOptions=" /Zm1000"
AdditionalIncludeDirectories="..\pm_common;..\porttime;&quot;C:\Program Files\Java\jdk1.6.0_16\include&quot;;&quot;C:\Program Files\Java\jdk1.6.0_16\include\win32&quot;;"
BasicRuntimeChecks="3"
CompileAs="1"
DebugInformationFormat="3"
ExceptionHandling="0"
InlineFunctionExpansion="0"
Optimization="0"
RuntimeLibrary="1"
WarningLevel="3"
PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;,pmjni_EXPORTS"
AssemblerListingLocation="Debug"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="../Debug/pmjni.pdb"
/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCResourceCompilerTool"
AdditionalIncludeDirectories="..\pm_common;..\porttime;&quot;C:\Program Files\Java\jdk1.6.0_16\include&quot;;&quot;C:\Program Files\Java\jdk1.6.0_16\include\win32&quot;;"
PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;,pmjni_EXPORTS"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;,pmjni_EXPORTS"
MkTypLibCompatible="FALSE"
TargetEnvironment="1"
GenerateStublessProxies="TRUE"
TypeLibraryName="$(InputName).tlb"
OutputDirectory="$(IntDir)"
HeaderFileName="$(InputName).h"
DLLDataFileName=""
InterfaceIdentifierFileName="$(InputName)_i.c"
ProxyFileName="$(InputName)_p.c"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions=" /STACK:10000000 /machine:I386 /debug"
AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib winmm.lib &quot;C:\Program Files\Java\jdk1.6.0_16\include\..\lib\jvm.lib&quot; "
OutputFile="..\Debug\pmjni.dll"
Version="0.0"
GenerateManifest="TRUE"
LinkIncremental="2"
AdditionalLibraryDirectories=""
ProgramDataBaseFile="..\Debug\pmjni.pdb"
GenerateDebugInformation="TRUE"
ImportLibrary="..\Debug\pmjni.lib"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="pmjni.dir\Release"
ConfigurationType="2"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalOptions=" /Zm1000"
AdditionalIncludeDirectories="..\pm_common;..\porttime;&quot;C:\Program Files\Java\jdk1.6.0_16\include&quot;;&quot;C:\Program Files\Java\jdk1.6.0_16\include\win32&quot;;"
CompileAs="1"
ExceptionHandling="0"
InlineFunctionExpansion="2"
Optimization="2"
RuntimeLibrary="0"
WarningLevel="3"
PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;,pmjni_EXPORTS"
AssemblerListingLocation="Release"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="../Release/pmjni.pdb"
/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCResourceCompilerTool"
AdditionalIncludeDirectories="..\pm_common;..\porttime;&quot;C:\Program Files\Java\jdk1.6.0_16\include&quot;;&quot;C:\Program Files\Java\jdk1.6.0_16\include\win32&quot;;"
PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;,pmjni_EXPORTS"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;,pmjni_EXPORTS"
MkTypLibCompatible="FALSE"
TargetEnvironment="1"
GenerateStublessProxies="TRUE"
TypeLibraryName="$(InputName).tlb"
OutputDirectory="$(IntDir)"
HeaderFileName="$(InputName).h"
DLLDataFileName=""
InterfaceIdentifierFileName="$(InputName)_i.c"
ProxyFileName="$(InputName)_p.c"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions=" /STACK:10000000 /machine:I386"
AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib winmm.lib &quot;C:\Program Files\Java\jdk1.6.0_16\include\..\lib\jvm.lib&quot; "
OutputFile="..\Release\pmjni.dll"
Version="0.0"
GenerateManifest="TRUE"
LinkIncremental="1"
AdditionalLibraryDirectories=""
ProgramDataBaseFile="..\Release\pmjni.pdb"
ImportLibrary="..\Release\pmjni.lib"/>
</Configuration>
</Configurations>
<Files>
<Filter
Name="Source Files"
Filter="">
<File
RelativePath="..\pm_win\pmwin.c">
</File>
<File
RelativePath="..\pm_win\pmwinmm.c">
</File>
<File
RelativePath="..\porttime\ptwinmm.c">
</File>
<File
RelativePath="..\pm_common\pmutil.c">
</File>
<File
RelativePath="..\pm_common\portmidi.c">
</File>
<File
RelativePath="..\pm_java\pmjni\pmjni.c">
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,179 @@
<?xml version="1.0" encoding = "Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="portmidi-dynamic"
ProjectGUID="{7283FAD1-7415-4061-A19A-FF5C7BCE9306}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="portmidi-dynamic.dir\Debug"
ConfigurationType="2"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalOptions=" /Zm1000"
AdditionalIncludeDirectories="C:\Users\rbd\portmedia\portmidi\pm_common;C:\Users\rbd\portmedia\portmidi\porttime;&quot;C:\Program Files\Java\jdk1.6.0_16\include&quot;;&quot;C:\Program Files\Java\jdk1.6.0_16\include\win32&quot;;"
BasicRuntimeChecks="3"
CompileAs="1"
DebugInformationFormat="3"
ExceptionHandling="0"
InlineFunctionExpansion="0"
Optimization="0"
RuntimeLibrary="3"
WarningLevel="3"
PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;,portmidi_dynamic_EXPORTS"
AssemblerListingLocation="Debug"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="C:/Users/rbd/portmedia/portmidi/Debug/portmidi.pdb"
/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCResourceCompilerTool"
AdditionalIncludeDirectories="C:\Users\rbd\portmedia\portmidi\pm_common;C:\Users\rbd\portmedia\portmidi\porttime;&quot;C:\Program Files\Java\jdk1.6.0_16\include&quot;;&quot;C:\Program Files\Java\jdk1.6.0_16\include\win32&quot;;"
PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;,portmidi_dynamic_EXPORTS"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;,portmidi_dynamic_EXPORTS"
MkTypLibCompatible="FALSE"
TargetEnvironment="1"
GenerateStublessProxies="TRUE"
TypeLibraryName="$(InputName).tlb"
OutputDirectory="$(IntDir)"
HeaderFileName="$(InputName).h"
DLLDataFileName=""
InterfaceIdentifierFileName="$(InputName)_i.c"
ProxyFileName="$(InputName)_p.c"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions=" /STACK:10000000 /machine:I386 /debug"
AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib winmm.lib "
OutputFile="C:\Users\rbd\portmedia\portmidi\Debug\portmidi.dll"
Version="0.0"
GenerateManifest="TRUE"
LinkIncremental="2"
AdditionalLibraryDirectories=""
ProgramDataBaseFile="C:\Users\rbd\portmedia\portmidi\Debug\portmidi.pdb"
GenerateDebugInformation="TRUE"
ImportLibrary="C:\Users\rbd\portmedia\portmidi\Debug\portmidi.lib"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="portmidi-dynamic.dir\Release"
ConfigurationType="2"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalOptions=" /Zm1000"
AdditionalIncludeDirectories="C:\Users\rbd\portmedia\portmidi\pm_common;C:\Users\rbd\portmedia\portmidi\porttime;&quot;C:\Program Files\Java\jdk1.6.0_16\include&quot;;&quot;C:\Program Files\Java\jdk1.6.0_16\include\win32&quot;;"
CompileAs="1"
ExceptionHandling="0"
InlineFunctionExpansion="2"
Optimization="2"
RuntimeLibrary="2"
WarningLevel="3"
PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;,portmidi_dynamic_EXPORTS"
AssemblerListingLocation="Release"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="C:/Users/rbd/portmedia/portmidi/Release/portmidi.pdb"
/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCResourceCompilerTool"
AdditionalIncludeDirectories="C:\Users\rbd\portmedia\portmidi\pm_common;C:\Users\rbd\portmedia\portmidi\porttime;&quot;C:\Program Files\Java\jdk1.6.0_16\include&quot;;&quot;C:\Program Files\Java\jdk1.6.0_16\include\win32&quot;;"
PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;,portmidi_dynamic_EXPORTS"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;,portmidi_dynamic_EXPORTS"
MkTypLibCompatible="FALSE"
TargetEnvironment="1"
GenerateStublessProxies="TRUE"
TypeLibraryName="$(InputName).tlb"
OutputDirectory="$(IntDir)"
HeaderFileName="$(InputName).h"
DLLDataFileName=""
InterfaceIdentifierFileName="$(InputName)_i.c"
ProxyFileName="$(InputName)_p.c"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions=" /STACK:10000000 /machine:I386"
AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib winmm.lib "
OutputFile="C:\Users\rbd\portmedia\portmidi\Release\portmidi.dll"
Version="0.0"
GenerateManifest="TRUE"
LinkIncremental="1"
AdditionalLibraryDirectories=""
ProgramDataBaseFile="C:\Users\rbd\portmedia\portmidi\Release\portmidi.pdb"
ImportLibrary="C:\Users\rbd\portmedia\portmidi\Release\portmidi.lib"/>
</Configuration>
</Configurations>
<Files>
<File
RelativePath="C:\Users\rbd\portmedia\portmidi\pm_common\CMakeLists.txt">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Building Custom Rule C:/Users/rbd/portmedia/portmidi/pm_common/CMakeLists.txt"
CommandLine="&quot;C:\Program Files\CMake 2.6\bin\cmake.exe&quot; -HC:/Users/rbd/portmedia/portmidi -BC:/Users/rbd/portmedia/portmidi --check-stamp-file CMakeFiles/generate.stamp"
AdditionalDependencies="C:\Users\rbd\portmedia\portmidi\pm_common\CMakeLists.txt;&quot;C:\Program Files\CMake 2.6\share\cmake-2.6\Modules\FindJNI.cmake&quot;;C:\Users\rbd\portmedia\portmidi\pm_common\CMakeLists.txt;"
Outputs="CMakeFiles\generate.stamp"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Building Custom Rule C:/Users/rbd/portmedia/portmidi/pm_common/CMakeLists.txt"
CommandLine="&quot;C:\Program Files\CMake 2.6\bin\cmake.exe&quot; -HC:/Users/rbd/portmedia/portmidi -BC:/Users/rbd/portmedia/portmidi --check-stamp-file CMakeFiles/generate.stamp"
AdditionalDependencies="C:\Users\rbd\portmedia\portmidi\pm_common\CMakeLists.txt;&quot;C:\Program Files\CMake 2.6\share\cmake-2.6\Modules\FindJNI.cmake&quot;;C:\Users\rbd\portmedia\portmidi\pm_common\CMakeLists.txt;"
Outputs="CMakeFiles\generate.stamp"/>
</FileConfiguration>
</File>
<Filter
Name="Source Files"
Filter="">
<File
RelativePath="C:\Users\rbd\portmedia\portmidi\pm_win\pmwin.c">
</File>
<File
RelativePath="C:\Users\rbd\portmedia\portmidi\pm_win\pmwinmm.c">
</File>
<File
RelativePath="C:\Users\rbd\portmedia\portmidi\porttime\ptwinmm.c">
</File>
<File
RelativePath="C:\Users\rbd\portmedia\portmidi\pm_common\pmutil.c">
</File>
<File
RelativePath="C:\Users\rbd\portmedia\portmidi\pm_common\portmidi.c">
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,141 @@
<?xml version="1.0" encoding = "Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="portmidi-static"
ProjectGUID="{2985D5DA-D91E-44E0-924B-E612B6AA33F6}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="portmidi-static.dir\Debug"
ConfigurationType="4"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalOptions=" /Zm1000"
AdditionalIncludeDirectories="..\pm_common;..\porttime;&quot;C:\Program Files\Java\jdk1.6.0_16\include&quot;;&quot;C:\Program Files\Java\jdk1.6.0_16\include\win32&quot;;"
BasicRuntimeChecks="3"
CompileAs="1"
DebugInformationFormat="3"
ExceptionHandling="0"
InlineFunctionExpansion="0"
Optimization="0"
RuntimeLibrary="1"
WarningLevel="3"
PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"
AssemblerListingLocation="Debug"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="../Debug/portmidi_s.pdb"
/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCResourceCompilerTool"
AdditionalIncludeDirectories="..\pm_common;..\porttime;&quot;C:\Program Files\Java\jdk1.6.0_16\include&quot;;&quot;C:\Program Files\Java\jdk1.6.0_16\include\win32&quot;;"
PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"
MkTypLibCompatible="FALSE"
TargetEnvironment="1"
GenerateStublessProxies="TRUE"
TypeLibraryName="$(InputName).tlb"
OutputDirectory="$(IntDir)"
HeaderFileName="$(InputName).h"
DLLDataFileName=""
InterfaceIdentifierFileName="$(InputName)_i.c"
ProxyFileName="$(InputName)_p.c"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\Debug\portmidi_s.lib"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="portmidi-static.dir\Release"
ConfigurationType="4"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalOptions=" /Zm1000"
AdditionalIncludeDirectories="..\pm_common;..\porttime;&quot;C:\Program Files\Java\jdk1.6.0_16\include&quot;;&quot;C:\Program Files\Java\jdk1.6.0_16\include\win32&quot;;"
CompileAs="1"
ExceptionHandling="0"
InlineFunctionExpansion="2"
Optimization="2"
RuntimeLibrary="0"
WarningLevel="3"
PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"
AssemblerListingLocation="Release"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="../Release/portmidi_s.pdb"
/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCResourceCompilerTool"
AdditionalIncludeDirectories="..\pm_common;..\porttime;&quot;C:\Program Files\Java\jdk1.6.0_16\include&quot;;&quot;C:\Program Files\Java\jdk1.6.0_16\include\win32&quot;;"
PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"
MkTypLibCompatible="FALSE"
TargetEnvironment="1"
GenerateStublessProxies="TRUE"
TypeLibraryName="$(InputName).tlb"
OutputDirectory="$(IntDir)"
HeaderFileName="$(InputName).h"
DLLDataFileName=""
InterfaceIdentifierFileName="$(InputName)_i.c"
ProxyFileName="$(InputName)_p.c"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\Release\portmidi_s.lib"/>
</Configuration>
</Configurations>
<Files>
<Filter
Name="Source Files"
Filter="">
<File
RelativePath="..\pm_win\pmwin.c">
</File>
<File
RelativePath="..\pm_win\pmwinmm.c">
</File>
<File
RelativePath="..\porttime\ptwinmm.c">
</File>
<File
RelativePath="..\pm_common\pmutil.c">
</File>
<File
RelativePath="..\pm_common\portmidi.c">
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -420,7 +420,7 @@ PMEXPORT PmError Pm_Poll( PortMidiStream *stream )
return pm_errmsg(err);
}
return !Pm_QueueEmpty(midi->queue);
return (PmError) !Pm_QueueEmpty(midi->queue);
}

View File

@ -0,0 +1,20 @@
This code was offered by Aaron Oxford as is. The pm_managed directory contains the code. If you develop a more complete C# wrapper for PortMidi, please consider contributing your code to the project. -RBD
---- from Aaron Oxford ----
I've attached the managed C++ project which I've inserted into my 2005 version of PortMIDI's VS solution. I wouldn't think the functions I've implemented would have changed so it all should still work with the latest version of PM. Obviously you won't want to permanently embed this since it means the whole solution can only be built under VS2005, but it's easy for a VS2005 user to insert the project after the solution is converted or even just build it separately.
Making the managed wrapper turned out to be dead easy in the end (it was more of a battle finding the correct build settings & SDK's and learning to configure VS than anything else). Anyone wanting to use something I've not implemented yet simply needs to add more stubs like this
int Pm_Initialize()
{
::Pm_Initialize();
return 0;
}
to the code. To call from C# it's just a matter of
ManagedPortMIDI mpm = new ManagedPortMIDI();
int err = mpm.Pm_Initialize();
Anyway as the little code example above indicates, the support really is basic and more likely than not to break at the first hint of something unexpected. As I said, I'd be happy to contribute but I don't think there's much to contribute yet. :-)

View File

@ -0,0 +1,40 @@
#include "stdafx.h"
using namespace System;
using namespace System::Reflection;
using namespace System::Runtime::CompilerServices;
using namespace System::Runtime::InteropServices;
using namespace System::Security::Permissions;
//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly:AssemblyTitleAttribute("pm_managed")];
[assembly:AssemblyDescriptionAttribute("")];
[assembly:AssemblyConfigurationAttribute("")];
[assembly:AssemblyCompanyAttribute("Innovative Computer Solutions")];
[assembly:AssemblyProductAttribute("pm_managed")];
[assembly:AssemblyCopyrightAttribute("Copyright (c) Innovative Computer Solutions 2006")];
[assembly:AssemblyTrademarkAttribute("")];
[assembly:AssemblyCultureAttribute("")];
//
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the value or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly:AssemblyVersionAttribute("1.0.*")];
[assembly:ComVisible(false)];
[assembly:CLSCompliantAttribute(true)];
[assembly:SecurityPermission(SecurityAction::RequestMinimum, UnmanagedCode = true)];

View File

@ -0,0 +1,31 @@
========================================================================
DYNAMIC LINK LIBRARY : pm_managed Project Overview
========================================================================
AppWizard has created this pm_managed DLL for you.
This file contains a summary of what you will find in each of the files that
make up your pm_managed application.
pm_managed.vcproj
This is the main project file for VC++ projects generated using an Application Wizard.
It contains information about the version of Visual C++ that generated the file, and
information about the platforms, configurations, and project features selected with the
Application Wizard.
pm_managed.cpp
This is the main DLL source file.
pm_managed.h
This file contains a class declaration.
AssemblyInfo.cpp
Contains custom attributes for modifying assembly metadata.
/////////////////////////////////////////////////////////////////////////////
Other notes:
AppWizard uses "TODO:" to indicate parts of the source code you
should add to or customize.
/////////////////////////////////////////////////////////////////////////////

View File

@ -0,0 +1,5 @@
// stdafx.cpp : source file that includes just the standard includes
// pm_managed.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"

View File

@ -0,0 +1,7 @@
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently,
// but are changed infrequently
#pragma once

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,63 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon placed first or with lowest ID value becomes application icon
LANGUAGE 9, 3
#pragma code_page(1252)
1 ICON "app.ico"
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
"\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@ -0,0 +1,6 @@
// This is the main DLL file.
#include "stdafx.h"
#include "pm_managed.h"

View File

@ -0,0 +1,53 @@
// pm_managed.h
#pragma once
#include "portmidi.h"
using namespace System;
namespace pm_managed {
public ref class MpmDeviceInfo
{
public:
int structVersion;
System::String^ interf; /* underlying MIDI API, e.g. MMSystem or DirectX */
System::String^ name; /* device name, e.g. USB MidiSport 1x1 */
bool input; /* true iff input is available */
bool output; /* true iff output is available */
int opened; /* used by generic PortMidi code to do error checking on arguments */
MpmDeviceInfo(const PmDeviceInfo* info)
{
structVersion = info->structVersion;
input = (info->input != 0);
output = (info->output != 0);
opened = info->opened;
interf = gcnew System::String(info->interf);
name = gcnew System::String(info->name);
}
};
public ref class ManagedPortMIDI
{
public:
int Pm_Initialize()
{
::Pm_Initialize();
return 0;
}
int Pm_CountDevices()
{
return ::Pm_CountDevices();
}
MpmDeviceInfo^ Pm_GetDeviceInfo(int id)
{
return gcnew MpmDeviceInfo(::Pm_GetDeviceInfo(id));
}
};
}

View File

@ -0,0 +1,260 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="pm_managed"
ProjectGUID="{65AABD9A-F5E3-4A30-8BC3-9C732B5447CF}"
RootNamespace="pm_managed"
Keyword="ManagedCProj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)pm_managed\$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="1"
ManagedExtensions="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../pm_common"
PreprocessorDefinitions="WIN32;_DEBUG"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="$(NoInherit) winmm.lib ..\pm_win\Debug\portmidi.lib ..\porttime\Debug\porttime.lib ..\pm_win\Debug\pm_dll.lib"
LinkIncremental="2"
GenerateDebugInformation="true"
AssemblyDebug="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)pm_managed\$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="1"
ManagedExtensions="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
FavorSizeOrSpeed="1"
AdditionalIncludeDirectories="../pm_common"
PreprocessorDefinitions="WIN32;NDEBUG"
RuntimeLibrary="2"
UsePrecompiledHeader="2"
WarningLevel="3"
DebugInformationFormat="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="$(NoInherit) winmm.lib ..\pm_win\Release\portmidi.lib ..\porttime\Release\porttime.lib ..\pm_win\Release\pm_dll.lib"
LinkIncremental="1"
ManifestFile="$(OutDir)\pm_managed.dll.manifest"
GenerateDebugInformation="false"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
OutputManifestFile="$(OutDir)\pm_managed.dll.manifest"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
CommandLine="rem mt.exe manifest Release\pm_managed.dll.manifest -outputresource:Release\pm_managed.dll;2"
/>
</Configuration>
</Configurations>
<References>
<AssemblyReference
RelativePath="System.dll"
AssemblyName="System, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"
/>
<AssemblyReference
RelativePath="System.Data.dll"
AssemblyName="System.Data, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=x86"
/>
<AssemblyReference
RelativePath="System.XML.dll"
AssemblyName="System.Xml, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"
/>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\AssemblyInfo.cpp"
>
</File>
<File
RelativePath=".\pm_managed.cpp"
>
</File>
<File
RelativePath=".\Stdafx.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\pm_managed.h"
>
</File>
<File
RelativePath=".\resource.h"
>
</File>
<File
RelativePath=".\Stdafx.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
<File
RelativePath=".\app.ico"
>
</File>
<File
RelativePath=".\app.rc"
>
</File>
</Filter>
<File
RelativePath=".\ReadMe.txt"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,3 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by app.rc

View File

@ -0,0 +1,127 @@
# pm_dylib
# set the build directory for libraries to be in portmidi, not in
# portmidi/pm_dylib
if(APPLE OR WIN32)
# set the build directory for .dylib libraries
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
# the "archive" output directory says where to put portmidi.lib, the
# static part of the lib/dll pair:
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
# the first time CMake configures, save off CMake's built-in flags
if(NOT DEFAULT_DEBUG_FLAGS)
set(DEFAULT_DEBUG_FLAGS ${CMAKE_C_FLAGS_DEBUG} CACHE
STRING "CMake's default debug flags" FORCE)
set(DEFAULT_RELEASE_FLAGS ${CMAKE_C_FLAGS_RELEASE} CACHE
STRING "CMake's default release flags" FORCE)
else(NOT DEFAULT_DEBUG_FLAGS)
message(STATUS "DEFAULT_DEBUG_FLAGS not nil: " ${DEFAULT_DEBUG_FLAGS})
endif(NOT DEFAULT_DEBUG_FLAGS)
else(APPLE OR WIN32)
set(LINUX_FLAGS "-DPMALSA")
endif(APPLE OR WIN32)
macro(prepend_path RESULT PATH)
set(${RESULT})
foreach(FILE ${ARGN})
list(APPEND ${RESULT} "${PATH}${FILE}")
endforeach(FILE)
endmacro(prepend_path)
set(CMAKE_C_FLAGS_DEBUG
"${DEFAULT_DEBUG_FLAGS} -DPM_CHECK_ERRORS=1 -DDEBUG ${LINUX_FLAGS}"
CACHE STRING "enable extra checks for debugging" FORCE)
set(CMAKE_C_FLAGS_RELEASE "${DEFAULT_RELEASE_FLAGS} ${LINUX_FLAGS}"
CACHE STRING "flags for release version" FORCE)
# first include the appropriate system-dependent file:
if(UNIX)
# add the -g switch for Linux and Mac OS X (not used in Win32)
set (CMAKE_C_FLAGS_DEBUG "-g ${CMAKE_C_FLAGS_DEBUG}"
CACHE STRING "enable extra checks for debugging" FORCE)
if(APPLE)
set(MACSRC pmmacosxcm pmmac readbinaryplist finddefault)
prepend_path(LIBSRC ../pm_mac/ ${MACSRC})
list(APPEND LIBSRC ../porttime/ptmacosx_mach)
include_directories(${CMAKE_OSX_SYSROOT}/Developer/Headers/FlatCarbon)
set(FRAMEWORK_PATH ${CMAKE_OSX_SYSROOT}/System/Library/Frameworks)
set(COREAUDIO_LIB "${FRAMEWORK_PATH}/CoreAudio.framework")
set(COREFOUNDATION_LIB "${FRAMEWORK_PATH}/CoreFoundation.framework")
set(COREMIDI_LIB "${FRAMEWORK_PATH}/CoreMIDI.framework")
set(CORESERVICES_LIB "${FRAMEWORK_PATH}/CoreServices.framework")
set(PM_NEEDED_LIBS ${COREAUDIO_LIB} ${COREFOUNDATION_LIB}
${COREMIDI_LIB} ${CORESERVICES_LIB}
CACHE INTERNAL "")
set(JAVAVM_LIB "${FRAMEWORK_PATH}/JavaVM.framework")
set(JAVA_INCLUDE_PATHS ${JAVAVM_LIB}/Headers)
set(INSTALL_NAME_DIR "/usr/local/lib")
message(STATUS "SYSROOT: " ${CMAKE_OSX_SYSROOT})
else(APPLE)
# LINUX settings...
include(FindJNI)
# message(STATUS "JAVA_JVM_LIB_PATH is " ${JAVA_JVM_LIB_PATH})
# message(STATUS "JAVA_INCLUDE_PATH is " ${JAVA_INCLUDE_PATH})
# note: should use JAVA_JVM_LIB_PATH, but it is not set properly
# note: user might need to set JAVA_INCLUDE_PATH manually
#
# this will probably break on BSD and other Unix systems; the fix
# depends on whether FindJNI can find Java or not. If yes, then
# we should try to rely on automatically set JAVA_INCLUDE_PATH and
# JAVA_INCLUDE_PATH2; if no, then we need to make both JAVA_INCLUDE_PATH
# and JAVA_INCLUDE_PATH2 set by user (will need clear documentation
# because JAVA_INCLUDE_PATH2 is pretty obscure)
set(JAVA_INCLUDE_PATH ${JAVA_INCLUDE_PATH-UNKNOWN}
CACHE STRING "where to find Java SDK include directory")
set(JAVA_INCLUDE_PATHS ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH}/linux)
# libjvm.so is found relative to JAVA_INCLUDE_PATH:
set(JAVAVM_LIB ${JAVA_INCLUDE_PATH}/../jre/lib/i386/client/libjvm.so)
set(LINUXSRC pmlinuxalsa pmlinux finddefault)
prepend_path(LIBSRC ../pm_linux/ ${LINUXSRC})
list(APPEND LIBSRC ../porttime/ptlinux)
set(PM_NEEDED_LIBS pthread asound)
endif(APPLE)
else(UNIX)
if(WIN32)
# /MDd is multithread debug DLL, /MTd is multithread debug
# /MD is multithread DLL, /MT is multithread
include(FindJNI)
# note: should use JAVA_JVM_LIB_PATH, but it is not set properly
set(JAVAVM_LIB ${JAVA_INCLUDE_PATH}/../lib/jvm.lib)
set(JAVA_INCLUDE_PATHS ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})
# message(STATUS "JAVA_INCLUDE_PATHS: " ${JAVA_INCLUDE_PATHS})
set(WINSRC pmwin pmwinmm)
prepend_path(LIBSRC ../pm_win/ ${WINSRC})
list(APPEND LIBSRC ../porttime/ptwinmm)
set(PM_NEEDED_LIBS winmm.lib)
# message(STATUS "JAVAVM_LIB: " ${JAVAVM_LIB})
endif(WIN32)
endif(UNIX)
set(JNI_EXTRA_LIBS ${PM_NEEDED_LIBS} ${JAVAVM_LIB})
# this completes the list of library sources by adding shared code
set(SHARED_FILES pmutil portmidi)
prepend_path(SHARED_PATHS ../pm_common/ ${SHARED_FILES})
list(APPEND LIBSRC ${SHARED_PATHS})
add_library(portmidi-dynamic SHARED ${LIBSRC})
set_target_properties(portmidi-dynamic PROPERTIES OUTPUT_NAME "portmidi")
target_link_libraries(portmidi-dynamic ${PM_NEEDED_LIBS})
# install the libraries (Linux and Mac OS X command line)
if(UNIX)
INSTALL(TARGETS portmidi-dynamic
LIBRARY DESTINATION /usr/local/lib
ARCHIVE DESTINATION /usr/local/lib)
INSTALL(FILES ../pm_common/portmidi.h ../porttime/porttime.h
DESTINATION /usr/local/include)
endif(UNIX)

View File

@ -0,0 +1,11 @@
pm_dylib
The purpose of this directory is to provide a separate CMakeLists.txt
file for building a dynamic link library version of portmidi. This
version (in Windows) is linked using the Multithreaded C Runtime DLL
whereas the static library version in ../pm_common uses the (static)
Multithreaded C Runtime. There's no good reason not to build both
versions of portmidi in ../pm_common, but (the current) Cmake
has the restriction that you must either share compiler flags across
configurations (debug and release) or across targets (static and
dynamic). Here, we need individual settings for all combinations.

View File

@ -0,0 +1,158 @@
<?xml version="1.0" encoding = "Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="portmidi-dynamic"
ProjectGUID="{7283FAD1-7415-4061-A19A-FF5C7BCE9306}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="portmidi-dynamic.dir\Debug"
ConfigurationType="2"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalOptions=" /Zm1000"
AdditionalIncludeDirectories="..\pm_common;..\porttime;"
BasicRuntimeChecks="3"
CompileAs="1"
DebugInformationFormat="3"
ExceptionHandling="0"
InlineFunctionExpansion="0"
Optimization="0"
RuntimeLibrary="3"
WarningLevel="3"
PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;,portmidi_dynamic_EXPORTS"
AssemblerListingLocation="Debug"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="../Debug/portmidi.pdb"
/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCResourceCompilerTool"
AdditionalIncludeDirectories="..\pm_common;..\porttime;"
PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;,portmidi_dynamic_EXPORTS"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;,portmidi_dynamic_EXPORTS"
MkTypLibCompatible="FALSE"
TargetEnvironment="1"
GenerateStublessProxies="TRUE"
TypeLibraryName="$(InputName).tlb"
OutputDirectory="$(IntDir)"
HeaderFileName="$(InputName).h"
DLLDataFileName=""
InterfaceIdentifierFileName="$(InputName)_i.c"
ProxyFileName="$(InputName)_p.c"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions=" /STACK:10000000 /machine:I386 /debug"
AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib winmm.lib "
OutputFile="..\Debug\portmidi.dll"
Version="0.0"
GenerateManifest="TRUE"
LinkIncremental="2"
AdditionalLibraryDirectories=""
ProgramDataBaseFile="..\Debug\portmidi.pdb"
GenerateDebugInformation="TRUE"
ImportLibrary="..\Debug\portmidi.lib"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="portmidi-dynamic.dir\Release"
ConfigurationType="2"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalOptions=" /Zm1000"
AdditionalIncludeDirectories="..\pm_common;..\porttime;"
CompileAs="1"
ExceptionHandling="0"
InlineFunctionExpansion="2"
Optimization="2"
RuntimeLibrary="2"
WarningLevel="3"
PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;,portmidi_dynamic_EXPORTS"
AssemblerListingLocation="Release"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="../Release/portmidi.pdb"
/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCResourceCompilerTool"
AdditionalIncludeDirectories="..\pm_common;..\porttime;"
PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;,portmidi_dynamic_EXPORTS"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;,portmidi_dynamic_EXPORTS"
MkTypLibCompatible="FALSE"
TargetEnvironment="1"
GenerateStublessProxies="TRUE"
TypeLibraryName="$(InputName).tlb"
OutputDirectory="$(IntDir)"
HeaderFileName="$(InputName).h"
DLLDataFileName=""
InterfaceIdentifierFileName="$(InputName)_i.c"
ProxyFileName="$(InputName)_p.c"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions=" /STACK:10000000 /machine:I386"
AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib winmm.lib "
OutputFile="..\Release\portmidi.dll"
Version="0.0"
GenerateManifest="TRUE"
LinkIncremental="1"
AdditionalLibraryDirectories=""
ProgramDataBaseFile="..\Release\portmidi.pdb"
ImportLibrary="..\Release\portmidi.lib"/>
</Configuration>
</Configurations>
<Files>
<Filter
Name="Source Files"
Filter="">
<File
RelativePath="..\pm_win\pmwin.c">
</File>
<File
RelativePath="..\pm_win\pmwinmm.c">
</File>
<File
RelativePath="..\porttime\ptwinmm.c">
</File>
<File
RelativePath="..\pm_common\pmutil.c">
</File>
<File
RelativePath="..\pm_common\portmidi.c">
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,47 @@
# pm_java
if(UNIX)
if(APPLE)
# java not dealt with in CMake -- see pm_mac/pm_mac.xcodeproj
else(APPLE)
# linux
set(JPORTMIDICLASS JPortMidi.class JPortMidiException.class
JPortMidiApi.class)
set(PMDEFAULTSCLASS PmDefaultsFrame.class PmDefaults.class)
prepend_path(JPORTMIDICLASS2 jportmidi/ ${JPORTMIDICLASS})
prepend_path(PMDEFAULTSCLASS2 pmdefaults/ ${PMDEFAULTSCLASS})
set(PMDEFAULTS_ALL_CLASSES ${JPORTMIDICLASS2} ${PMDEFAULTSCLASS2})
# message(STATUS "PMDEFAULTS_ALL_CLASSES is " ${PMDEFAULTS_ALL_CLASSES})
add_custom_command(OUTPUT pmdefaults/PmDefaultsFrame.class
COMMAND javac -classpath . pmdefaults/PmDefaultsFrame.java
MAIN_DEPENDENCY pmdefaults/PmDefaultsFrame.java
DEPENDS pmdefaults/PmDefaults.java
WORKING_DIRECTORY pm_java)
add_custom_command(OUTPUT pmdefaults/PmDefaults.class
COMMAND javac -classpath . pmdefaults/PmDefaults.java
MAIN_DEPENDENCY pmdefaults/PmDefaults.java
DEPENDS pmdefaults/PmDefaultsFrame.java
WORKING_DIRECTORY pm_java)
add_custom_command(OUTPUT ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pmdefaults.jar
COMMAND cp pmdefaults/portmusic_logo.png .
COMMAND jar cmf pmdefaults/manifest.txt pmdefaults.jar
pmdefaults/*.class portmusic_logo.png jportmidi/*.class
COMMAND chmod +x pmdefaults/pmdefaults
COMMAND cp pmdefaults/pmdefaults ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
COMMAND mv pmdefaults.jar ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
COMMAND rm portmusic_logo.png
MAIN_DEPENDENCY pmdefaults/PmDefaults.class
DEPENDS ${PMDEFAULTS_ALL_CLASSES}
WORKING_DIRECTORY pm_java)
add_custom_target(pmdefaults_target ALL
DEPENDS ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pmdefaults.jar)
# message(STATUS "add_custom_target: pmdefaults.jar")
# install the libraries (Linux only)
INSTALL(FILES ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pmdefaults.jar
DESTINATION /usr/share/java)
INSTALL(PROGRAMS ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pmdefaults
DESTINATION /usr/local/bin)
endif(APPLE)
endif(UNIX)
# In windows, use pm_java/make.bat

Binary file not shown.

View File

@ -0,0 +1,48 @@
README.txt
Roger B. Dannenberg
16 Jun 2009
This directory was created to implement PmDefaults, a program to
set default input and output devices for PortMidi applications.
There are three main sub-projects here:
1) pmjni -- a JNI (Java Native Interface) to access PortMidi
2) jportmidi -- a Java class to access PortMidi (uses pmjni)
3) pmdefaults -- the PmDefaults application (uses jportmidi)
For Mac OS X, you should build the PmDefaults application in Xcode.
For Win32, an installer for PmDefaults is included in setup/.
To build from sources, you should first build everything including
the portmidi dll (that will be used by the Java application) using
Visual C++ and a provided .sln file in the portmidi home directory.
Then, run make.bat in this directory. The subdirectory win32 will be
created with the application pmdefaults.exe. You can run this application
in the normal way. To move the application, you need to copy *everything*
in win32. To build setup/pmdefaults-setup.exe, I have used both
Setup Generator from Gentee software and Inno Setup from jrsoftware.org.
A script for Inno Setup is included in this directory, but since paths
seem to be absolute, you will have to adjust the paths in the script
before you use it.
---- implementation notes ----
For windows, we use the free software JavaExe.exe. The copy here was
downloaded from
http://software.techrepublic.com.com/abstract.aspx?kw=javaexe&docid=767485
I found this page by visiting http://software.techrepublic.com.com and
searching in the "Software" category for "JavaExe"
JavaExe works by placing the JavaExe.exe file in the directory with the
Java application jar file and then *renaming* JavaExe.exe to the name
of the jar file, but keeping the .exe extension. (See make.bat for this
step.) Documentation for JavaExe can be obtained by downloading the
whole program from the URL(s) above.

Binary file not shown.

View File

@ -0,0 +1,539 @@
package jportmidi;
/* PortMidi is a general class intended for any Java program using
the PortMidi library. It encapsulates JPortMidiApi with a more
object-oriented interface. A single PortMidi object can manage
up to one input stream and one output stream.
This class is not safely callable from multiple threads. It
is the client's responsibility to periodically call the Poll
method which checks for midi input and handles it.
*/
import jportmidi.*;
import jportmidi.JPortMidiApi.*;
public class JPortMidi {
// timecode to send message immediately
public final int NOW = 0;
// midi codes
public final int MIDI_NOTE_OFF = 0x80;
public final int MIDI_NOTE_ON = 0x90;
public final int CTRL_ALL_OFF = 123;
public final int MIDI_PITCH_BEND = 0xE0;
public final int MIDI_CLOCK = 0xF8;
public final int MIDI_CONTROL = 0xB0;
public final int MIDI_PROGRAM = 0xC0;
public final int MIDI_START = 0xFA;
public final int MIDI_STOP = 0xFC;
public final int MIDI_POLY_TOUCH = 0xA0;
public final int MIDI_TOUCH = 0xD0;
// error code -- cannot refresh device list while stream is open:
public final int pmStreamOpen = -5000;
public final int pmOutputNotOpen = -4999;
// access to JPortMidiApi is through a single, global instance
private static JPortMidiApi pm;
// a reference count tracks how many objects have it open
private static int pmRefCount = 0;
private static int openCount = 0;
public int error; // user can check here for error codes
private PortMidiStream input;
private PortMidiStream output;
private PmEvent buffer;
protected int timestamp; // remember timestamp from incoming messages
protected boolean trace = false; // used to print midi msgs for debugging
public JPortMidi() throws JPortMidiException {
if (pmRefCount == 0) {
pm = new JPortMidiApi();
pmRefCount++;
System.out.println("Calling Pm_Initialize");
checkError(pm.Pm_Initialize());
System.out.println("Called Pm_Initialize");
}
buffer = new PmEvent();
}
public boolean getTrace() { return trace; }
// set the trace flag and return previous value
public boolean setTrace(boolean flag) {
boolean previous = trace;
trace = flag;
return previous;
}
// WARNING: you must not call this if any devices are open
public void refreshDeviceLists()
throws JPortMidiException
{
if (openCount > 0) {
throw new JPortMidiException(pmStreamOpen,
"RefreshDeviceLists called while stream is open");
}
checkError(pm.Pm_Terminate());
checkError(pm.Pm_Initialize());
}
// there is no control over when/whether this is called, but it seems
// to be a good idea to close things when this object is collected
public void finalize() {
if (input != null) {
error = pm.Pm_Close(input);
}
if (input != null) {
int rslt = pm.Pm_Close(output);
// we may lose an error code from closing output, but don't
// lose any real error from closing input...
if (error == pm.pmNoError) error = rslt;
}
pmRefCount--;
if (pmRefCount == 0) {
error = pm.Pm_Terminate();
}
}
int checkError(int err) throws JPortMidiException
{
// note that Pm_Read and Pm_Write return positive result values
// which are not errors, so compare with >=
if (err >= pm.pmNoError) return err;
if (err == pm.pmHostError) {
throw new JPortMidiException(err, pm.Pm_GetHostErrorText());
} else {
throw new JPortMidiException(err, pm.Pm_GetErrorText(err));
}
}
// ******** ACCESS TO TIME ***********
public void timeStart(int resolution) throws JPortMidiException {
checkError(pm.Pt_TimeStart(resolution));
}
public void timeStop() throws JPortMidiException {
checkError(pm.Pt_TimeStop());
}
public int timeGet() {
return pm.Pt_Time();
}
public boolean timeStarted() {
return pm.Pt_TimeStarted();
}
// ******* QUERY DEVICE INFORMATION *********
public int countDevices() throws JPortMidiException {
return checkError(pm.Pm_CountDevices());
}
public int getDefaultInputDeviceID() throws JPortMidiException {
return checkError(pm.Pm_GetDefaultInputDeviceID());
}
public int getDefaultOutputDeviceID() throws JPortMidiException {
return checkError(pm.Pm_GetDefaultOutputDeviceID());
}
public String getDeviceInterf(int i) {
return pm.Pm_GetDeviceInterf(i);
}
public String getDeviceName(int i) {
return pm.Pm_GetDeviceName(i);
}
public boolean getDeviceInput(int i) {
return pm.Pm_GetDeviceInput(i);
}
public boolean getDeviceOutput(int i) {
return pm.Pm_GetDeviceOutput(i);
}
// ********** MIDI INTERFACE ************
public boolean isOpenInput() {
return input != null;
}
public void openInput(int inputDevice, int bufferSize)
throws JPortMidiException
{
openInput(inputDevice, "", bufferSize);
}
public void openInput(int inputDevice, String inputDriverInfo, int bufferSize)
throws JPortMidiException
{
if (isOpenInput()) pm.Pm_Close(input);
else input = new PortMidiStream();
if (trace) {
System.out.println("openInput " + getDeviceName(inputDevice));
}
checkError(pm.Pm_OpenInput(input, inputDevice,
inputDriverInfo, bufferSize));
// if no exception, then increase count of open streams
openCount++;
}
public boolean isOpenOutput() {
return output != null;
}
public void openOutput(int outputDevice, int bufferSize, int latency)
throws JPortMidiException
{
openOutput(outputDevice, "", bufferSize, latency);
}
public void openOutput(int outputDevice, String outputDriverInfo,
int bufferSize, int latency) throws JPortMidiException {
if (isOpenOutput()) pm.Pm_Close(output);
else output = new PortMidiStream();
if (trace) {
System.out.println("openOutput " + getDeviceName(outputDevice));
}
checkError(pm.Pm_OpenOutput(output, outputDevice, outputDriverInfo,
bufferSize, latency));
// if no exception, then increase count of open streams
openCount++;
}
public void setFilter(int filters) throws JPortMidiException {
if (input == null) return; // no effect if input not open
checkError(pm.Pm_SetFilter(input, filters));
}
public void setChannelMask(int mask) throws JPortMidiException {
if (input == null) return; // no effect if input not open
checkError(pm.Pm_SetChannelMask(input, mask));
}
public void abort() throws JPortMidiException {
if (output == null) return; // no effect if output not open
checkError(pm.Pm_Abort(output));
}
// In keeping with the idea that this class represents an input and output,
// there are separate Close methods for input and output streams, avoiding
// the need for clients to ever deal directly with a stream object
public void closeInput() throws JPortMidiException {
if (input == null) return; // no effect if input not open
checkError(pm.Pm_Close(input));
input = null;
openCount--;
}
public void closeOutput() throws JPortMidiException {
if (output == null) return; // no effect if output not open
checkError(pm.Pm_Close(output));
output = null;
openCount--;
}
// Poll should be called by client to process input messages (if any)
public void poll() throws JPortMidiException {
if (input == null) return; // does nothing until input is opened
while (true) {
int rslt = pm.Pm_Read(input, buffer);
checkError(rslt);
if (rslt == 0) return; // no more messages
handleMidiIn(buffer);
}
}
public void writeShort(int when, int msg) throws JPortMidiException {
if (output == null)
throw new JPortMidiException(pmOutputNotOpen,
"Output stream not open");
if (trace) {
System.out.println("writeShort: " + Integer.toHexString(msg));
}
checkError(pm.Pm_WriteShort(output, when, msg));
}
public void writeSysEx(int when, byte msg[]) throws JPortMidiException {
if (output == null)
throw new JPortMidiException(pmOutputNotOpen,
"Output stream not open");
if (trace) {
System.out.print("writeSysEx: ");
for (int i = 0; i < msg.length; i++) {
System.out.print(Integer.toHexString(msg[i]));
}
System.out.print("\n");
}
checkError(pm.Pm_WriteSysEx(output, when, msg));
}
public int midiChanMessage(int chan, int status, int data1, int data2) {
return (((data2 << 16) & 0xFF0000) |
((data1 << 8) & 0xFF00) |
(status & 0xF0) |
(chan & 0xF));
}
public int midiMessage(int status, int data1, int data2) {
return ((((data2) << 16) & 0xFF0000) |
(((data1) << 8) & 0xFF00) |
((status) & 0xFF));
}
public void midiAllOff(int channel) throws JPortMidiException {
midiAllOff(channel, NOW);
}
public void midiAllOff(int chan, int when) throws JPortMidiException {
writeShort(when, midiChanMessage(chan, MIDI_CONTROL, CTRL_ALL_OFF, 0));
}
public void midiPitchBend(int chan, int value) throws JPortMidiException {
midiPitchBend(chan, value, NOW);
}
public void midiPitchBend(int chan, int value, int when)
throws JPortMidiException {
writeShort(when,
midiChanMessage(chan, MIDI_PITCH_BEND, value, value >> 7));
}
public void midiClock() throws JPortMidiException {
midiClock(NOW);
}
public void midiClock(int when) throws JPortMidiException {
writeShort(when, midiMessage(MIDI_CLOCK, 0, 0));
}
public void midiControl(int chan, int control, int value)
throws JPortMidiException {
midiControl(chan, control, value, NOW);
}
public void midiControl(int chan, int control, int value, int when)
throws JPortMidiException {
writeShort(when, midiChanMessage(chan, MIDI_CONTROL, control, value));
}
public void midiNote(int chan, int pitch, int vel)
throws JPortMidiException {
midiNote(chan, pitch, vel, NOW);
}
public void midiNote(int chan, int pitch, int vel, int when)
throws JPortMidiException {
writeShort(when, midiChanMessage(chan, MIDI_NOTE_ON, pitch, vel));
}
public void midiProgram(int chan, int program)
throws JPortMidiException {
midiProgram(chan, program, NOW);
}
public void midiProgram(int chan, int program, int when)
throws JPortMidiException {
writeShort(when, midiChanMessage(chan, MIDI_PROGRAM, program, 0));
}
public void midiStart()
throws JPortMidiException {
midiStart(NOW);
}
public void midiStart(int when)
throws JPortMidiException {
writeShort(when, midiMessage(MIDI_START, 0, 0));
}
public void midiStop()
throws JPortMidiException {
midiStop(NOW);
}
public void midiStop(int when)
throws JPortMidiException {
writeShort(when, midiMessage(MIDI_STOP, 0, 0));
}
public void midiPolyTouch(int chan, int key, int value)
throws JPortMidiException {
midiPolyTouch(chan, key, value, NOW);
}
public void midiPolyTouch(int chan, int key, int value, int when)
throws JPortMidiException {
writeShort(when, midiChanMessage(chan, MIDI_POLY_TOUCH, key, value));
}
public void midiTouch(int chan, int value)
throws JPortMidiException {
midiTouch(chan, value, NOW);
}
public void midiTouch(int chan, int value, int when)
throws JPortMidiException {
writeShort(when, midiChanMessage(chan, MIDI_TOUCH, value, 0));
}
// ****** now we implement the message handlers ******
// an array for incoming sysex messages that can grow.
// The downside is that after getting a message, we
private byte sysexBuffer[] = null;
private int sysexBufferIndex = 0;
void sysexBufferReset() {
sysexBufferIndex = 0;
if (sysexBuffer == null) sysexBuffer = new byte[256];
}
void sysexBufferCheck() {
if (sysexBuffer.length < sysexBufferIndex + 4) {
byte bigger[] = new byte[sysexBuffer.length * 2];
for (int i = 0; i < sysexBufferIndex; i++) {
bigger[i] = sysexBuffer[i];
}
sysexBuffer = bigger;
}
// now we have space to write some bytes
}
// call this to insert Sysex and EOX status bytes
// call sysexBufferAppendBytes to insert anything else
void sysexBufferAppendStatus(byte status) {
sysexBuffer[sysexBufferIndex++] = status;
}
void sysexBufferAppendBytes(int msg, int len) {
for (int i = 0; i < len; i++) {
byte b = (byte) msg;
if ((msg & 0x80) != 0) {
if (b == 0xF7) { // end of sysex
sysexBufferAppendStatus(b);
sysex(sysexBuffer, sysexBufferIndex);
return;
}
// recursively handle embedded real-time messages
PmEvent buffer = new PmEvent();
buffer.timestamp = timestamp;
buffer.message = b;
handleMidiIn(buffer);
} else {
sysexBuffer[sysexBufferIndex++] = b;
}
msg = msg >> 8;
}
}
void sysexBegin(int msg) {
sysexBufferReset(); // start from 0, we have at least 256 bytes now
sysexBufferAppendStatus((byte) (msg & 0xFF)); // first byte is special
sysexBufferAppendBytes(msg >> 8, 3); // process remaining bytes
}
public void handleMidiIn(PmEvent buffer)
{
if (trace) {
System.out.println("handleMidiIn: " +
Integer.toHexString(buffer.message));
}
// rather than pass timestamps to every handler, where typically
// timestamps are ignored, just save the timestamp as a member
// variable where methods can access it if they want it
timestamp = buffer.timestamp;
int status = buffer.message & 0xFF;
if (status < 0x80) {
sysexBufferCheck(); // make enough space
sysexBufferAppendBytes(buffer.message, 4); // process 4 bytes
return;
}
int command = status & 0xF0;
int channel = status & 0x0F;
int data1 = (buffer.message >> 8) & 0xFF;
int data2 = (buffer.message >> 16) & 0xFF;
switch (command) {
case MIDI_NOTE_OFF:
noteOff(channel, data1, data2); break;
case MIDI_NOTE_ON:
if (data2 > 0) {
noteOn(channel, data1, data2); break;
} else {
noteOff(channel, data1);
}
break;
case MIDI_CONTROL:
control(channel, data1, data2); break;
case MIDI_POLY_TOUCH:
polyTouch(channel, data1, data2); break;
case MIDI_TOUCH:
touch(channel, data1); break;
case MIDI_PITCH_BEND:
pitchBend(channel, (data1 + (data2 << 7)) - 8192); break;
case MIDI_PROGRAM:
program(channel, data1); break;
case 0xF0:
switch (channel) {
case 0: sysexBegin(buffer.message); break;
case 1: mtcQuarterFrame(data1);
case 2: songPosition(data1 + (data2 << 7)); break;
case 3: songSelect(data1); break;
case 4: /* unused */ break;
case 5: /* unused */ break;
case 6: tuneRequest(); break;
case 7: sysexBufferAppendBytes(buffer.message, buffer.message); break;
case 8: clock(); break;
case 9: tick(); break;
case 0xA: clockStart(); break;
case 0xB: clockContinue(); break;
case 0xC: clockStop(); break;
case 0xD: /* unused */ break;
case 0xE: activeSense(); break;
case 0xF: reset(); break;
}
}
}
// the value ranges from +8181 to -8192. The interpretation is
// synthesizer dependent. Often the range is +/- one whole step
// (two semitones), but the range is usually adjustable within
// the synthesizer.
void pitchBend(int channel, int value) { return; }
void control(int channel, int control, int value) { return; }
void noteOn(int channel, int pitch, int velocity) { return; }
// you can handle velocity in note-off if you want, but the default
// is to drop the velocity and call the simpler NoteOff handler
void noteOff(int channel, int pitch, int velocity) {
noteOff(channel, pitch);
}
// if the subclass wants to implement NoteOff with velocity, it
// should override the following to make sure all NoteOffs are handled
void noteOff(int channel, int pitch) { return; }
void program(int channel, int program) { return; }
// the byte array may be bigger than the message, length tells how
// many bytes in the array are part of the message
void sysex(byte[] msg, int length) { return; }
void polyTouch(int channel, int key, int value) { return; }
void touch(int channel, int value) { return; }
void mtcQuarterFrame(int value) { return; }
// the value is a 14-bit integer representing 16th notes
void songPosition(int value) { return; }
void songSelect(int value) { return; }
void tuneRequest() { return; }
void clock() { return; } // represents 1/24th of a quarter note
void tick() { return; } // represents 10ms
void clockStart() { return; }
void clockStop() { return; }
void clockContinue() { return; }
void activeSense() { return; }
void reset() { return; }
}

View File

@ -0,0 +1,117 @@
package jportmidi;
public class JPortMidiApi {
public static class PortMidiStream {
private long address;
}
public static class PmEvent {
public int message;
public int timestamp;
}
// PmError bindings
public final int pmNoError = 0;
public final int pmNoData = 0;
public final int pmGotData = -1;
public final int pmHostError = -10000;
public final int pmInvalidDeviceId = -9999;
public final int pmInsufficientMemory = -9998;
public final int pmBufferTooSmall = -9997;
public final int pmBufferOverflow = -9996;
public final int pmBadPtr = -9995;
public final int pmBadData = -9994;
public final int pmInternalError = -9993;
public final int pmBufferMaxSize = -9992;
static public native int Pm_Initialize();
static public native int Pm_Terminate();
static public native int Pm_HasHostError(PortMidiStream stream);
static public native String Pm_GetErrorText(int errnum);
static public native String Pm_GetHostErrorText();
final int pmNoDevice = -1;
static public native int Pm_CountDevices();
static public native int Pm_GetDefaultInputDeviceID();
static public native int Pm_GetDefaultOutputDeviceID();
static public native String Pm_GetDeviceInterf(int i);
static public native String Pm_GetDeviceName(int i);
static public native boolean Pm_GetDeviceInput(int i);
static public native boolean Pm_GetDeviceOutput(int i);
static public native int Pm_OpenInput(PortMidiStream stream,
int inputDevice,
String inputDriverInfo,
int bufferSize);
static public native int Pm_OpenOutput(PortMidiStream stream,
int outputDevice,
String outnputDriverInfo,
int bufferSize,
int latency);
final static public int PM_FILT_ACTIVE = (1 << 0x0E);
final static public int PM_FILT_SYSEX = (1 << 0x00);
final static public int PM_FILT_CLOCK = (1 << 0x08);
final static public int PM_FILT_PLAY =
(1 << 0x0A) | (1 << 0x0C) | (1 << 0x0B);
final static public int PM_FILT_TICK = (1 << 0x09);
final static public int PM_FILT_FD = (1 << 0x0D);
final static public int PM_FILT_UNDEFINED = PM_FILT_FD;
final static public int PM_FILT_RESET = (1 << 0x0F);
final static public int PM_FILT_REALTIME =
PM_FILT_ACTIVE | PM_FILT_SYSEX | PM_FILT_CLOCK;
final static public int PM_FILT_NOTE = (1 << 0x19) | (1 << 0x18);
final static public int PM_FILT_CHANNEL_AFTERTOUCH = (1 << 0x1D);
final static public int PM_FILT_POLY_AFTERTOUCH = (1 << 0x1A);
final static public int PM_FILT_AFTERTOUCH =
(PM_FILT_CHANNEL_AFTERTOUCH | PM_FILT_POLY_AFTERTOUCH);
final static public int PM_FILT_PROGRAM = (1 << 0x1C);
final static public int PM_FILT_CONTROL = (1 << 0x1B);
final static public int PM_FILT_PITCHBEND = (1 << 0x1E);
final static public int PM_FILT_MTC = (1 << 0x01);
final static public int PM_FILT_SONG_POSITION = (1 << 0x02);
final static public int PM_FILT_SONG_SELECT = (1 << 0x03);
final static public int PM_FILT_TUNE = (1 << 0x06);
final static public int PM_FILT_SYSTEMCOMMON =
(PM_FILT_MTC | PM_FILT_SONG_POSITION |
PM_FILT_SONG_SELECT | PM_FILT_TUNE);
static public native int Pm_SetFilter(PortMidiStream stream, int filters);
static public int Pm_Channel(int channel) { return 1 << channel; }
final static public native int Pm_SetChannelMask(PortMidiStream stream,
int mask);
final static public native int Pm_Abort(PortMidiStream stream);
final static public native int Pm_Close(PortMidiStream stream);
static public int Pm_Message(int status, int data1, int data2) {
return (((data2 << 16) & 0xFF0000) |
((data1 << 8) & 0xFF00) |
(status & 0xFF));
}
static public int Pm_MessageStatus(int msg) {
return msg & 0xFF;
}
static public int Pm_MessageData1(int msg) {
return (msg >> 8) & 0xFF;
}
static public int Pm_MessageData2(int msg) {
return (msg >> 16) & 0xFF;
}
// only supports reading one buffer at a time
static public native int Pm_Read(PortMidiStream stream, PmEvent buffer);
static public native int Pm_Poll(PortMidiStream stream);
// only supports writing one buffer at a time
static public native int Pm_Write(PortMidiStream stream, PmEvent buffer);
static public native int Pm_WriteShort(PortMidiStream stream,
int when, int msg);
static public native int Pm_WriteSysEx(PortMidiStream stream,
int when, byte msg[]);
public final int ptNoError = 0;
public final int ptAlreadyStarted = -10000;
public final int ptAlreadyStopped = -9999;
public final int PtInsufficientMemory = -9998;
static public native int Pt_TimeStart(int resolution);
static public native int Pt_TimeStop();
static public native int Pt_Time();
static public native boolean Pt_TimeStarted();
static {
System.out.println("Loading pmjni");
System.loadLibrary("pmjni");
System.out.println("done loading pmjni");
}
}

View File

@ -0,0 +1,12 @@
// JPortMidiException -- thrown by JPortMidi methods
package jportmidi;
public class JPortMidiException extends Exception {
public int error = 0;
public JPortMidiException(int err, String msg) {
super(msg);
error = err;
}
}

View File

@ -0,0 +1,26 @@
# script to build a jar file to run PmDefaults from the command line on OS X
# (This is for debugging. Normally, you would use XCode to build PmDefaults.app.)
# Compile the java Portidi interface classes.
javac jportmidi/*.java
# Compile the pmdefaults application.
javac -classpath . pmdefaults/*.java
# Temporarily copy the portmusic_logo.png file here to add to the jar file.
cp pmdefaults/portmusic_logo.png .
# Create a directory to hold the distribution.
mkdir mac-osx
# Copy the interface DLL to the distribution directory.
cp ../Release/libpmjni.dylib mac-osx
# Create a java archive (jar) file of the distribution.
jar cmf pmdefaults/manifest.txt mac-osx/pmdefaults.jar pmdefaults/*.class portmusic_logo.png jportmidi/*.class
# Clean up the temporary image file now that it is in the jar file.
rm portmusic_logo.png
echo "You now have a jar file in mac-osx"

View File

@ -0,0 +1,47 @@
@echo off
rem Compile the java PortMidi interface classes.
javac jportmidi/*.java
rem Compile the pmdefaults application.
javac -classpath . pmdefaults/*.java
rem Temporarily copy the portmusic_logo.png file here to add to the jar file.
copy pmdefaults\portmusic_logo.png . > nul
rem Create a directory to hold the distribution.
mkdir win32
rem Attempt to copy the interface DLL to the distribution directory.
if exist "..\release\pmjni.dll" goto have-dll
echo "ERROR: pmjni.dll not found!"
exit /b 1
:have-dll
copy "..\release\pmjni.dll" win32\pmjni.dll > nul
rem Create a java archive (jar) file of the distribution.
jar cmf pmdefaults\manifest.txt win32\pmdefaults.jar pmdefaults\*.class portmusic_logo.png jportmidi\*.class
rem Clean up the temporary image file now that it is in the jar file.
del portmusic_logo.png
rem Copy the java execution code obtained from
rem http://devwizard.free.fr/html/en/JavaExe.html to the distribution
rem directory. The copy also renames the file to our desired executable
rem name.
copy JavaExe.exe win32\pmdefaults.exe > nul
rem Integrate the icon into the executable using UpdateRsrcJavaExe from
rem http://devwizard.free.fr
UpdateRsrcJavaExe -run -exe=win32\pmdefaults.exe -ico=pmdefaults\pmdefaults.ico
rem Copy the 32-bit windows read me file to the distribution directory.
copy pmdefaults\readme-win32.txt win32\README.txt > nul
rem Copy the license file to the distribution directory.
copy pmdefaults\pmdefaults-license.txt win32\license.txt > nul
echo "You can run pmdefaults.exe in win32"

View File

@ -0,0 +1,44 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{5094958B-3CD7-4780-A883-69C9E5B95AEF}
AppName=PmDefaults
AppVerName=PmDefaults
AppPublisher=Roger Dannenberg - Carnegie Mellon University
AppPublisherURL=http://portmedia.sourceforge.net/
AppSupportURL=http://portmedia.sourceforge.net/
AppUpdatesURL=http://portmedia.sourceforge.net/
DefaultDirName={pf}\PmDefaults
DefaultGroupName=PmDefaults
LicenseFile=C:\Users\rbd\portmedia\portmidi\pm_java\win32\license.txt
OutputBaseFilename=setup
SetupIconFile=C:\Users\rbd\portmedia\portmidi\pm_java\pmdefaults\pmdefaults.ico
Compression=lzma
SolidCompression=yes
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "C:\Users\rbd\portmedia\portmidi\pm_java\win32\pmdefaults.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\rbd\portmedia\portmidi\pm_java\win32\pmdefaults.jar"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\rbd\portmedia\portmidi\pm_java\win32\pmjni.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\rbd\portmedia\portmidi\pm_java\win32\license.txt"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{group}\PmDefaults"; Filename: "{app}\pmdefaults.exe"
Name: "{commondesktop}\PmDefaults"; Filename: "{app}\pmdefaults.exe"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\PmDefaults"; Filename: "{app}\pmdefaults.exe"; Tasks: quicklaunchicon
[Run]
Filename: "{app}\pmdefaults.exe"; Description: "{cm:LaunchProgram,PmDefaults}"; Flags: nowait postinstall skipifsilent

View File

@ -0,0 +1,11 @@
// PmDefaults -- a small application to set PortMIDI default input/output
package pmdefaults;
public class PmDefaults {
public static void main(String[] args) {
System.out.println("starting main");
new PmDefaultsFrame("PortMIDI Setup");
}
}

View File

@ -0,0 +1,428 @@
// PmDefaults -- a small application to set PortMIDI default input/output
/* Implementation notes:
This program uses PortMidi to enumerate input and output devices and also
to send output messages to test output devices and
to receive input messages to test input devices.
*/
package pmdefaults;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.lang.Math.*;
import jportmidi.*;
import jportmidi.JPortMidiApi.*;
import java.util.ArrayList;
import java.util.prefs.*;
import java.net.*;
public class PmDefaultsFrame extends JFrame
implements ActionListener, ComponentListener {
// This class extends JPortMidi in order to override midi input handling
// In this case, midi input simply blinks the activity light
public class JPM extends JPortMidi {
ActivityLight light;
PmDefaultsFrame frame;
int lightTime;
boolean lightState;
int now; // current time in ms
final int HALF_BLINK_PERIOD = 250; // ms
public JPM(ActivityLight al, PmDefaultsFrame df)
throws JPortMidiException {
light = al;
frame = df;
lightTime = 0;
lightState = false; // meaning "off"
now = 0;
}
public void poll(int ms) throws JPortMidiException {
// blink the light. lightState is initially false (off).
// to blink the light, set lightState to true and lightTime
// to now + 0.25s; turn on light
// now > ligntTime && lightState => set lightTime = now + 0.25s;
// set lightState = false
// turn off light
// light can be blinked again when now > lightTime && !lightState
now = ms;
if (now > lightTime && lightState) {
lightTime = now + HALF_BLINK_PERIOD;
lightState = false;
light.setState(false);
}
super.poll();
}
public void handleMidiIn(PmEvent buffer) {
System.out.println("midi in: now " + now +
" lightTime " + lightTime +
" lightState " + lightState);
if (now > lightTime && !lightState) {
lightState = true;
lightTime = now + HALF_BLINK_PERIOD;
light.setState(true);
}
}
}
public class ActivityLight extends JPanel {
Color color;
final Color OFF_COLOR = Color.BLACK;
final Color ON_COLOR = Color.GREEN;
ActivityLight() {
super();
Dimension size = new Dimension(50, 25);
setMaximumSize(size);
setPreferredSize(size);
setMinimumSize(size);
color = OFF_COLOR;
System.out.println("ActivityLight " + getSize());
}
public void setState(boolean on) {
color = (on ? ON_COLOR : OFF_COLOR);
repaint();
}
public void paintComponent(Graphics g) {
super.paintComponent(g); // paint background
g.setColor(color);
int x = (getWidth() / 2) - 5;
int y = (getHeight() / 2) - 5;
g.fillOval(x, y, 10, 10);
g.setColor(OFF_COLOR);
g.drawOval(x, y, 10, 10);
}
}
private JLabel inputLabel;
private JComboBox inputSelection;
// inputIds maps from the index of an item in inputSelection to the
// device ID. Used to open the selected device.
private ArrayList<Integer> inputIds;
private ActivityLight inputActivity;
private JLabel outputLabel;
private JComboBox outputSelection;
// analogous to inputIds, outputIds maps selection index to device ID
private ArrayList<Integer> outputIds;
private JButton testButton;
private JButton refreshButton;
private JButton updateButton;
private JButton closeButton;
private JLabel logo;
private JPM jpm;
private Timer timer;
public void componentResized(ComponentEvent e) {
System.out.println(e);
if (e.getComponent() == this) {
Insets insets = getInsets();
Dimension dim = getSize();
layoutComponents(dim.width - insets.left - insets.right,
dim.height - insets.top - insets.bottom);
}
}
public void componentMoved(ComponentEvent e) {
System.out.println(e);
}
public void componentHidden(ComponentEvent e) {
System.out.println(e);
}
public void componentShown(ComponentEvent e) {
System.out.println(e);
}
PmDefaultsFrame(String title) {
super(title);
initComponents();
System.out.println("initComponents returned\n");
pack(); // necessary before calling getInsets();
// initially, only width matters to layout:
layoutComponents(550, 300);
System.out.println("after layout, pref " + getPreferredSize());
// now, based on layout-computed preferredSize, set the Frame size
Insets insets = getInsets();
Dimension dim = getPreferredSize();
dim.width += (insets.left + insets.right);
dim.height += (insets.top + insets.bottom);
setSize(dim);
System.out.println("size" + getPreferredSize());
addComponentListener(this);
timer = new Timer(50 /* ms */, this);
timer.addActionListener(this);
try {
jpm = new JPM(inputActivity, this);
jpm.setTrace(true);
loadDeviceChoices();
timer.start(); // don't start timer if there's an error
} catch(JPortMidiException e) {
System.out.println(e);
}
}
void openInputSelection() {
int id = inputSelection.getSelectedIndex();
if (id < 0) return; // nothing selected
id = (Integer) (inputIds.get(id)); // map to device ID
// openInput will close any previously open input stream
try {
jpm.openInput(id, 100); // buffer size hopes to avoid overflow
} catch(JPortMidiException e) {
System.out.println(e);
}
}
// make a string to put into preferences describing this device
String makePrefName(int id) {
String name = jpm.getDeviceName(id);
String interf = jpm.getDeviceInterf(id);
// the syntax requires comma-space separator (see portmidi.h)
return interf + ", " + name;
}
public void savePreferences() {
Preferences prefs = Preferences.userRoot().node("/PortMidi");
int id = outputSelection.getSelectedIndex();
if (id >= 0) {
String prefName = makePrefName(outputIds.get(id));
System.out.println("output pref: " + prefName);
prefs.put("PM_RECOMMENDED_OUTPUT_DEVICE", prefName);
}
id = inputSelection.getSelectedIndex();
if (id >= 0) {
String prefName = makePrefName(inputIds.get(id));
System.out.println("input pref: " + prefName);
prefs.put("PM_RECOMMENDED_INPUT_DEVICE", prefName);
}
try {
prefs.flush();
} catch(BackingStoreException e) {
System.out.println(e);
}
}
public void actionPerformed(ActionEvent e) {
Object source = e.getSource();
try {
if (source == timer) {
jpm.poll(jpm.timeGet());
} else if (source == refreshButton) {
if (jpm.isOpenInput()) jpm.closeInput();
if (jpm.isOpenOutput()) jpm.closeOutput();
jpm.refreshDeviceLists();
loadDeviceChoices();
} else if (source == updateButton) {
savePreferences();
} else if (source == closeButton) {
if (jpm.isOpenInput()) jpm.closeInput();
if (jpm.isOpenOutput()) jpm.closeOutput();
} else if (source == testButton) {
sendTestMessages();
} else if (source == inputSelection) {
// close previous selection and open new one
openInputSelection();
} else if (source == outputSelection) {
jpm.closeOutput(); // remains closed until Test button reopens
}
} catch(JPortMidiException ex) {
System.out.println(ex);
}
};
private void layoutComponents(int width, int height) {
// I tried to do this with various layout managers, but failed
// It seems pretty straightforward to just compute locations and
// sizes.
int gap = 2; // pixel separation between components
int indent = 20;
int y = gap;
// inputLabel goes in upper left
inputLabel.setLocation(0, y);
inputLabel.setSize(inputLabel.getPreferredSize());
// inputSelection goes below and indented, width based on panel
y += inputLabel.getHeight() + gap;
inputSelection.setLocation(indent, y);
// size of inputSelection must leave room at right for inputButton
// (in fact, inputActivity goes there, but we'll make inputSelection
// and outputSelection the same size, based on leaving room for
// testButton, which is larger than inputActivity.)
Dimension dim = inputSelection.getPreferredSize();
Dimension dimButton = testButton.getPreferredSize();
// make button and selection the same height so they align
dim.height = dimButton.height = Math.max(dim.height, dimButton.height);
// make selection width as wide as possible
dim.width = width - indent - dimButton.width - gap;
inputSelection.setSize(dim);
// inputActivity goes to the right of inputSelection
inputActivity.setLocation(indent + dim.width + gap, y);
// square size to match the height of inputSelection
inputActivity.setSize(dim.height, dim.height);
// outputLabel goes below
y += dim.height + gap;
outputLabel.setLocation(0, y);
outputLabel.setSize(outputLabel.getPreferredSize());
// outputSelection is like inputSelection
y += outputLabel.getHeight() + gap;
outputSelection.setLocation(indent, y);
outputSelection.setSize(dim);
// testButton is like inputActivity
testButton.setLocation(indent + dim.width + gap, y);
testButton.setSize(dimButton);
System.out.println("button " + dimButton + " selection " + dim);
// refreshButton is below
y += dim.height + gap;
dim = refreshButton.getPreferredSize();
refreshButton.setLocation(indent, y);
refreshButton.setSize(dim);
// updateButton to right of refreshButton
int x = indent + dim.width + gap;
updateButton.setLocation(x, y);
dim = updateButton.getPreferredSize();
updateButton.setSize(dim);
// closeButton to right of updateButton
x += dim.width + gap;
closeButton.setLocation(x, y);
dim = closeButton.getPreferredSize();
closeButton.setSize(dim);
// place logo centered at bottom
y += dim.height + gap;
logo.setLocation((width - logo.getWidth()) / 2,
height - gap - logo.getHeight());
// set overall size
y += logo.getHeight() + gap;
System.out.println("computed best size " + width + ", " + y);
setPreferredSize(new Dimension(width, y));
}
private void initComponents() {
Container wholePanel = getContentPane();
wholePanel.setLayout(null);
setLayout(null);
inputLabel = new JLabel();
inputLabel.setText("Default Input");
wholePanel.add(inputLabel);
inputSelection = new JComboBox();
inputSelection.addActionListener(this);
inputSelection.setLocation(20, 30);
inputSelection.setSize(inputSelection.getPreferredSize());
System.out.println("Adding inputSelection to panel");
wholePanel.add(inputSelection);
inputIds = new ArrayList<Integer>();
inputActivity = new ActivityLight();
wholePanel.add(inputActivity);
outputLabel = new JLabel();
outputLabel.setText("Default Output");
wholePanel.add(outputLabel);
outputSelection = new JComboBox();
outputSelection.addActionListener(this);
wholePanel.add(outputSelection);
testButton = new JButton();
testButton.setText("Test");
testButton.addActionListener(this);
wholePanel.add(testButton);
outputIds = new ArrayList<Integer>();
refreshButton = new JButton();
refreshButton.setText("Refresh Device Lists");
System.out.println("refresh " + refreshButton.getPreferredSize());
System.out.println(getLayout());
refreshButton.addActionListener(this);
wholePanel.add(refreshButton);
updateButton = new JButton();
updateButton.setText("Update Preferences");
updateButton.setSize(refreshButton.getPreferredSize());
updateButton.addActionListener(this);
wholePanel.add(updateButton);
closeButton = new JButton();
closeButton.setText("Close/Release Ports");
closeButton.setSize(refreshButton.getPreferredSize());
closeButton.addActionListener(this);
wholePanel.add(closeButton);
// load the logo from the jar file (on Linux and Windows)
ClassLoader cldr = this.getClass().getClassLoader();
ImageIcon icon;
URL logoURL = cldr.getResource("portmusic_logo.png");
if (logoURL == null) {
// on Mac, load from bundle
icon = new ImageIcon("portmusic_logo.png");
} else {
icon = new ImageIcon(logoURL);
}
logo = new JLabel(icon);
logo.setSize(logo.getPreferredSize());
wholePanel.add(logo);
setVisible(true);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
void loadDeviceChoices() throws JPortMidiException {
// initialize and load combo boxes with device descriptions
int n = jpm.countDevices();
inputSelection.removeAllItems();
inputIds.clear();
outputSelection.removeAllItems();
outputIds.clear();
for (int i = 0; i < n; i++) {
String interf = jpm.getDeviceInterf(i);
String name = jpm.getDeviceName(i);
System.out.println("name " + name);
String selection = name + " [" + interf + "]";
if (jpm.getDeviceInput(i)) {
inputIds.add(i);
inputSelection.addItem(selection);
} else {
outputIds.add(i);
outputSelection.addItem(selection);
}
}
}
void sendTestMessages() {
try {
if (!jpm.isOpenOutput()) {
int id = outputSelection.getSelectedIndex();
if (id < 0) return; // nothing selected
id = (Integer) (outputIds.get(id));
System.out.println("calling openOutput");
jpm.openOutput(id, 10, 10);
}
jpm.midiNote(0, 67, 100); // send an A (440)
jpm.midiNote(0, 67, 0, jpm.timeGet() + 500);
} catch(JPortMidiException e) {
System.out.println(e);
}
}
}

View File

@ -0,0 +1,21 @@
README.txt
Roger B. Dannenberg
2 Jan 2009
PmDefaults is a program to set default input and output devices for PortMidi
applications. After running the PmDefaults program and choosing devices,
identifiers for these devices will be returned by
Pm_GetDefaultInputDeviceID() and Pm_GetDefaultOutputDeviceID().
Included in this directory are:
manifest.txt -- used in pmdefaults.jar
pmdefaults-icon.* -- various icons for applications
pmdefaults-license.txt -- a version of portmidi/license.txt formatted for
the windows installer
portmusic_logo.png -- a logo displayed by the pmdefaults application
readme-win32.txt -- this becomes the readme file for the pmdefaults
application. It is copied to win32/README.txt by make.bat
TO BUILD THE APPLICATION: see ../README.txt

View File

@ -0,0 +1 @@
Main-Class: pmdefaults/PmDefaults

View File

@ -0,0 +1 @@
java -jar /usr/share/java/pmdefaults.jar > /dev/null

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

@ -0,0 +1,37 @@
LICENSE INFORMATION
PmDefaults is a small program to set default MIDI input and output
devices for other programs using the PortMidi library.
Latest version available at: http://sourceforge.net/projects/portmedia
Copyright (c) 1999-2000 Ross Bencina and Phil Burk
Copyright (c) 2001-2009 Roger B. Dannenberg
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
The text above constitutes the entire PortMidi license; however,
the PortMusic community also makes the following non-binding requests:
Any person wishing to distribute modifications to the Software is
requested to send the modifications to the original developer so that
they can be incorporated into the canonical version. It is also
requested that these non-binding requests be included along with the
license above.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 753 B

View File

@ -0,0 +1,11 @@
README.txt
Roger B. Dannenberg
1 Jan 2009
This directory contains files that implement:
pmdefaults -- a program to set PortMidi default input/output devices
You can copy and rename this *whole directory* to move the application
to a convenient place. The application to run is pmdefaults.exe.

View File

@ -0,0 +1,293 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class jportmidi_JPortMidiApi */
#ifndef _Included_jportmidi_JPortMidiApi
#define _Included_jportmidi_JPortMidiApi
#ifdef __cplusplus
extern "C" {
#endif
#undef jportmidi_JPortMidiApi_PM_FILT_ACTIVE
#define jportmidi_JPortMidiApi_PM_FILT_ACTIVE 16384L
#undef jportmidi_JPortMidiApi_PM_FILT_SYSEX
#define jportmidi_JPortMidiApi_PM_FILT_SYSEX 1L
#undef jportmidi_JPortMidiApi_PM_FILT_CLOCK
#define jportmidi_JPortMidiApi_PM_FILT_CLOCK 256L
#undef jportmidi_JPortMidiApi_PM_FILT_PLAY
#define jportmidi_JPortMidiApi_PM_FILT_PLAY 7168L
#undef jportmidi_JPortMidiApi_PM_FILT_TICK
#define jportmidi_JPortMidiApi_PM_FILT_TICK 512L
#undef jportmidi_JPortMidiApi_PM_FILT_FD
#define jportmidi_JPortMidiApi_PM_FILT_FD 8192L
#undef jportmidi_JPortMidiApi_PM_FILT_UNDEFINED
#define jportmidi_JPortMidiApi_PM_FILT_UNDEFINED 8192L
#undef jportmidi_JPortMidiApi_PM_FILT_RESET
#define jportmidi_JPortMidiApi_PM_FILT_RESET 32768L
#undef jportmidi_JPortMidiApi_PM_FILT_REALTIME
#define jportmidi_JPortMidiApi_PM_FILT_REALTIME 16641L
#undef jportmidi_JPortMidiApi_PM_FILT_NOTE
#define jportmidi_JPortMidiApi_PM_FILT_NOTE 50331648L
#undef jportmidi_JPortMidiApi_PM_FILT_CHANNEL_AFTERTOUCH
#define jportmidi_JPortMidiApi_PM_FILT_CHANNEL_AFTERTOUCH 536870912L
#undef jportmidi_JPortMidiApi_PM_FILT_POLY_AFTERTOUCH
#define jportmidi_JPortMidiApi_PM_FILT_POLY_AFTERTOUCH 67108864L
#undef jportmidi_JPortMidiApi_PM_FILT_AFTERTOUCH
#define jportmidi_JPortMidiApi_PM_FILT_AFTERTOUCH 603979776L
#undef jportmidi_JPortMidiApi_PM_FILT_PROGRAM
#define jportmidi_JPortMidiApi_PM_FILT_PROGRAM 268435456L
#undef jportmidi_JPortMidiApi_PM_FILT_CONTROL
#define jportmidi_JPortMidiApi_PM_FILT_CONTROL 134217728L
#undef jportmidi_JPortMidiApi_PM_FILT_PITCHBEND
#define jportmidi_JPortMidiApi_PM_FILT_PITCHBEND 1073741824L
#undef jportmidi_JPortMidiApi_PM_FILT_MTC
#define jportmidi_JPortMidiApi_PM_FILT_MTC 2L
#undef jportmidi_JPortMidiApi_PM_FILT_SONG_POSITION
#define jportmidi_JPortMidiApi_PM_FILT_SONG_POSITION 4L
#undef jportmidi_JPortMidiApi_PM_FILT_SONG_SELECT
#define jportmidi_JPortMidiApi_PM_FILT_SONG_SELECT 8L
#undef jportmidi_JPortMidiApi_PM_FILT_TUNE
#define jportmidi_JPortMidiApi_PM_FILT_TUNE 64L
#undef jportmidi_JPortMidiApi_PM_FILT_SYSTEMCOMMON
#define jportmidi_JPortMidiApi_PM_FILT_SYSTEMCOMMON 78L
/*
* Class: jportmidi_JPortMidiApi
* Method: Pm_Initialize
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_jportmidi_JPortMidiApi_Pm_1Initialize
(JNIEnv *, jclass);
/*
* Class: jportmidi_JPortMidiApi
* Method: Pm_Terminate
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_jportmidi_JPortMidiApi_Pm_1Terminate
(JNIEnv *, jclass);
/*
* Class: jportmidi_JPortMidiApi
* Method: Pm_HasHostError
* Signature: (Ljportmidi/JPortMidiApi/PortMidiStream;)I
*/
JNIEXPORT jint JNICALL Java_jportmidi_JPortMidiApi_Pm_1HasHostError
(JNIEnv *, jclass, jobject);
/*
* Class: jportmidi_JPortMidiApi
* Method: Pm_GetErrorText
* Signature: (I)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_jportmidi_JPortMidiApi_Pm_1GetErrorText
(JNIEnv *, jclass, jint);
/*
* Class: jportmidi_JPortMidiApi
* Method: Pm_GetHostErrorText
* Signature: ()Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_jportmidi_JPortMidiApi_Pm_1GetHostErrorText
(JNIEnv *, jclass);
/*
* Class: jportmidi_JPortMidiApi
* Method: Pm_CountDevices
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_jportmidi_JPortMidiApi_Pm_1CountDevices
(JNIEnv *, jclass);
/*
* Class: jportmidi_JPortMidiApi
* Method: Pm_GetDefaultInputDeviceID
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_jportmidi_JPortMidiApi_Pm_1GetDefaultInputDeviceID
(JNIEnv *, jclass);
/*
* Class: jportmidi_JPortMidiApi
* Method: Pm_GetDefaultOutputDeviceID
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_jportmidi_JPortMidiApi_Pm_1GetDefaultOutputDeviceID
(JNIEnv *, jclass);
/*
* Class: jportmidi_JPortMidiApi
* Method: Pm_GetDeviceInterf
* Signature: (I)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_jportmidi_JPortMidiApi_Pm_1GetDeviceInterf
(JNIEnv *, jclass, jint);
/*
* Class: jportmidi_JPortMidiApi
* Method: Pm_GetDeviceName
* Signature: (I)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_jportmidi_JPortMidiApi_Pm_1GetDeviceName
(JNIEnv *, jclass, jint);
/*
* Class: jportmidi_JPortMidiApi
* Method: Pm_GetDeviceInput
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL Java_jportmidi_JPortMidiApi_Pm_1GetDeviceInput
(JNIEnv *, jclass, jint);
/*
* Class: jportmidi_JPortMidiApi
* Method: Pm_GetDeviceOutput
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL Java_jportmidi_JPortMidiApi_Pm_1GetDeviceOutput
(JNIEnv *, jclass, jint);
/*
* Class: jportmidi_JPortMidiApi
* Method: Pm_OpenInput
* Signature: (Ljportmidi/JPortMidiApi/PortMidiStream;ILjava/lang/String;I)I
*/
JNIEXPORT jint JNICALL Java_jportmidi_JPortMidiApi_Pm_1OpenInput
(JNIEnv *, jclass, jobject, jint, jstring, jint);
/*
* Class: jportmidi_JPortMidiApi
* Method: Pm_OpenOutput
* Signature: (Ljportmidi/JPortMidiApi/PortMidiStream;ILjava/lang/String;II)I
*/
JNIEXPORT jint JNICALL Java_jportmidi_JPortMidiApi_Pm_1OpenOutput
(JNIEnv *, jclass, jobject, jint, jstring, jint, jint);
/*
* Class: jportmidi_JPortMidiApi
* Method: Pm_SetFilter
* Signature: (Ljportmidi/JPortMidiApi/PortMidiStream;I)I
*/
JNIEXPORT jint JNICALL Java_jportmidi_JPortMidiApi_Pm_1SetFilter
(JNIEnv *, jclass, jobject, jint);
/*
* Class: jportmidi_JPortMidiApi
* Method: Pm_SetChannelMask
* Signature: (Ljportmidi/JPortMidiApi/PortMidiStream;I)I
*/
JNIEXPORT jint JNICALL Java_jportmidi_JPortMidiApi_Pm_1SetChannelMask
(JNIEnv *, jclass, jobject, jint);
/*
* Class: jportmidi_JPortMidiApi
* Method: Pm_Abort
* Signature: (Ljportmidi/JPortMidiApi/PortMidiStream;)I
*/
JNIEXPORT jint JNICALL Java_jportmidi_JPortMidiApi_Pm_1Abort
(JNIEnv *, jclass, jobject);
/*
* Class: jportmidi_JPortMidiApi
* Method: Pm_Close
* Signature: (Ljportmidi/JPortMidiApi/PortMidiStream;)I
*/
JNIEXPORT jint JNICALL Java_jportmidi_JPortMidiApi_Pm_1Close
(JNIEnv *, jclass, jobject);
/*
* Class: jportmidi_JPortMidiApi
* Method: Pm_Read
* Signature: (Ljportmidi/JPortMidiApi/PortMidiStream;Ljportmidi/JPortMidiApi/PmEvent;)I
*/
JNIEXPORT jint JNICALL Java_jportmidi_JPortMidiApi_Pm_1Read
(JNIEnv *, jclass, jobject, jobject);
/*
* Class: jportmidi_JPortMidiApi
* Method: Pm_Poll
* Signature: (Ljportmidi/JPortMidiApi/PortMidiStream;)I
*/
JNIEXPORT jint JNICALL Java_jportmidi_JPortMidiApi_Pm_1Poll
(JNIEnv *, jclass, jobject);
/*
* Class: jportmidi_JPortMidiApi
* Method: Pm_Write
* Signature: (Ljportmidi/JPortMidiApi/PortMidiStream;Ljportmidi/JPortMidiApi/PmEvent;)I
*/
JNIEXPORT jint JNICALL Java_jportmidi_JPortMidiApi_Pm_1Write
(JNIEnv *, jclass, jobject, jobject);
/*
* Class: jportmidi_JPortMidiApi
* Method: Pm_WriteShort
* Signature: (Ljportmidi/JPortMidiApi/PortMidiStream;II)I
*/
JNIEXPORT jint JNICALL Java_jportmidi_JPortMidiApi_Pm_1WriteShort
(JNIEnv *, jclass, jobject, jint, jint);
/*
* Class: jportmidi_JPortMidiApi
* Method: Pm_WriteSysEx
* Signature: (Ljportmidi/JPortMidiApi/PortMidiStream;I[B)I
*/
JNIEXPORT jint JNICALL Java_jportmidi_JPortMidiApi_Pm_1WriteSysEx
(JNIEnv *, jclass, jobject, jint, jbyteArray);
/*
* Class: jportmidi_JPortMidiApi
* Method: Pt_TimeStart
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_jportmidi_JPortMidiApi_Pt_1TimeStart
(JNIEnv *, jclass, jint);
/*
* Class: jportmidi_JPortMidiApi
* Method: Pt_TimeStop
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_jportmidi_JPortMidiApi_Pt_1TimeStop
(JNIEnv *, jclass);
/*
* Class: jportmidi_JPortMidiApi
* Method: Pt_Time
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_jportmidi_JPortMidiApi_Pt_1Time
(JNIEnv *, jclass);
/*
* Class: jportmidi_JPortMidiApi
* Method: Pt_TimeStarted
* Signature: ()Z
*/
JNIEXPORT jboolean JNICALL Java_jportmidi_JPortMidiApi_Pt_1TimeStarted
(JNIEnv *, jclass);
#ifdef __cplusplus
}
#endif
#endif
/* Header for class jportmidi_JPortMidiApi_PmEvent */
#ifndef _Included_jportmidi_JPortMidiApi_PmEvent
#define _Included_jportmidi_JPortMidiApi_PmEvent
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif
/* Header for class jportmidi_JPortMidiApi_PortMidiStream */
#ifndef _Included_jportmidi_JPortMidiApi_PortMidiStream
#define _Included_jportmidi_JPortMidiApi_PortMidiStream
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,225 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="pmjni"
ProjectGUID="{7AA255C8-48BF-40AC-97BA-F7E7BA4DDAA8}"
RootNamespace="pmjni"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\pm_common&quot;;&quot;$(SolutionDir)\porttime&quot;;&quot;$(ProjectDir)&quot;;&quot;E:\Program Files\Java\jdk1.5.0_14\include&quot;;&quot;E:\Program Files\Java\jdk1.5.0_14\include\win32&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;PMJNI_EXPORTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="winmm.lib"
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\pm_common&quot;;&quot;$(SolutionDir)\porttime&quot;;&quot;$(ProjectDir)&quot;;&quot;E:\Program Files\Java\jdk1.5.0_14\include&quot;;&quot;E:\Program Files\Java\jdk1.5.0_14\include\win32&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;PMJNI_EXPORTS"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="winmm.lib"
LinkIncremental="1"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\pmjni.c"
>
</File>
<File
RelativePath="..\..\pm_common\pmutil.c"
>
</File>
<File
RelativePath="..\..\pm_win\pmwin.c"
>
</File>
<File
RelativePath="..\..\pm_win\pmwinmm.c"
>
</File>
<File
RelativePath="..\..\pm_common\portmidi.c"
>
</File>
<File
RelativePath="..\..\porttime\porttime.c"
>
</File>
<File
RelativePath="..\..\porttime\ptwinmm.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,354 @@
#include "portmidi.h"
#include "porttime.h"
#include "jportmidi_JportMidiApi.h"
#include <stdio.h>
// these macros assume JNIEnv *env is declared and valid:
//
#define CLASS(c, obj) jclass c = (*env)->GetObjectClass(env, obj)
#define ADDRESS_FID(fid, c) \
jfieldID fid = (*env)->GetFieldID(env, c, "address", "J")
// Uses Java Long (64-bit) to make sure there is room to store a
// pointer. Cast this to a C long (either 32 or 64 bit) to match
// the size of a pointer. Finally cast int to pointer. All this
// is supposed to avoid C compiler warnings and (worse) losing
// address bits.
#define PMSTREAM(obj, fid) ((PmStream *) (long) (*env)->GetLongField(env, obj, fid))
// Cast stream to long to convert integer to pointer, then expand
// integer to 64-bit jlong. This avoids compiler warnings.
#define SET_PMSTREAM(obj, fid, stream) \
(*env)->SetLongField(env, obj, fid, (jlong) (long) stream)
/*
* Method: Pm_Initialize
*/
JNIEXPORT jint JNICALL Java_jportmidi_JPortMidiApi_Pm_1Initialize
(JNIEnv *env, jclass cl)
{
return Pm_Initialize();
}
/*
* Method: Pm_Terminate
*/
JNIEXPORT jint JNICALL Java_jportmidi_JPortMidiApi_Pm_1Terminate
(JNIEnv *env, jclass cl)
{
return Pm_Terminate();
}
/*
* Method: Pm_HasHostError
*/
JNIEXPORT jint JNICALL Java_jportmidi_JPortMidiApi_Pm_1HasHostError
(JNIEnv *env, jclass cl, jobject jstream)
{
CLASS(c, jstream);
ADDRESS_FID(fid, c);
return Pm_HasHostError(PMSTREAM(jstream, fid));
}
/*
* Method: Pm_GetErrorText
*/
JNIEXPORT jstring JNICALL Java_jportmidi_JPortMidiApi_Pm_1GetErrorText
(JNIEnv *env, jclass cl, jint i)
{
return (*env)->NewStringUTF(env, Pm_GetErrorText(i));
}
/*
* Method: Pm_GetHostErrorText
*/
JNIEXPORT jstring JNICALL Java_jportmidi_JPortMidiApi_Pm_1GetHostErrorText
(JNIEnv *env, jclass cl)
{
char msg[PM_HOST_ERROR_MSG_LEN];
Pm_GetHostErrorText(msg, PM_HOST_ERROR_MSG_LEN);
return (*env)->NewStringUTF(env, msg);
}
/*
* Method: Pm_CountDevices
*/
JNIEXPORT jint JNICALL Java_jportmidi_JPortMidiApi_Pm_1CountDevices
(JNIEnv *env, jclass cl)
{
return Pm_CountDevices();
}
/*
* Method: Pm_GetDefaultInputDeviceID
*/
JNIEXPORT jint JNICALL Java_jportmidi_JPortMidiApi_Pm_1GetDefaultInputDeviceID
(JNIEnv *env, jclass cl)
{
return Pm_GetDefaultInputDeviceID();
}
/*
* Method: Pm_GetDefaultOutputDeviceID
*/
JNIEXPORT jint JNICALL Java_jportmidi_JPortMidiApi_Pm_1GetDefaultOutputDeviceID
(JNIEnv *env, jclass cl)
{
return Pm_GetDefaultOutputDeviceID();
}
/*
* Method: Pm_GetDeviceInterf
*/
JNIEXPORT jstring JNICALL Java_jportmidi_JPortMidiApi_Pm_1GetDeviceInterf
(JNIEnv *env, jclass cl, jint i)
{
const PmDeviceInfo *info = Pm_GetDeviceInfo(i);
if (!info) return NULL;
return (*env)->NewStringUTF(env, info->interf);
}
/*
* Method: Pm_GetDeviceName
*/
JNIEXPORT jstring JNICALL Java_jportmidi_JPortMidiApi_Pm_1GetDeviceName
(JNIEnv *env, jclass cl, jint i)
{
const PmDeviceInfo *info = Pm_GetDeviceInfo(i);
if (!info) return NULL;
return (*env)->NewStringUTF(env, info->name);
}
/*
* Method: Pm_GetDeviceInput
*/
JNIEXPORT jboolean JNICALL Java_jportmidi_JPortMidiApi_Pm_1GetDeviceInput
(JNIEnv *env, jclass cl, jint i)
{
const PmDeviceInfo *info = Pm_GetDeviceInfo(i);
if (!info) return (jboolean) 0;
return (jboolean) info->input;
}
/*
* Method: Pm_GetDeviceOutput
*/
JNIEXPORT jboolean JNICALL Java_jportmidi_JPortMidiApi_Pm_1GetDeviceOutput
(JNIEnv *env, jclass cl, jint i)
{
const PmDeviceInfo *info = Pm_GetDeviceInfo(i);
if (!info) return (jboolean) 0;
return (jboolean) info->output;
}
/*
* Method: Pm_OpenInput
*/
JNIEXPORT jint JNICALL Java_jportmidi_JPortMidiApi_Pm_1OpenInput
(JNIEnv *env, jclass cl,
jobject jstream, jint index, jstring extras, jint bufsiz)
{
PmError rslt;
PortMidiStream *stream;
CLASS(c, jstream);
ADDRESS_FID(fid, c);
rslt = Pm_OpenInput(&stream, index, NULL, bufsiz, NULL, NULL);
SET_PMSTREAM(jstream, fid, stream);
return rslt;
}
/*
* Method: Pm_OpenOutput
*/
JNIEXPORT jint JNICALL Java_jportmidi_JPortMidiApi_Pm_1OpenOutput
(JNIEnv *env, jclass cl, jobject jstream, jint index, jstring extras,
jint bufsiz, jint latency)
{
PmError rslt;
PortMidiStream *stream;
CLASS(c, jstream);
ADDRESS_FID(fid, c);
rslt = Pm_OpenOutput(&stream, index, NULL, bufsiz, NULL, NULL, latency);
SET_PMSTREAM(jstream, fid, stream);
return rslt;
}
/*
* Method: Pm_SetFilter
*/
JNIEXPORT jint JNICALL Java_jportmidi_JPortMidiApi_Pm_1SetFilter
(JNIEnv *env, jclass cl, jobject jstream, jint filters)
{
CLASS(c, jstream);
ADDRESS_FID(fid, c);
return Pm_SetFilter(PMSTREAM(jstream, fid), filters);
}
/*
* Method: Pm_SetChannelMask
*/
JNIEXPORT jint JNICALL Java_jportmidi_JPortMidiApi_Pm_1SetChannelMask
(JNIEnv *env, jclass cl, jobject jstream, jint mask)
{
CLASS(c, jstream);
ADDRESS_FID(fid, c);
return Pm_SetChannelMask(PMSTREAM(jstream, fid), mask);
}
/*
* Method: Pm_Abort
*/
JNIEXPORT jint JNICALL Java_jportmidi_JPortMidiApi_Pm_1Abort
(JNIEnv *env, jclass cl, jobject jstream)
{
CLASS(c, jstream);
ADDRESS_FID(fid, c);
return Pm_Abort(PMSTREAM(jstream, fid));
}
/*
* Method: Pm_Close
*/
JNIEXPORT jint JNICALL Java_jportmidi_JPortMidiApi_Pm_1Close
(JNIEnv *env, jclass cl, jobject jstream)
{
CLASS(c, jstream);
ADDRESS_FID(fid, c);
return Pm_Close(PMSTREAM(jstream, fid));
}
/*
* Method: Pm_Read
*/
JNIEXPORT jint JNICALL Java_jportmidi_JPortMidiApi_Pm_1Read
(JNIEnv *env, jclass cl, jobject jstream, jobject jpmevent)
{
CLASS(jstream_class, jstream);
ADDRESS_FID(address_fid, jstream_class);
jclass jpmevent_class = (*env)->GetObjectClass(env, jpmevent);
jfieldID message_fid =
(*env)->GetFieldID(env, jpmevent_class, "message", "I");
jfieldID timestamp_fid =
(*env)->GetFieldID(env, jpmevent_class, "timestamp", "I");
PmEvent buffer;
PmError rslt = Pm_Read(PMSTREAM(jstream, address_fid), &buffer, 1);
(*env)->SetIntField(env, jpmevent, message_fid, buffer.message);
(*env)->SetIntField(env, jpmevent, timestamp_fid, buffer.timestamp);
return rslt;
}
/*
* Method: Pm_Poll
*/
JNIEXPORT jint JNICALL Java_jportmidi_JPortMidiApi_Pm_1Poll
(JNIEnv *env, jclass cl, jobject jstream)
{
CLASS(c, jstream);
ADDRESS_FID(fid, c);
return Pm_Poll(PMSTREAM(jstream, fid));
}
/*
* Method: Pm_Write
*/
JNIEXPORT jint JNICALL Java_jportmidi_JPortMidiApi_Pm_1Write
(JNIEnv *env, jclass cl, jobject jstream, jobject jpmevent)
{
CLASS(jstream_class, jstream);
ADDRESS_FID(address_fid, jstream_class);
jclass jpmevent_class = (*env)->GetObjectClass(env, jpmevent);
jfieldID message_fid =
(*env)->GetFieldID(env, jpmevent_class, "message", "I");
jfieldID timestamp_fid =
(*env)->GetFieldID(env, jpmevent_class, "timestamp", "I");
// note that we call WriteShort because it's simpler than constructing
// a buffer and passing it to Pm_Write
return Pm_WriteShort(PMSTREAM(jstream, address_fid),
(*env)->GetIntField(env, jpmevent, timestamp_fid),
(*env)->GetIntField(env, jpmevent, message_fid));
}
/*
* Method: Pm_WriteShort
*/
JNIEXPORT jint JNICALL Java_jportmidi_JPortMidiApi_Pm_1WriteShort
(JNIEnv *env, jclass cl, jobject jstream, jint when, jint msg)
{
CLASS(c, jstream);
ADDRESS_FID(fid, c);
return Pm_WriteShort(PMSTREAM(jstream, fid), when, msg);
}
/*
* Method: Pm_WriteSysEx
*/
JNIEXPORT jint JNICALL Java_jportmidi_JPortMidiApi_Pm_1WriteSysEx
(JNIEnv *env, jclass cl, jobject jstream, jint when, jbyteArray jmsg)
{
CLASS(c, jstream);
ADDRESS_FID(fid, c);
jbyte *bytes = (*env)->GetByteArrayElements(env, jmsg, 0);
PmError rslt = Pm_WriteSysEx(PMSTREAM(jstream, fid), when,
(unsigned char *) bytes);
(*env)->ReleaseByteArrayElements(env, jmsg, bytes, 0);
return rslt;
}
/*
* Method: Pt_TimeStart
*/
JNIEXPORT jint JNICALL Java_jportmidi_JPortMidiApi_Pt_1TimeStart
(JNIEnv *env, jclass c, jint resolution)
{
return Pt_Start(resolution, NULL, NULL);
}
/*
* Method: Pt_TimeStop
*/
JNIEXPORT jint JNICALL Java_jportmidi_JPortMidiApi_Pt_1TimeStop
(JNIEnv *env, jclass c)
{
return Pt_Stop();
}
/*
* Method: Pt_Time
*/
JNIEXPORT jint JNICALL Java_jportmidi_JPortMidiApi_Pt_1Time
(JNIEnv *env, jclass c)
{
return Pt_Time();
}
/*
* Method: Pt_TimeStarted
*/
JNIEXPORT jboolean JNICALL Java_jportmidi_JPortMidiApi_Pt_1TimeStarted
(JNIEnv *env, jclass c)
{
return Pt_Started();
}

View File

@ -0,0 +1,63 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

Binary file not shown.

View File

@ -1,98 +0,0 @@
# MAKEFILE FOR PORTMIDI AND PORTTIME
# NOTE: make should be run from the portmidi directory, but this
# Makefile is in pm_linux, so you should run:
# make -f pm_linux/Makefile
# I suggest putting this command line into a script or alias, e.g.
# do this:
#-----------------
# cd; cd portmidi; cat > m
# make -f pm_linux/Makefile
# <CONTROL-D>
# chmod +x m
#-----------------
# Now you can just type ./m to run make. (the script "m" is not
# part of PortMidi because it is different for OS X and it's so
# simple to create.)
# For debugging, define PM_CHECK_ERRORS
PMFLAGS = -DPM_CHECK_ERRORS
# Otherwise do not define PM_CHECK_ERRORS
# PMFLAGS =
# Use this for linux alsa (0.9x) version
versions = pm_linux/pmlinuxalsa.o
ALSALIB = -lasound
VFLAGS = -DPMALSA
# Use this for null (a dummy implementation for no Midi I/O:
# versions = pmlinuxnull.o
# ALSALIB =
# VFLAGS = -DPMNULL
pmlib = pm_linux/libportmidi.a
ptlib = porttime/libporttime.a
CC = gcc $(VFLAGS) $(PMFLAGS) -g -Ipm_common -Iporttime
pmobjects = pm_common/pmutil.o $(versions) pm_linux/pmlinux.o \
pm_common/portmidi.o
ptobjects = porttime/porttime.o porttime/ptlinux.o
current: all
all: $(pmlib) $(ptlib) pm_test/test pm_test/sysex pm_test/midithread \
pm_test/latency pm_test/midithru pm_test/qtest pm_test/mm
$(pmlib): pm_linux/Makefile $(pmobjects)
ar -cr $(pmlib) $(pmobjects)
$(ptlib): pm_linux/Makefile $(ptobjects)
ar -cr $(ptlib) $(ptobjects)
pm_linux/pmlinuxalsa.o: pm_linux/Makefile pm_linux/pmlinuxalsa.c pm_linux/pmlinuxalsa.h
$(CC) -c pm_linux/pmlinuxalsa.c -o pm_linux/pmlinuxalsa.o
pm_test/test: pm_linux/Makefile pm_test/test.o $(pmlib) $(ptlib)
$(CC) pm_test/test.o -o pm_test/test $(pmlib) $(ptlib) $(ALSALIB)
pm_test/sysex: pm_linux/Makefile pm_test/sysex.o $(pmlib) $(ptlib)
$(CC) pm_test/sysex.o -o pm_test/sysex $(pmlib) $(ptlib) $(ALSALIB)
pm_test/midithread: pm_linux/Makefile pm_test/midithread.o $(pmlib) $(ptlib)
$(CC) pm_test/midithread.o -o pm_test/midithread \
$(pmlib) $(ptlib) $(ALSALIB)
pm_test/latency: pm_linux/Makefile $(ptlib) pm_test/latency.o
$(CC) pm_test/latency.o -o pm_test/latency $(pmlib) $(ptlib) \
$(ALSALIB) -lpthread -lm
pm_test/midithru: pm_linux/Makefile $(ptlib) pm_test/midithru.o
$(CC) pm_test/midithru.o -o pm_test/midithru $(pmlib) $(ptlib) \
$(ALSALIB) -lpthread -lm
pm_test/mm: pm_linux/Makefile $(ptlib) pm_test/mm.o
$(CC) pm_test/mm.o -o pm_test/mm $(pmlib) $(ptlib) \
$(ALSALIB) -lpthread -lm
porttime/ptlinux.o: pm_linux/Makefile porttime/ptlinux.c
$(CC) -c porttime/ptlinux.c -o porttime/ptlinux.o
pm_test/qtest: pm_linux/Makefile pm_test/qtest.o $(pmlib) $(ptlib)
$(CC) pm_test/qtest.o -o pm_test/qtest $(pmlib) $(ptlib) $(ALSALIB)
clean:
rm -f *.o *~ core* */*.o */*.so */*~ */core* pm_test/*/pm_dll.dll
rm -f *.opt *.ncb *.plg pm_win/Debug/pm_dll.lib pm_win/Release/pm_dll.lib
rm -f pm_test/*.opt pm_test/*.ncb
cleaner: clean
cleanest: cleaner
rm -f $(pmlib) $(ptlib) pm_test/test pm_test/sysex pm_test/midithread
rm -f pm_test/latency pm_test/midithru pm_test/qtest pm_test/mm
backup: cleanest
cd ..; zip -r portmidi.zip portmidi

View File

@ -1,6 +1,6 @@
README_LINUX.txt for PortMidi
Roger Dannenberg
14 Oct 2009
6 Dec 2012
Contents:
To make PortMidi
@ -137,6 +137,9 @@ Finally, run make to create
CHANGELOG
6-dec-2012 Roger B. Dannenberg
Copied notes on Autoconf from Audacity sources
22-jan-2010 Roger B. Dannenberg
Updated instructions about Java paths

View File

@ -5,10 +5,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include "portmidi.h"
#include "pmutil.h"
#include "pminternal.h"
#define STRING_MAX 256
@ -30,7 +27,7 @@ int match_string(FILE *inf, char *s)
/*
* Parse preference files, find default device, search devices --
/* Parse preference files, find default device, search devices --
*/
PmDeviceID find_default_device(char *path, int input, PmDeviceID id)
/* path -- the name of the preference we are searching for

View File

@ -201,7 +201,7 @@ static PmError alsa_write_byte(PmInternal *midi, unsigned char byte,
/* compute relative time of event = timestamp - now + latency */
PmTimestamp now = (midi->time_proc ?
midi->time_proc(midi->time_info) :
Pt_Time());
Pt_Time(NULL));
int when = timestamp;
/* if timestamp is zero, send immediately */
/* otherwise compute time delay and use delay if positive */
@ -339,6 +339,7 @@ static PmError alsa_in_close(PmInternal *midi)
pm_hosterror = snd_seq_delete_port(seq, desc->this_port);
}
alsa_unuse_queue();
midi->descriptor = NULL;
pm_free(desc);
if (pm_hosterror) {
get_alsa_error_text(pm_hosterror_text, PM_HOST_ERROR_MSG_LEN,
@ -433,6 +434,7 @@ static PmError alsa_write(PmInternal *midi, PmEvent *buffer, int32_t length)
static PmError alsa_write_flush(PmInternal *midi, PmTimestamp timestamp)
{
alsa_descriptor_type desc = (alsa_descriptor_type) midi->descriptor;
if (!desc) return pmBadPtr;
VERBOSE printf("snd_seq_drain_output: 0x%x\n", (unsigned int) seq);
desc->error = snd_seq_drain_output(seq);
if (desc->error < 0) return pmHostError;
@ -448,6 +450,7 @@ static PmError alsa_write_short(PmInternal *midi, PmEvent *event)
PmMessage msg = event->message;
int i;
alsa_descriptor_type desc = (alsa_descriptor_type) midi->descriptor;
if (!desc) return pmBadPtr;
for (i = 0; i < bytes; i++) {
unsigned char byte = msg;
VERBOSE printf("sending 0x%x\n", byte);
@ -481,6 +484,12 @@ static void handle_event(snd_seq_event_t *ev)
{
int device_id = ev->dest.port;
PmInternal *midi = descriptors[device_id].internalDescriptor;
// There is a race condition when closing a device and
// continuing to poll other open devices. The closed device may
// have outstanding events from before the close operation.
if (!midi) {
return;
}
PmEvent pm_ev;
PmTimeProcPtr time_proc = midi->time_proc;
PmTimestamp timestamp;
@ -650,6 +659,7 @@ static PmError alsa_poll(PmInternal *midi)
static unsigned int alsa_has_host_error(PmInternal *midi)
{
alsa_descriptor_type desc = (alsa_descriptor_type) midi->descriptor;
if (!desc) return 0;
return desc->error;
}
@ -657,6 +667,7 @@ static unsigned int alsa_has_host_error(PmInternal *midi)
static void alsa_get_host_error(PmInternal *midi, char *msg, unsigned int len)
{
alsa_descriptor_type desc = (alsa_descriptor_type) midi->descriptor;
if (!desc) return;
int err = (pm_hosterror || desc->error);
get_alsa_error_text(msg, len, err);
}

View File

@ -3,5 +3,4 @@
PmError pm_linuxalsa_init(void);
void pm_linuxalsa_term(void);
PmDeviceID find_default_device(char *path, int input, PmDeviceID id);

View File

@ -23,12 +23,12 @@ all: $(CONFIG)/CMakeCache.txt
cd $(CONFIG); make
$(CONFIG)/CMakeCache.txt:
rm -f CMakeCache.txt
rm -f $(CONFIG)/CMakeCache.txt
mkdir -p $(CONFIG)
cd $(CONFIG); cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=$(CONFIG)
**** For instructions: make -f pm_mac\Makefile.osx help ****\n'
**** For instructions: make -f pm_mac/Makefile.osx help ****\n'
help:
echo $$'\n\n\
@ -63,6 +63,8 @@ cleaner: clean
rm -f pm_java/pmjni/Release/*.jnilib
cleanest: cleaner
rm -f Debug/CMakeCache.txt Release/CMakeCache.txt
rm -f CMakeCache.txt
rm -f Debug/libportmidi_s.a Release/libportmidi_s.a
rm -f pm_test/Debug/test pm_test/Debug/sysex pm_test/Debug/midithread
rm -f pm_test/Debug/latency pm_test/Debug/midithru

View File

@ -1,7 +1,7 @@
README_MAC.txt for PortMidi
Roger Dannenberg
20 nov 2009
revised 20 Sep 2010 for Xcode 3.2.4 and CMake 8.2-2
revised 20 Sep 2010 for Xcode 4.3.2 and CMake 2.8.8
To build PortMidi for Mac OS X, you must install Xcode and
CMake.
@ -69,7 +69,9 @@ you would normally expect to find it.
==== USING CMAKE TO BUILD Xcode PROJECT ====
Before you can use Xcode, you need a portmidi.xcodeproj file.
Before you can use Xcode, you need a portmidi.xcodeproj file,
and this is created with CMake.
CMake builds a location-dependent Xcode project, so unfortunately
it is not easy to provide an Xcode project that is ready to use.
Therefore, you should make your own. Once you have it, you can
@ -80,7 +82,8 @@ to go back to CMake.
(2) Open portmedia/portmidi/CMakeLists.txt with CMake
(3) Use Configure and Generate buttons
(3) Use Configure and Generate buttons -- for CMAKE_OSX_SYSROOT, use
/Developer/SDKs/MacOSX10.6.sdk (rather than 10.7)
(4) This creates portmedia/portmidi/portmidi.xcodeproj.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="pmdefaults" default="jar" basedir="..">
<!-- Global Properties -->
<property environment="env"/>
<!-- building in Xcode -->
<condition property="product" value="${env.PRODUCT_NAME}">
<isset property="env.PRODUCT_NAME"/>
</condition>
<condition property="src" value="${env.SRCROOT}/src">
<isset property="env.SRCROOT"/>
</condition>
<condition property="obj" value="${env.OBJECT_FILE_DIR}">
<isset property="env.OBJECT_FILE_DIR"/>
</condition>
<condition property="dst" value="${env.BUILT_PRODUCTS_DIR}">
<isset property="env.BUILT_PRODUCTS_DIR"/>
</condition>
<!-- building from the command line -->
<condition property="src" value="src">
<not>
<isset property="src"/>
</not>
</condition>
<condition property="obj" value="build/obj">
<not>
<isset property="obj"/>
</not>
</condition>
<condition property="dst" value="build">
<not>
<isset property="dst"/>
</not>
</condition>
<condition property="product" value="pmdefaults">
<not>
<isset property="product"/>
</not>
</condition>
<!-- Targets -->
<target name="init" description="Create build directories">
<mkdir dir="${obj}/${product}"/>
<mkdir dir="${dst}"/>
</target>
<target name="compile" depends="init" description="Compile">
<javac destdir="${obj}/${product}" deprecation="on" source="1.5" target="1.5" fork="true" debug="true" debuglevel="lines,source">
<src path="${src}/java"/>
<classpath path="${src}/../lib/eawt-stubs.jar"/>
</javac>
</target>
<target name="copy" depends="init" description="Copy resources">
</target>
<target name="jar" depends="compile, copy" description="Assemble Jar file">
<jar jarfile="${dst}/${product}.jar" basedir="${obj}/${product}" manifest="resources/Manifest" index="true"/>
</target>
<target name="install" depends="jar" description="Alias for 'jar'">
<!-- sent by Xcode -->
</target>
<target name="clean" description="Removes build directories">
<!-- sent by Xcode -->
<delete dir="${obj}/${product}"/>
<delete file="${dst}/${product}.jar"/>
</target>
<target name="installhdrs" description="">
<!-- sent by Xcode -->
<echo>"Nothing to do for install-headers phase"</echo>
</target>
</project>

View File

@ -0,0 +1,31 @@
#!/bin/sh
# Prints all class references made by all classes in a Jar file
# Depends on the output formatting of javap
# create a temporary working directory
dir=`mktemp -d $TMPDIR/classrefs.XXXXXX`
asm_dump="$dir/asm_dump"
all_classes="$dir/all_classes"
# for each class in a Jar file, dump the full assembly
javap -c -classpath "$1" `/usr/bin/jar tf "$1" | grep "\.class" | sort | xargs | sed -e 's/\.class//g'` > $asm_dump
# dump the initial list of all classes in the Jar file
/usr/bin/jar tf $1 | grep "\.class" | sed -e 's/\.class//g' >> $all_classes
# dump all static class references
cat $asm_dump | grep //class | awk -F"//class " '{print $2}' | sort | uniq >> $all_classes
# dump all references to classes made in methods
cat $asm_dump | grep //Method | awk -F"//Method " '{print $2}' | sort | uniq | grep "\." | awk -F"." '{print $1}' | sort | uniq >> $all_classes
# dump all references to classes by direct field access
cat $asm_dump | grep //Field | awk -F"//Field " '{print $2}' | sort | uniq | grep "\:L" | awk -F"\:L" '{print $2}' | sort | uniq | awk -F"\;" '{print $1}' >> $all_classes
# sort and reformat
sort $all_classes | uniq | grep -v "\"" | sed -e 's/\//\./g'
# cleanup
rm -rf $dir

View File

@ -0,0 +1,14 @@
{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf320
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
\f0\b\fs24 \cf0 Author:
\b0 \
Roger B. Dannenberg\
\
\b With special thanks to:
\b0 \
National Science Foundation\
}

View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>JavaApplicationStub</string>
<key>CFBundleIconFile</key>
<string>pmdefaults.icns</string>
<key>CFBundleIdentifier</key>
<string></string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>PmDefaults</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>Java</key>
<dict>
<key>ClassPath</key>
<string>$JAVAROOT/pmdefaults.jar</string>
<key>JVMVersion</key>
<string>1.5+</string>
<key>MainClass</key>
<string>pmdefaults.PmDefaults</string>
<key>Properties</key>
<dict>
<key>apple.laf.useScreenMenuBar</key>
<string>true</string>
</dict>
</dict>
</dict>
</plist>

View File

@ -0,0 +1 @@
Main-Class: pmdefaults/PmDefaults

View File

@ -825,8 +825,10 @@ static CFStringRef ConnectedEndpointName(MIDIEndpointRef endpoint)
CFRelease(connections);
}
if (anyStrings)
return result;
return result; // caller should release result
CFRelease(result);
// Here, either the endpoint had no connections, or we failed to obtain names for any of them.
return EndpointName(endpoint, false);
}

View File

@ -0,0 +1,11 @@
README-MINGW.txt -- note on MinGW and PortMidi
Roger Dannenberg
20 Sep 2010
Fabian Rutte writes that CMake can build files for Code::Blocks
under MinGW.
I would guess that a simple Unix Makefile output from CMake would
also work, but I haven't tested it.

File diff suppressed because it is too large Load Diff

View File

@ -1,69 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>PortMidi</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
<dictionary>
<key>org.eclipse.cdt.make.core.contents</key>
<value>org.eclipse.cdt.make.core.activeConfigSettings</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildLocation</key>
<value>${workspace_loc:/PortMidi/Debug}</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
<value>false</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.append_environment</key>
<value>true</value>
</dictionary>
<dictionary>
<key>?name?</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.stopOnError</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildArguments</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildCommand</key>
<value>make</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.core.cnature</nature>
</natures>
</projectDescription>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>PortMidi</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
<dictionary>
<key>org.eclipse.cdt.make.core.contents</key>
<value>org.eclipse.cdt.make.core.activeConfigSettings</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildLocation</key>
<value>${workspace_loc:/PortMidi/Debug}</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
<value>false</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.append_environment</key>
<value>true</value>
</dictionary>
<dictionary>
<key>?name?</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.stopOnError</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildArguments</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildCommand</key>
<value>make</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.core.cnature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,34 @@
PyPortMidi v0.03 03/15/05
Python wrappings for PortMidi
John Harrison
harrison@media.mit.edu
Modified by Roger B. Dannenberg, Nov 2009
PyPortMidi
----------
PyPortMidi is a Python wrapper for PortMidi. PortMidi is a cross-platform
C library for realtime MIDI control. Using PyPortMidi, you can send and
receive MIDI data in realtime from Python.
Besides using PyPortMidi to communicate to synthesizers and the
like, it is possible to use PyPortMidi as a way to send MIDI messages
between software packages on the same computer. For example, Using
PyPortMidi and MIDI-YOKE on a Windows machine, it is possible to send
realtime MIDI messages between programs on the same computer using
loopback virtual MIDI ports. (At this time, MIDI-YOKE does not appear
to run on Windows Vista.)
PyPortMidi is cross-platform, but it will require some small
changes in the setup.py file for it to install correctly on Linux
machines. The changes should be pretty straightforward, and I am
anxious to work with a Linux user on the port.
PyPortMidi works with Python 2.6 and Python 3.1, although the ports
are mostly separate because of various language incompatibilities.
Please see README26.txt for information about the Python 2.6 version.
See README31.txt for information about the Python 3.1 version.

View File

@ -0,0 +1,3 @@
from .midi import *

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,537 @@
# pyPortMidi
# Python bindings for PortMidi
# John Harrison
# http://sound.media.mit.edu/~harrison
# harrison@media.mit.edu
# written in Pyrex
__version__="0.07"
import array
# CHANGES:
# 0.0.5: (June 1st, 2009)
# Output no longer calls abort when it deallocates.
# Added abort and close methods.
# Need to call Abort() explicityly if you want that to happen.
#
# 0.0.3: (March 15, 2005)
# changed everything from tuples to lists
# return 4 values for PmRead instead of 3 (for SysEx)
# minor fixes for flexibility and error checking
# flushed out DistUtils package and added Mac and Linux compile support
# Markus Pfaff: added ability for WriteSysEx to accept lists as well
# as strings
# 0.0.2:
# fixed pointer to function calls to avoid necessity of pyport library
# 0.0.1:
# initial release
cdef extern from "portmidi.h":
ctypedef enum PmError:
pmNoError = 0,
pmHostError = -10000,
pmInvalidDeviceId, #/* out of range or output device when input is requested or vice versa */
pmInsufficientMemory,
pmBufferTooSmall,
pmBufferOverflow,
pmBadPtr,
pmBadData, #/* illegal midi data, e.g. missing EOX */
pmInternalError,
pmBufferMaxSize, #/* buffer is already as large as it can be */
PmError Pm_Initialize()
PmError Pm_Terminate()
ctypedef void PortMidiStream
ctypedef PortMidiStream PmStream # CHECK THIS!
ctypedef int PmDeviceID
int Pm_HasHostError( PortMidiStream * stream )
char *Pm_GetErrorText( PmError errnum )
Pm_GetHostErrorText(char * msg, unsigned int len)
ctypedef struct PmDeviceInfo:
int structVersion
char *interf #/* underlying MIDI API, e.g. MMSystem or DirectX */
char *name #/* device name, e.g. USB MidiSport 1x1 */
int input #/* true iff input is available */
int output #/* true iff output is available */
int opened #/* used by generic PortMidi code to do error checking on arguments */
int Pm_CountDevices()
PmDeviceID Pm_GetDefaultInputDeviceID()
PmDeviceID Pm_GetDefaultOutputDeviceID()
ctypedef long PmTimestamp
ctypedef PmTimestamp (*PmTimeProcPtr)(void *time_info)
#PmBefore is not defined...
PmDeviceInfo* Pm_GetDeviceInfo( PmDeviceID id )
PmError Pm_OpenInput( PortMidiStream** stream,
PmDeviceID inputDevice,
void *inputDriverInfo,
long bufferSize,
long (*PmPtr) (), # long = PtTimestamp
void *time_info )
PmError Pm_OpenOutput( PortMidiStream** stream,
PmDeviceID outputDevice,
void *outputDriverInfo,
long bufferSize,
#long (*PmPtr) (), # long = PtTimestamp
PmTimeProcPtr time_proc, # long = PtTimestamp
void *time_info,
long latency )
PmError Pm_SetFilter( PortMidiStream* stream, long filters )
PmError Pm_Abort( PortMidiStream* stream )
PmError Pm_Close( PortMidiStream* stream )
ctypedef long PmMessage
ctypedef struct PmEvent:
PmMessage message
PmTimestamp timestamp
PmError Pm_Read( PortMidiStream *stream, PmEvent *buffer, long length )
PmError Pm_Poll( PortMidiStream *stream)
int Pm_Channel(int channel)
PmError Pm_SetChannelMask(PortMidiStream *stream, int mask)
PmError Pm_Write( PortMidiStream *stream, PmEvent *buffer, long length )
PmError Pm_WriteSysEx( PortMidiStream *stream, PmTimestamp when, unsigned char *msg)
cdef extern from "porttime.h":
ctypedef enum PtError:
ptNoError = 0,
ptHostError = -10000,
ptAlreadyStarted,
ptAlreadyStopped,
ptInsufficientMemory
ctypedef long PtTimestamp
ctypedef void (* PtCallback)( PtTimestamp timestamp, void *userData )
PtError Pt_Start(int resolution, PtCallback *callback, void *userData)
PtTimestamp Pt_Time()
FILT_ACTIVE=0x1
FILT_SYSEX=0x2
FILT_CLOCK=0x4
FILT_PLAY=0x8
FILT_F9=0x10
FILT_TICK=0x10
FILT_FD=0x20
FILT_UNDEFINED=0x30
FILT_RESET=0x40
FILT_REALTIME=0x7F
FILT_NOTE=0x80
FILT_CHANNEL_AFTERTOUCH=0x100
FILT_POLY_AFTERTOUCH=0x200
FILT_AFTERTOUCH=0x300
FILT_PROGRAM=0x400
FILT_CONTROL=0x800
FILT_PITCHBEND=0x1000
FILT_MTC=0x2000
FILT_SONG_POSITION=0x4000
FILT_SONG_SELECT=0x8000
FILT_TUNE=0x10000
FALSE=0
TRUE=1
def Initialize():
"""
Initialize: call this first
"""
Pm_Initialize()
Pt_Start(1, NULL, NULL) # /* equiv to TIME_START: start timer w/ ms accuracy */
def Terminate():
"""
Terminate: call this to clean up Midi streams when done.
If you do not call this on Windows machines when you are
done with MIDI, your system may crash.
"""
Pm_Terminate()
def GetDefaultInputDeviceID():
return Pm_GetDefaultInputDeviceID()
def GetDefaultOutputDeviceID():
return Pm_GetDefaultOutputDeviceID()
def CountDevices():
return Pm_CountDevices()
def GetDeviceInfo(i):
"""
GetDeviceInfo(<device number>): returns 5 parameters
- underlying MIDI API
- device name
- TRUE iff input is available
- TRUE iff output is available
- TRUE iff device stream is already open
"""
cdef PmDeviceInfo *info
# disregarding the constness from Pm_GetDeviceInfo, since pyrex doesn't do const.
info = <PmDeviceInfo *>Pm_GetDeviceInfo(i)
if info <> NULL: return info.interf, info.name, info.input, info.output, info.opened
else: return
def Time():
"""
Time() returns the current time in ms
of the PortMidi timer
"""
return Pt_Time()
def GetErrorText(err):
"""
GetErrorText(<err num>) returns human-readable error
messages translated from error numbers
"""
return Pm_GetErrorText(err)
def Channel(chan):
"""
Channel(<chan>) is used with ChannelMask on input MIDI streams.
Example: to receive input on channels 1 and 10 on a MIDI
stream called MidiIn:
MidiIn.SetChannelMask(pypm.Channel(1) | pypm.Channel(10))
note: PyPortMidi Channel function has been altered from
the original PortMidi c call to correct for what
seems to be a bug --- i.e. channel filters were
all numbered from 0 to 15 instead of 1 to 16.
"""
return Pm_Channel(chan-1)
cdef class Output:
"""
class Output:
define an output MIDI stream. Takes the form:
x = pypm.Output(MidiOutputDevice, latency)
latency is in ms.
If latency = 0 then timestamps for output are ignored.
"""
cdef int i
cdef PmStream *midi
cdef int debug
cdef int _aborted
def __init__(self, OutputDevice, latency=0):
cdef PmError err
#cdef PtTimestamp (*PmPtr) ()
cdef PmTimeProcPtr PmPtr
self.i = OutputDevice
self.debug = 0
self._aborted = 0
if latency == 0:
PmPtr = NULL
else:
PmPtr = <PmTimeProcPtr>&Pt_Time
if self.debug: print "Opening Midi Output"
# Why is bufferSize 0 here?
err = Pm_OpenOutput(&(self.midi), self.i, NULL, 0, PmPtr, NULL, latency)
if err < 0:
s = Pm_GetErrorText(err)
# Something's amiss here - if we try to throw an Exception
# here, we crash.
if not err == -10000:
raise Exception,s
else:
print "Unable to open Midi OutputDevice=",OutputDevice," err=",s
def __dealloc__(self):
if self.debug: print "Closing MIDI output stream and destroying instance"
#err = Pm_Abort(self.midi)
#if err < 0: raise Exception, Pm_GetErrorText(err)
err = Pm_Close(self.midi)
if err < 0: raise Exception, Pm_GetErrorText(err)
def _check_open(self):
""" checks to see if the midi is open, and if not, raises an error.
"""
if self.midi == NULL:
raise Exception, "midi Output not open."
if self._aborted:
raise Exception, "midi Output aborted. Need to call Close after Abort."
def Close(self):
"""
Close()
closes a midi stream, flushing any pending buffers.
(PortMidi attempts to close open streams when the application
exits -- this is particularly difficult under Windows.)
"""
#if not self.midi:
# return
err = Pm_Close(self.midi)
if err < 0:
raise Exception, Pm_GetErrorText(err)
#self.midi = NULL
def Abort(self):
"""
Abort() terminates outgoing messages immediately
The caller should immediately close the output port;
this call may result in transmission of a partial midi message.
There is no abort for Midi input because the user can simply
ignore messages in the buffer and close an input device at
any time.
"""
#if not self.midi:
# return
err = Pm_Abort(self.midi)
if err < 0:
raise Exception, Pm_GetErrorText(err)
self._aborted = 1
def Write(self, data):
"""
Write(data)
output a series of MIDI information in the form of a list:
Write([[[status <,data1><,data2><,data3>],timestamp],
[[status <,data1><,data2><,data3>],timestamp],...])
<data> fields are optional
example: choose program change 1 at time 20000 and
send note 65 with velocity 100 500 ms later.
Write([[[0xc0,0,0],20000],[[0x90,60,100],20500]])
notes:
1. timestamps will be ignored if latency = 0.
2. To get a note to play immediately, send MIDI info with
timestamp read from function Time.
3. understanding optional data fields:
Write([[[0xc0,0,0],20000]]) is equivalent to
Write([[[0xc0],20000]])
"""
cdef PmEvent buffer[1024]
cdef PmError err
cdef int i
self._check_open()
if len(data) > 1024: raise IndexError, 'maximum list length is 1024'
else:
for loop1 in range(len(data)):
if ((len(data[loop1][0]) > 4) |
(len(data[loop1][0]) < 1)):
raise IndexError, str(len(data[loop1][0]))+' arguments in event list'
buffer[loop1].message = 0
for i in range(len(data[loop1][0])):
buffer[loop1].message = buffer[loop1].message + ((data[loop1][0][i]&0xFF) << (8*i))
buffer[loop1].timestamp = data[loop1][1]
if self.debug: print loop1," : ",buffer[loop1].message," : ",buffer[loop1].timestamp
if self.debug: print "writing to midi buffer"
err= Pm_Write(self.midi, buffer, len(data))
if err < 0: raise Exception, Pm_GetErrorText(err)
def WriteShort(self, status, data1 = 0, data2 = 0):
"""
WriteShort(status <, data1><, data2>)
output MIDI information of 3 bytes or less.
data fields are optional
status byte could be:
0xc0 = program change
0x90 = note on
etc.
data bytes are optional and assumed 0 if omitted
example: note 65 on with velocity 100
WriteShort(0x90,65,100)
"""
cdef PmEvent buffer[1]
cdef PmError err
self._check_open()
buffer[0].timestamp = Pt_Time()
buffer[0].message = ((((data2) << 16) & 0xFF0000) | (((data1) << 8) & 0xFF00) | ((status) & 0xFF))
if self.debug: print "Writing to MIDI buffer"
err = Pm_Write(self.midi, buffer, 1) # stream, buffer, length
if err < 0 : raise Exception, Pm_GetErrorText(err)
def WriteSysEx(self, when, msg):
"""
WriteSysEx(<timestamp>,<msg>)
writes a timestamped system-exclusive midi message.
<msg> can be a *list* or a *string*
example:
(assuming y is an input MIDI stream)
y.WriteSysEx(0,'\\xF0\\x7D\\x10\\x11\\x12\\x13\\xF7')
is equivalent to
y.WriteSysEx(pypm.Time,
[0xF0, 0x7D, 0x10, 0x11, 0x12, 0x13, 0xF7])
"""
cdef PmError err
cdef char *cmsg
cdef PtTimestamp CurTime
self._check_open()
if type(msg) is list:
msg = array.array('B',msg).tostring() # Markus Pfaff contribution
cmsg = msg
CurTime = Pt_Time()
err = Pm_WriteSysEx(self.midi, when, <unsigned char *> cmsg)
if err < 0 : raise Exception, Pm_GetErrorText(err)
while Pt_Time() == CurTime: # wait for SysEx to go thru or...my
pass # win32 machine crashes w/ multiple SysEx
cdef class Input:
"""
class Input:
define an input MIDI stream. Takes the form:
x = pypm.Input(MidiInputDevice)
"""
cdef PmStream *midi
cdef int debug
cdef int i
def __init__(self, InputDevice, buffersize=4096):
cdef PmError err
self.i = InputDevice
self.debug = 0
err= Pm_OpenInput(&(self.midi),self.i,NULL,buffersize,&Pt_Time,NULL)
if err < 0: raise Exception, Pm_GetErrorText(err)
if self.debug: print "MIDI input opened."
def __dealloc__(self):
cdef PmError err
if self.debug: print "Closing MIDI input stream and destroying instance"
err = Pm_Close(self.midi)
if err < 0:
raise Exception, Pm_GetErrorText(err)
def _check_open(self):
""" checks to see if the midi is open, and if not, raises an error.
"""
if self.midi == NULL:
raise Exception, "midi Input not open."
def Close(self):
"""
Close()
closes a midi stream, flushing any pending buffers.
(PortMidi attempts to close open streams when the application
exits -- this is particularly difficult under Windows.)
"""
#if not self.midi:
# return
err = Pm_Close(self.midi)
if err < 0:
raise Exception, Pm_GetErrorText(err)
#self.midi = NULL
def SetFilter(self, filters):
"""
SetFilter(<filters>) sets filters on an open input stream
to drop selected input types. By default, only active sensing
messages are filtered. To prohibit, say, active sensing and
sysex messages, call
SetFilter(stream, FILT_ACTIVE | FILT_SYSEX);
Filtering is useful when midi routing or midi thru functionality
is being provided by the user application.
For example, you may want to exclude timing messages
(clock, MTC, start/stop/continue), while allowing note-related
messages to pass. Or you may be using a sequencer or drum-machine
for MIDI clock information but want to exclude any notes
it may play.
Note: SetFilter empties the buffer after setting the filter,
just in case anything got through.
"""
cdef PmEvent buffer[1]
cdef PmError err
self._check_open()
err = Pm_SetFilter(self.midi, filters)
if err < 0: raise Exception, Pm_GetErrorText(err)
while(Pm_Poll(self.midi) != pmNoError):
err = Pm_Read(self.midi,buffer,1)
if err < 0: raise Exception, Pm_GetErrorText(err)
def SetChannelMask(self, mask):
"""
SetChannelMask(<mask>) filters incoming messages based on channel.
The mask is a 16-bit bitfield corresponding to appropriate channels
Channel(<channel>) can assist in calling this function.
i.e. to set receive only input on channel 1, call with
SetChannelMask(Channel(1))
Multiple channels should be OR'd together, like
SetChannelMask(Channel(10) | Channel(11))
note: PyPortMidi Channel function has been altered from
the original PortMidi c call to correct for what
seems to be a bug --- i.e. channel filters were
all numbered from 0 to 15 instead of 1 to 16.
"""
cdef PmError err
self._check_open()
err = Pm_SetChannelMask(self.midi,mask)
if err < 0: raise Exception, Pm_GetErrorText(err)
def Poll(self):
"""
Poll tests whether input is available,
returning TRUE, FALSE, or an error value.
"""
cdef PmError err
self._check_open()
err = Pm_Poll(self.midi)
if err < 0: raise Exception, Pm_GetErrorText(err)
return err
def Read(self,length):
"""
Read(length): returns up to <length> midi events stored in
the buffer and returns them as a list:
[[[status,data1,data2,data3],timestamp],
[[status,data1,data2,data3],timestamp],...]
example: Read(50) returns all the events in the buffer,
up to 50 events.
"""
cdef PmEvent buffer[1024]
self._check_open()
x = []
if length > 1024: raise IndexError, 'maximum buffer length is 1024'
if length < 1: raise IndexError, 'minimum buffer length is 1'
NumEvents = Pm_Read(self.midi,buffer,length)
if NumEvents < 0: raise Exception, Pm_GetErrorText(NumEvents)
x=[]
if NumEvents >= 1:
for loop in range(NumEvents):
x.append([[buffer[loop].message & 0xff, (buffer[loop].message >> 8) & 0xFF, (buffer[loop].message >> 16) & 0xFF, (buffer[loop].message >> 24) & 0xFF], buffer[loop].timestamp])
return x

View File

@ -0,0 +1,566 @@
"""
Module for interacting with midi input and output.
The midi module can send output to midi devices, and get input
from midi devices. It can also list midi devices on the system.
Including real midi devices, and virtual ones.
It uses the portmidi library. Is portable to which ever platforms
portmidi supports (currently windows, OSX, and linux).
"""
import atexit
_init = False
_pypm = None
__all__ = [ "Input",
"MidiException",
"Output",
"get_count",
"get_default_input_id",
"get_default_output_id",
"get_device_info",
"init",
"quit",
"time",
]
__theclasses__ = ["Input", "Output"]
def init():
"""initialize the midi module
pyportmidi.init(): return None
Call the initialisation function before using the midi module.
It is safe to call this more than once.
"""
global _init, _pypm
if not _init:
import pyportmidi._pyportmidi
_pypm = pyportmidi._pyportmidi
_pypm.Initialize()
_init = True
atexit.register(quit)
def quit():
"""uninitialize the midi module
pyportmidi.quit(): return None
Called automatically atexit if you don't call it.
It is safe to call this function more than once.
"""
global _init, _pypm
if _init:
# TODO: find all Input and Output classes and close them first?
_pypm.Terminate()
_init = False
del _pypm
def _check_init():
if not _init:
raise RuntimeError("pyportmidi not initialised.")
def get_count():
"""gets the number of devices.
pyportmidi.get_count(): return num_devices
Device ids range from 0 to get_count() -1
"""
_check_init()
return _pypm.CountDevices()
def get_default_input_id():
"""gets default input device number
pyportmidi.get_default_input_id(): return default_id
Return the default device ID or -1 if there are no devices.
The result can be passed to the Input()/Ouput() class.
On the PC, the user can specify a default device by
setting an environment variable. For example, to use device #1.
set PM_RECOMMENDED_INPUT_DEVICE=1
The user should first determine the available device ID by using
the supplied application "testin" or "testout".
In general, the registry is a better place for this kind of info,
and with USB devices that can come and go, using integers is not
very reliable for device identification. Under Windows, if
PM_RECOMMENDED_OUTPUT_DEVICE (or PM_RECOMMENDED_INPUT_DEVICE) is
*NOT* found in the environment, then the default device is obtained
by looking for a string in the registry under:
HKEY_LOCAL_MACHINE/SOFTWARE/PortMidi/Recommended_Input_Device
and HKEY_LOCAL_MACHINE/SOFTWARE/PortMidi/Recommended_Output_Device
for a string. The number of the first device with a substring that
matches the string exactly is returned. For example, if the string
in the registry is "USB", and device 1 is named
"In USB MidiSport 1x1", then that will be the default
input because it contains the string "USB".
In addition to the name, get_device_info() returns "interf", which
is the interface name. (The "interface" is the underlying software
system or API used by PortMidi to access devices. Examples are
MMSystem, DirectX (not implemented), ALSA, OSS (not implemented), etc.)
At present, the only Win32 interface is "MMSystem", the only Linux
interface is "ALSA", and the only Max OS X interface is "CoreMIDI".
To specify both the interface and the device name in the registry,
separate the two with a comma and a space, e.g.:
MMSystem, In USB MidiSport 1x1
In this case, the string before the comma must be a substring of
the "interf" string, and the string after the space must be a
substring of the "name" name string in order to match the device.
Note: in the current release, the default is simply the first device
(the input or output device with the lowest PmDeviceID).
"""
return _pypm.GetDefaultInputDeviceID()
def get_default_output_id():
"""gets default output device number
pyportmidi.get_default_output_id(): return default_id
Return the default device ID or -1 if there are no devices.
The result can be passed to the Input()/Ouput() class.
On the PC, the user can specify a default device by
setting an environment variable. For example, to use device #1.
set PM_RECOMMENDED_OUTPUT_DEVICE=1
The user should first determine the available device ID by using
the supplied application "testin" or "testout".
In general, the registry is a better place for this kind of info,
and with USB devices that can come and go, using integers is not
very reliable for device identification. Under Windows, if
PM_RECOMMENDED_OUTPUT_DEVICE (or PM_RECOMMENDED_INPUT_DEVICE) is
*NOT* found in the environment, then the default device is obtained
by looking for a string in the registry under:
HKEY_LOCAL_MACHINE/SOFTWARE/PortMidi/Recommended_Input_Device
and HKEY_LOCAL_MACHINE/SOFTWARE/PortMidi/Recommended_Output_Device
for a string. The number of the first device with a substring that
matches the string exactly is returned. For example, if the string
in the registry is "USB", and device 1 is named
"In USB MidiSport 1x1", then that will be the default
input because it contains the string "USB".
In addition to the name, get_device_info() returns "interf", which
is the interface name. (The "interface" is the underlying software
system or API used by PortMidi to access devices. Examples are
MMSystem, DirectX (not implemented), ALSA, OSS (not implemented), etc.)
At present, the only Win32 interface is "MMSystem", the only Linux
interface is "ALSA", and the only Max OS X interface is "CoreMIDI".
To specify both the interface and the device name in the registry,
separate the two with a comma and a space, e.g.:
MMSystem, In USB MidiSport 1x1
In this case, the string before the comma must be a substring of
the "interf" string, and the string after the space must be a
substring of the "name" name string in order to match the device.
Note: in the current release, the default is simply the first device
(the input or output device with the lowest PmDeviceID).
"""
_check_init()
return _pypm.GetDefaultOutputDeviceID()
def get_device_info(an_id):
""" returns information about a midi device
pyportmidi.get_device_info(an_id): return (interf, name, input, output, opened)
interf - a text string describing the device interface, eg 'ALSA'.
name - a text string for the name of the device, eg 'Midi Through Port-0'
input - 0, or 1 if the device is an input device.
output - 0, or 1 if the device is an output device.
opened - 0, or 1 if the device is opened.
If the id is out of range, the function returns None.
"""
_check_init()
return _pypm.GetDeviceInfo(an_id)
class Input(object):
"""Input is used to get midi input from midi devices.
Input(device_id)
Input(device_id, buffer_size)
buffer_size -the number of input events to be buffered waiting to
be read using Input.read()
"""
def __init__(self, device_id, buffer_size=4096):
"""
The buffer_size specifies the number of input events to be buffered
waiting to be read using Input.read().
"""
_check_init()
if device_id == -1:
raise MidiException("Device id is -1, not a valid output id. -1 usually means there were no default Output devices.")
try:
r = get_device_info(device_id)
except TypeError:
raise TypeError("an integer is required")
except OverflowError:
raise OverflowError("long int too large to convert to int")
# and now some nasty looking error checking, to provide nice error
# messages to the kind, lovely, midi using people of whereever.
if r:
interf, name, input, output, opened = r
if input:
try:
self._input = _pypm.Input(device_id, buffer_size)
except TypeError:
raise TypeError("an integer is required")
self.device_id = device_id
elif output:
raise MidiException("Device id given is not a valid input id, it is an output id.")
else:
raise MidiException("Device id given is not a valid input id.")
else:
raise MidiException("Device id invalid, out of range.")
def _check_open(self):
if self._input is None:
raise MidiException("midi not open.")
def close(self):
""" closes a midi stream, flushing any pending buffers.
Input.close(): return None
PortMidi attempts to close open streams when the application
exits -- this is particularly difficult under Windows.
"""
_check_init()
if not (self._input is None):
self._input.Close()
self._input = None
def read(self, num_events):
"""reads num_events midi events from the buffer.
Input.read(num_events): return midi_event_list
Reads from the Input buffer and gives back midi events.
[[[status,data1,data2,data3],timestamp],
[[status,data1,data2,data3],timestamp],...]
"""
_check_init()
self._check_open()
return self._input.Read(num_events)
def poll(self):
"""returns true if there's data, or false if not.
Input.poll(): return Bool
raises a MidiException on error.
"""
_check_init()
self._check_open()
r = self._input.Poll()
if r == _pypm.TRUE:
return True
elif r == _pypm.FALSE:
return False
else:
err_text = GetErrorText(r)
raise MidiException( (r, err_text) )
class Output(object):
"""Output is used to send midi to an output device
Output(device_id)
Output(device_id, latency = 0)
Output(device_id, buffer_size = 4096)
Output(device_id, latency, buffer_size)
The buffer_size specifies the number of output events to be
buffered waiting for output. (In some cases -- see below --
PortMidi does not buffer output at all and merely passes data
to a lower-level API, in which case buffersize is ignored.)
latency is the delay in milliseconds applied to timestamps to determine
when the output should actually occur. (If latency is < 0, 0 is
assumed.)
If latency is zero, timestamps are ignored and all output is delivered
immediately. If latency is greater than zero, output is delayed until
the message timestamp plus the latency. (NOTE: time is measured
relative to the time source indicated by time_proc. Timestamps are
absolute, not relative delays or offsets.) In some cases, PortMidi
can obtain better timing than your application by passing timestamps
along to the device driver or hardware. Latency may also help you
to synchronize midi data to audio data by matching midi latency to
the audio buffer latency.
"""
def __init__(self, device_id, latency = 0, buffer_size = 4096):
"""Output(device_id)
Output(device_id, latency = 0)
Output(device_id, buffer_size = 4096)
Output(device_id, latency, buffer_size)
The buffer_size specifies the number of output events to be
buffered waiting for output. (In some cases -- see below --
PortMidi does not buffer output at all and merely passes data
to a lower-level API, in which case buffersize is ignored.)
latency is the delay in milliseconds applied to timestamps to determine
when the output should actually occur. (If latency is < 0, 0 is
assumed.)
If latency is zero, timestamps are ignored and all output is delivered
immediately. If latency is greater than zero, output is delayed until
the message timestamp plus the latency. (NOTE: time is measured
relative to the time source indicated by time_proc. Timestamps are
absolute, not relative delays or offsets.) In some cases, PortMidi
can obtain better timing than your application by passing timestamps
along to the device driver or hardware. Latency may also help you
to synchronize midi data to audio data by matching midi latency to
the audio buffer latency.
"""
_check_init()
self._aborted = 0
if device_id == -1:
raise MidiException("Device id is -1, not a valid output id. -1 usually means there were no default Output devices.")
try:
r = get_device_info(device_id)
except TypeError:
raise TypeError("an integer is required")
except OverflowError:
raise OverflowError("long int too large to convert to int")
# and now some nasty looking error checking, to provide nice error
# messages to the kind, lovely, midi using people of whereever.
if r:
interf, name, input, output, opened = r
if output:
try:
self._output = _pypm.Output(device_id, latency)
except TypeError:
raise TypeError("an integer is required")
self.device_id = device_id
elif input:
raise MidiException("Device id given is not a valid output id, it is an input id.")
else:
raise MidiException("Device id given is not a valid output id.")
else:
raise MidiException("Device id invalid, out of range.")
def _check_open(self):
if self._output is None:
raise MidiException("midi not open.")
if self._aborted:
raise MidiException("midi aborted.")
def close(self):
""" closes a midi stream, flushing any pending buffers.
Output.close(): return None
PortMidi attempts to close open streams when the application
exits -- this is particularly difficult under Windows.
"""
_check_init()
if not (self._output is None):
self._output.Close()
self._output = None
def abort(self):
"""terminates outgoing messages immediately
Output.abort(): return None
The caller should immediately close the output port;
this call may result in transmission of a partial midi message.
There is no abort for Midi input because the user can simply
ignore messages in the buffer and close an input device at
any time.
"""
_check_init()
if self._output:
self._output.Abort()
self._aborted = 1
def write(self, data):
"""writes a list of midi data to the Output
Output.write(data)
writes series of MIDI information in the form of a list:
write([[[status <,data1><,data2><,data3>],timestamp],
[[status <,data1><,data2><,data3>],timestamp],...])
<data> fields are optional
example: choose program change 1 at time 20000 and
send note 65 with velocity 100 500 ms later.
write([[[0xc0,0,0],20000],[[0x90,60,100],20500]])
notes:
1. timestamps will be ignored if latency = 0.
2. To get a note to play immediately, send MIDI info with
timestamp read from function Time.
3. understanding optional data fields:
write([[[0xc0,0,0],20000]]) is equivalent to
write([[[0xc0],20000]])
Can send up to 1024 elements in your data list, otherwise an
IndexError exception is raised.
"""
_check_init()
self._check_open()
self._output.Write(data)
def write_short(self, status, data1 = 0, data2 = 0):
"""write_short(status <, data1><, data2>)
Output.write_short(status)
Output.write_short(status, data1 = 0, data2 = 0)
output MIDI information of 3 bytes or less.
data fields are optional
status byte could be:
0xc0 = program change
0x90 = note on
etc.
data bytes are optional and assumed 0 if omitted
example: note 65 on with velocity 100
write_short(0x90,65,100)
"""
_check_init()
self._check_open()
self._output.WriteShort(status, data1, data2)
def write_sys_ex(self, when, msg):
"""writes a timestamped system-exclusive midi message.
Output.write_sys_ex(when, msg)
msg - can be a *list* or a *string*
when - a timestamp in miliseconds
example:
(assuming o is an onput MIDI stream)
o.write_sys_ex(0,'\\xF0\\x7D\\x10\\x11\\x12\\x13\\xF7')
is equivalent to
o.write_sys_ex(pyportmidi.time(),
[0xF0,0x7D,0x10,0x11,0x12,0x13,0xF7])
"""
_check_init()
self._check_open()
self._output.WriteSysEx(when, msg)
def note_on(self, note, velocity=None, channel = 0):
"""turns a midi note on. Note must be off.
Output.note_on(note, velocity=None, channel = 0)
Turn a note on in the output stream. The note must already
be off for this to work correctly.
"""
if velocity is None:
velocity = 0
if not (0 <= channel <= 15):
raise ValueError("Channel not between 0 and 15.")
self.write_short(0x90+channel, note, velocity)
def note_off(self, note, velocity=None, channel = 0):
"""turns a midi note off. Note must be on.
Output.note_off(note, velocity=None, channel = 0)
Turn a note off in the output stream. The note must already
be on for this to work correctly.
"""
if velocity is None:
velocity = 0
if not (0 <= channel <= 15):
raise ValueError("Channel not between 0 and 15.")
self.write_short(0x80 + channel, note, velocity)
def set_instrument(self, instrument_id, channel = 0):
"""select an instrument, with a value between 0 and 127
Output.set_instrument(instrument_id, channel = 0)
"""
if not (0 <= instrument_id <= 127):
raise ValueError("Undefined instrument id: %d" % instrument_id)
if not (0 <= channel <= 15):
raise ValueError("Channel not between 0 and 15.")
self.write_short(0xc0+channel, instrument_id)
def time():
"""returns the current time in ms of the PortMidi timer
pyportmidi.time(): return time
The time is reset to 0, when the module is inited.
"""
return _pypm.Time()
class MidiException(Exception):
"""MidiException(errno) that can be raised.
"""
def __init__(self, value):
self.parameter = value
def __str__(self):
return repr(self.parameter)

View File

@ -0,0 +1,185 @@
import sys
import os
import logging
from distutils.core import setup, Command
from distutils.extension import Extension
try:
from Cython.Distutils import build_ext
except ImportError:
logging.warn("Cython is preferred over pyrex for python3 compatibility.")
from Pyrex.Distutils import build_ext
DESCRIPTION = open('README_PYTHON.txt').read()
CHANGES = open('CHANGES.txt').read()
TODO = open('TODO.txt').read()
EXTRAS = {}
long_description = DESCRIPTION + CHANGES + TODO
#import sys
#if "checkdocs" in sys.argv:
# print long_description
METADATA = {
'name': 'pyportmidi',
'version': '0.0.7',
'license': 'MIT License',
'url': 'http://pypi.python.org/pyportmidi/',
'author': 'John Harrison, Roger B. Dannenberg, Rene Dudfield, others...',
'author_email': 'renesd@gmail.com',
'maintainer': 'Rene Dudfield',
'maintainer_email': 'renesd@gmail.com',
'description': 'Python Wrappings for PortMidi #python. CHANGES: new package layout.',
'long_description': long_description,
'classifiers': [
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'Intended Audience :: Information Technology',
'License :: OSI Approved :: BSD License',
'Operating System :: MacOS :: MacOS X',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX :: Linux',
'Programming Language :: Cython',
'Programming Language :: C',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.5',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.0',
'Programming Language :: Python :: 3.1',
'Programming Language :: Python :: 3.2',
'Topic :: Multimedia :: Sound/Audio :: MIDI',
'Topic :: Software Development :: Libraries',
],
}
if "bdist_msi" in sys.argv:
# hack the version name to a format msi doesn't have trouble with
METADATA["version"] = METADATA["version"].replace("pre", "a0")
METADATA["version"] = METADATA["version"].replace("rc", "b0")
METADATA["version"] = METADATA["version"].replace("release", "")
# allow optionally using setuptools for bdist_egg.
using_setuptools = False
if "-setuptools" in sys.argv:
using_setuptools = True
from setuptools import setup, Command
sys.argv.remove ("-setuptools")
EXTRAS.update({'include_package_data': True,
'install_requires': [],
'zip_safe': False,
'test_suite' : 'pyportmidi.tests',
}
)
# test command. For doing 'python setup.py test'
class TestCommand(Command):
user_options = [ ]
def initialize_options(self):
self._dir = os.getcwd()
def finalize_options(self):
pass
def run(self):
'''
runs the tests with default options.
'''
import pyportmidi.tests
pyportmidi.tests.main()
#import subprocess
#return subprocess.call([sys.executable, "run_tests.py"])
cmdclass = {'build_ext': build_ext}
# we use our test command.
if not using_setuptools:
import os
cmdclass['test'] = TestCommand
scripts = []
PACKAGEDATA = {
'cmdclass': cmdclass,
'package_dir': {'pyportmidi': 'pyportmidi',
#'pyportmidi.tests': 'test',
#'pyportmidi.docs': 'docs',
#'pyportmidi.examples': 'examples',
},
'packages': ['pyportmidi',
'pyportmidi.tests',
],
'scripts': scripts,
}
PACKAGEDATA.update(METADATA)
PACKAGEDATA.update(EXTRAS)
if sys.platform == 'win32':
print "Found Win32 platform"
EXTENSION = dict(
ext_modules=[
Extension("pyportmidi._pyportmidi", [os.path.join("pyportmidi", "_pyportmidi.pyx")],
library_dirs = ["../Release"],
libraries = ["portmidi", "winmm"],
include_dirs = ["../porttime"],
# define_macros = [("_WIN32_", None)]) # needed by portmidi.h
extra_compile_args = ["/DWIN32"]) # needed by portmidi.h
]
)
elif sys.platform == 'darwin':
print "Found darwin (OS X) platform"
library_dirs = ["/usr/local/lib"]
include_dirs = ["/usr/local/include"]
EXTENSION = dict(
ext_modules=[
Extension("pyportmidi._pyportmidi", [os.path.join("pyportmidi", "_pyportmidi.pyx")],
library_dirs = library_dirs,
include_dirs = include_dirs,
libraries = ["portmidi"],
extra_link_args=["-framework", "CoreFoundation",
"-framework", "CoreMIDI",
"-framework", "CoreAudio"])
]
)
else:
print "Assuming Linux platform"
EXTENSION = dict(
ext_modules=[
Extension("pyportmidi._pyportmidi", [os.path.join("pyportmidi", "_pyportmidi.pyx")],
library_dirs=["./linux"],
libraries = ["portmidi", "asound", "pthread"]
)
]
)
PACKAGEDATA.update(EXTENSION)
setup(**PACKAGEDATA)

View File

@ -0,0 +1,15 @@
README_QT.txt for PortMidi
Richard Starfield
20 Sep 2010
This is a QtCreator build file for PortMidi.
To build PortMidi on Windows with QtCreator:
Move portmidi/pm_qt/portmidi.pro to portmidi/portmidi.pro
Open portmidi.pro in QtCreator, change to the release build option and build all to compile the static library.
This has been tested in Windows. The project file does include Linux build switches but they haven't been tested yet.
To compile a DLL instead of a static library change line 11 from "CONFIG += staticlib" to "CONFIG += DLL"

View File

@ -0,0 +1,47 @@
#-------------------------------------------------
#
# Project created by QtCreator 2010-09-02T12:50:47
#
#-------------------------------------------------
QT -= core gui
TARGET = portmidi
TEMPLATE = lib
CONFIG += staticlib # replace this with DLL for dynamic link on Windows
INCLUDEPATH = pm_common/ porttime/
win32 {
INCLUDEPATH += pm_win/
LIBS += -lwinmm
SOURCES += pm_win/pmwinmm.c \
pm_win/pmwin.c
HEADERS += pm_win/pmwinmm.h
}
# this build hasn't been tested on Linux yet
unix {
DEFINES += PMALSA
INCLUDEPATH += pm_linux/
LIBS += -lasound
SOURCES += pm_linux/finddefault.c \
pm_linux/pmlinux.c \
pm_linux/pmlinuxalsa.c
HEADERS += pm_linux/pmlinux.h pm_linux/pmlinuxalsa.h
}
DEFINES -= UNICODE
SOURCES += \
pm_common/portmidi.c \
pm_common/pmutil.c \
porttime/porttime.c \
porttime/ptwinmm.c
HEADERS += \
pm_common/pmutil.h \
pm_common/pminternal.h \
pm_common/portmidi.h \
porttime/porttime.h

View File

@ -0,0 +1,26 @@
# pm_test
# set the build directory to be in portmidi, not in portmidi/pm_test
# this is required for Xcode:
if(APPLE)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
endif(APPLE)
if(WIN32)
include(../pm_win/static.cmake)
endif(WIN32)
macro(make_a_test name)
add_executable(${name} ${name}.c)
target_link_libraries(${name} portmidi-static ${PM_NEEDED_LIBS})
add_dependencies(${name} portmidi-static)
endmacro(make_a_test)
make_a_test(test)
make_a_test(midithread)
make_a_test(midithru)
make_a_test(sysex)
make_a_test(latency)
make_a_test(mm)
make_a_test(midiclock)
make_a_test(qtest)

View File

@ -0,0 +1,148 @@
<?xml version="1.0" encoding = "Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="latency"
ProjectGUID="{41D78CBF-B04B-4561-BA4A-AC238C40633D}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="latency.dir\Debug"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalOptions=" /Zm1000"
AdditionalIncludeDirectories="..\pm_common;..\porttime;"
BasicRuntimeChecks="3"
CompileAs="1"
DebugInformationFormat="3"
ExceptionHandling="0"
InlineFunctionExpansion="0"
Optimization="0"
RuntimeLibrary="1"
WarningLevel="3"
PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"
AssemblerListingLocation="Debug"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="../pm_test/Debug/latency.pdb"
/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCResourceCompilerTool"
AdditionalIncludeDirectories="..\pm_common;..\porttime;"
PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"
MkTypLibCompatible="FALSE"
TargetEnvironment="1"
GenerateStublessProxies="TRUE"
TypeLibraryName="$(InputName).tlb"
OutputDirectory="$(IntDir)"
HeaderFileName="$(InputName).h"
DLLDataFileName=""
InterfaceIdentifierFileName="$(InputName)_i.c"
ProxyFileName="$(InputName)_p.c"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions=" /STACK:10000000 /machine:I386 /debug"
AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ..\Debug\portmidi_s.lib winmm.lib "
OutputFile="..\pm_test\Debug\latency.exe"
Version="0.0"
GenerateManifest="TRUE"
LinkIncremental="2"
AdditionalLibraryDirectories=""
ProgramDataBaseFile="../pm_test/Debug/latency.pdb"
GenerateDebugInformation="TRUE"
SubSystem="1"
ImportLibrary="..\pm_test\Debug\latency.lib"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="latency.dir\Release"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalOptions=" /Zm1000"
AdditionalIncludeDirectories="..\pm_common;..\porttime;"
CompileAs="1"
ExceptionHandling="0"
InlineFunctionExpansion="2"
Optimization="2"
RuntimeLibrary="0"
WarningLevel="3"
PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"
AssemblerListingLocation="Release"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="../pm_test/Release/latency.pdb"
/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCResourceCompilerTool"
AdditionalIncludeDirectories="..\pm_common;..\porttime;"
PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"
MkTypLibCompatible="FALSE"
TargetEnvironment="1"
GenerateStublessProxies="TRUE"
TypeLibraryName="$(InputName).tlb"
OutputDirectory="$(IntDir)"
HeaderFileName="$(InputName).h"
DLLDataFileName=""
InterfaceIdentifierFileName="$(InputName)_i.c"
ProxyFileName="$(InputName)_p.c"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions=" /STACK:10000000 /machine:I386"
AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ..\Release\portmidi_s.lib winmm.lib "
OutputFile="..\pm_test\Release\latency.exe"
Version="0.0"
GenerateManifest="TRUE"
LinkIncremental="1"
AdditionalLibraryDirectories=""
ProgramDataBaseFile="../pm_test/Release/latency.pdb"
SubSystem="1"
ImportLibrary="..\pm_test\Release\latency.lib"/>
</Configuration>
</Configurations>
<Files>
<Filter
Name="Source Files"
Filter="">
<File
RelativePath="..\pm_test\latency.c">
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,148 @@
<?xml version="1.0" encoding = "Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="midiclock"
ProjectGUID="{9B448D22-EC7E-4BD8-A552-B268D843CC3C}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="midiclock.dir\Debug"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalOptions=" /Zm1000"
AdditionalIncludeDirectories="..\pm_common;..\porttime;"
BasicRuntimeChecks="3"
CompileAs="1"
DebugInformationFormat="3"
ExceptionHandling="0"
InlineFunctionExpansion="0"
Optimization="0"
RuntimeLibrary="1"
WarningLevel="3"
PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"
AssemblerListingLocation="Debug"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="../pm_test/Debug/midiclock.pdb"
/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCResourceCompilerTool"
AdditionalIncludeDirectories="..\pm_common;..\porttime;"
PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"
MkTypLibCompatible="FALSE"
TargetEnvironment="1"
GenerateStublessProxies="TRUE"
TypeLibraryName="$(InputName).tlb"
OutputDirectory="$(IntDir)"
HeaderFileName="$(InputName).h"
DLLDataFileName=""
InterfaceIdentifierFileName="$(InputName)_i.c"
ProxyFileName="$(InputName)_p.c"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions=" /STACK:10000000 /machine:I386 /debug"
AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ..\Debug\portmidi_s.lib winmm.lib "
OutputFile="..\pm_test\Debug\midiclock.exe"
Version="0.0"
GenerateManifest="TRUE"
LinkIncremental="2"
AdditionalLibraryDirectories=""
ProgramDataBaseFile="../pm_test/Debug/midiclock.pdb"
GenerateDebugInformation="TRUE"
SubSystem="1"
ImportLibrary="..\pm_test\Debug\midiclock.lib"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="midiclock.dir\Release"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalOptions=" /Zm1000"
AdditionalIncludeDirectories="..\pm_common;..\porttime;"
CompileAs="1"
ExceptionHandling="0"
InlineFunctionExpansion="2"
Optimization="2"
RuntimeLibrary="0"
WarningLevel="3"
PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"
AssemblerListingLocation="Release"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="../pm_test/Release/midiclock.pdb"
/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCResourceCompilerTool"
AdditionalIncludeDirectories="..\pm_common;..\porttime;"
PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"
MkTypLibCompatible="FALSE"
TargetEnvironment="1"
GenerateStublessProxies="TRUE"
TypeLibraryName="$(InputName).tlb"
OutputDirectory="$(IntDir)"
HeaderFileName="$(InputName).h"
DLLDataFileName=""
InterfaceIdentifierFileName="$(InputName)_i.c"
ProxyFileName="$(InputName)_p.c"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions=" /STACK:10000000 /machine:I386"
AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ..\Release\portmidi_s.lib winmm.lib "
OutputFile="..\pm_test\Release\midiclock.exe"
Version="0.0"
GenerateManifest="TRUE"
LinkIncremental="1"
AdditionalLibraryDirectories=""
ProgramDataBaseFile="../pm_test/Release/midiclock.pdb"
SubSystem="1"
ImportLibrary="..\pm_test\Release\midiclock.lib"/>
</Configuration>
</Configurations>
<Files>
<Filter
Name="Source Files"
Filter="">
<File
RelativePath="..\pm_test\midiclock.c">
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,148 @@
<?xml version="1.0" encoding = "Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="midithread"
ProjectGUID="{EED7440D-04E3-4948-92DB-C85B4ADB1D82}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="midithread.dir\Debug"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalOptions=" /Zm1000"
AdditionalIncludeDirectories="..\pm_common;..\porttime;"
BasicRuntimeChecks="3"
CompileAs="1"
DebugInformationFormat="3"
ExceptionHandling="0"
InlineFunctionExpansion="0"
Optimization="0"
RuntimeLibrary="1"
WarningLevel="3"
PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"
AssemblerListingLocation="Debug"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="../pm_test/Debug/midithread.pdb"
/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCResourceCompilerTool"
AdditionalIncludeDirectories="..\pm_common;..\porttime;"
PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"
MkTypLibCompatible="FALSE"
TargetEnvironment="1"
GenerateStublessProxies="TRUE"
TypeLibraryName="$(InputName).tlb"
OutputDirectory="$(IntDir)"
HeaderFileName="$(InputName).h"
DLLDataFileName=""
InterfaceIdentifierFileName="$(InputName)_i.c"
ProxyFileName="$(InputName)_p.c"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions=" /STACK:10000000 /machine:I386 /debug"
AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ..\Debug\portmidi_s.lib winmm.lib "
OutputFile="..\pm_test\Debug\midithread.exe"
Version="0.0"
GenerateManifest="TRUE"
LinkIncremental="2"
AdditionalLibraryDirectories=""
ProgramDataBaseFile="../pm_test/Debug/midithread.pdb"
GenerateDebugInformation="TRUE"
SubSystem="1"
ImportLibrary="..\pm_test\Debug\midithread.lib"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="midithread.dir\Release"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalOptions=" /Zm1000"
AdditionalIncludeDirectories="..\pm_common;..\porttime;"
CompileAs="1"
ExceptionHandling="0"
InlineFunctionExpansion="2"
Optimization="2"
RuntimeLibrary="0"
WarningLevel="3"
PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"
AssemblerListingLocation="Release"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="../pm_test/Release/midithread.pdb"
/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCResourceCompilerTool"
AdditionalIncludeDirectories="..\pm_common;..\porttime;"
PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"
MkTypLibCompatible="FALSE"
TargetEnvironment="1"
GenerateStublessProxies="TRUE"
TypeLibraryName="$(InputName).tlb"
OutputDirectory="$(IntDir)"
HeaderFileName="$(InputName).h"
DLLDataFileName=""
InterfaceIdentifierFileName="$(InputName)_i.c"
ProxyFileName="$(InputName)_p.c"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions=" /STACK:10000000 /machine:I386"
AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ..\Release\portmidi_s.lib winmm.lib "
OutputFile="..\pm_test\Release\midithread.exe"
Version="0.0"
GenerateManifest="TRUE"
LinkIncremental="1"
AdditionalLibraryDirectories=""
ProgramDataBaseFile="../pm_test/Release/midithread.pdb"
SubSystem="1"
ImportLibrary="..\pm_test\Release\midithread.lib"/>
</Configuration>
</Configurations>
<Files>
<Filter
Name="Source Files"
Filter="">
<File
RelativePath="..\pm_test\midithread.c">
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,148 @@
<?xml version="1.0" encoding = "Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="midithru"
ProjectGUID="{80193DD1-2C02-4A4C-BDF8-49623AD6F556}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="midithru.dir\Debug"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalOptions=" /Zm1000"
AdditionalIncludeDirectories="..\pm_common;..\porttime;"
BasicRuntimeChecks="3"
CompileAs="1"
DebugInformationFormat="3"
ExceptionHandling="0"
InlineFunctionExpansion="0"
Optimization="0"
RuntimeLibrary="1"
WarningLevel="3"
PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"
AssemblerListingLocation="Debug"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="../pm_test/Debug/midithru.pdb"
/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCResourceCompilerTool"
AdditionalIncludeDirectories="..\pm_common;..\porttime;"
PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"
MkTypLibCompatible="FALSE"
TargetEnvironment="1"
GenerateStublessProxies="TRUE"
TypeLibraryName="$(InputName).tlb"
OutputDirectory="$(IntDir)"
HeaderFileName="$(InputName).h"
DLLDataFileName=""
InterfaceIdentifierFileName="$(InputName)_i.c"
ProxyFileName="$(InputName)_p.c"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions=" /STACK:10000000 /machine:I386 /debug"
AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ..\Debug\portmidi_s.lib winmm.lib "
OutputFile="..\pm_test\Debug\midithru.exe"
Version="0.0"
GenerateManifest="TRUE"
LinkIncremental="2"
AdditionalLibraryDirectories=""
ProgramDataBaseFile="../pm_test/Debug/midithru.pdb"
GenerateDebugInformation="TRUE"
SubSystem="1"
ImportLibrary="..\pm_test\Debug\midithru.lib"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="midithru.dir\Release"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalOptions=" /Zm1000"
AdditionalIncludeDirectories="..\pm_common;..\porttime;"
CompileAs="1"
ExceptionHandling="0"
InlineFunctionExpansion="2"
Optimization="2"
RuntimeLibrary="0"
WarningLevel="3"
PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"
AssemblerListingLocation="Release"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="../pm_test/Release/midithru.pdb"
/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCResourceCompilerTool"
AdditionalIncludeDirectories="..\pm_common;..\porttime;"
PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"
MkTypLibCompatible="FALSE"
TargetEnvironment="1"
GenerateStublessProxies="TRUE"
TypeLibraryName="$(InputName).tlb"
OutputDirectory="$(IntDir)"
HeaderFileName="$(InputName).h"
DLLDataFileName=""
InterfaceIdentifierFileName="$(InputName)_i.c"
ProxyFileName="$(InputName)_p.c"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions=" /STACK:10000000 /machine:I386"
AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ..\Release\portmidi_s.lib winmm.lib "
OutputFile="..\pm_test\Release\midithru.exe"
Version="0.0"
GenerateManifest="TRUE"
LinkIncremental="1"
AdditionalLibraryDirectories=""
ProgramDataBaseFile="../pm_test/Release/midithru.pdb"
SubSystem="1"
ImportLibrary="..\pm_test\Release\midithru.lib"/>
</Configuration>
</Configurations>
<Files>
<Filter
Name="Source Files"
Filter="">
<File
RelativePath="..\pm_test\midithru.c">
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,148 @@
<?xml version="1.0" encoding = "Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="mm"
ProjectGUID="{EAADABB5-83D6-4669-98F8-6CDBE6AFD2BF}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="mm.dir\Debug"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalOptions=" /Zm1000"
AdditionalIncludeDirectories="..\pm_common;..\porttime;"
BasicRuntimeChecks="3"
CompileAs="1"
DebugInformationFormat="3"
ExceptionHandling="0"
InlineFunctionExpansion="0"
Optimization="0"
RuntimeLibrary="1"
WarningLevel="3"
PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"
AssemblerListingLocation="Debug"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="../pm_test/Debug/mm.pdb"
/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCResourceCompilerTool"
AdditionalIncludeDirectories="..\pm_common;..\porttime;"
PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"
MkTypLibCompatible="FALSE"
TargetEnvironment="1"
GenerateStublessProxies="TRUE"
TypeLibraryName="$(InputName).tlb"
OutputDirectory="$(IntDir)"
HeaderFileName="$(InputName).h"
DLLDataFileName=""
InterfaceIdentifierFileName="$(InputName)_i.c"
ProxyFileName="$(InputName)_p.c"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions=" /STACK:10000000 /machine:I386 /debug"
AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ..\Debug\portmidi_s.lib winmm.lib "
OutputFile="..\pm_test\Debug\mm.exe"
Version="0.0"
GenerateManifest="TRUE"
LinkIncremental="2"
AdditionalLibraryDirectories=""
ProgramDataBaseFile="../pm_test/Debug/mm.pdb"
GenerateDebugInformation="TRUE"
SubSystem="1"
ImportLibrary="..\pm_test\Debug\mm.lib"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="mm.dir\Release"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalOptions=" /Zm1000"
AdditionalIncludeDirectories="..\pm_common;..\porttime;"
CompileAs="1"
ExceptionHandling="0"
InlineFunctionExpansion="2"
Optimization="2"
RuntimeLibrary="0"
WarningLevel="3"
PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"
AssemblerListingLocation="Release"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="../pm_test/Release/mm.pdb"
/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCResourceCompilerTool"
AdditionalIncludeDirectories="..\pm_common;..\porttime;"
PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"
MkTypLibCompatible="FALSE"
TargetEnvironment="1"
GenerateStublessProxies="TRUE"
TypeLibraryName="$(InputName).tlb"
OutputDirectory="$(IntDir)"
HeaderFileName="$(InputName).h"
DLLDataFileName=""
InterfaceIdentifierFileName="$(InputName)_i.c"
ProxyFileName="$(InputName)_p.c"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions=" /STACK:10000000 /machine:I386"
AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ..\Release\portmidi_s.lib winmm.lib "
OutputFile="..\pm_test\Release\mm.exe"
Version="0.0"
GenerateManifest="TRUE"
LinkIncremental="1"
AdditionalLibraryDirectories=""
ProgramDataBaseFile="../pm_test/Release/mm.pdb"
SubSystem="1"
ImportLibrary="..\pm_test\Release\mm.lib"/>
</Configuration>
</Configurations>
<Files>
<Filter
Name="Source Files"
Filter="">
<File
RelativePath="..\pm_test\mm.c">
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,148 @@
<?xml version="1.0" encoding = "Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="qtest"
ProjectGUID="{2204E68C-5C1F-440E-8CE6-7E273D4F6AD1}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="qtest.dir\Debug"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalOptions=" /Zm1000"
AdditionalIncludeDirectories="..\pm_common;..\porttime;"
BasicRuntimeChecks="3"
CompileAs="1"
DebugInformationFormat="3"
ExceptionHandling="0"
InlineFunctionExpansion="0"
Optimization="0"
RuntimeLibrary="1"
WarningLevel="3"
PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"
AssemblerListingLocation="Debug"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="../pm_test/Debug/qtest.pdb"
/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCResourceCompilerTool"
AdditionalIncludeDirectories="..\pm_common;..\porttime;"
PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"
MkTypLibCompatible="FALSE"
TargetEnvironment="1"
GenerateStublessProxies="TRUE"
TypeLibraryName="$(InputName).tlb"
OutputDirectory="$(IntDir)"
HeaderFileName="$(InputName).h"
DLLDataFileName=""
InterfaceIdentifierFileName="$(InputName)_i.c"
ProxyFileName="$(InputName)_p.c"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions=" /STACK:10000000 /machine:I386 /debug"
AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ..\Debug\portmidi_s.lib winmm.lib "
OutputFile="..\pm_test\Debug\qtest.exe"
Version="0.0"
GenerateManifest="TRUE"
LinkIncremental="2"
AdditionalLibraryDirectories=""
ProgramDataBaseFile="../pm_test/Debug/qtest.pdb"
GenerateDebugInformation="TRUE"
SubSystem="1"
ImportLibrary="..\pm_test\Debug\qtest.lib"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="qtest.dir\Release"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalOptions=" /Zm1000"
AdditionalIncludeDirectories="..\pm_common;..\porttime;"
CompileAs="1"
ExceptionHandling="0"
InlineFunctionExpansion="2"
Optimization="2"
RuntimeLibrary="0"
WarningLevel="3"
PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"
AssemblerListingLocation="Release"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="../pm_test/Release/qtest.pdb"
/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCResourceCompilerTool"
AdditionalIncludeDirectories="..\pm_common;..\porttime;"
PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"
MkTypLibCompatible="FALSE"
TargetEnvironment="1"
GenerateStublessProxies="TRUE"
TypeLibraryName="$(InputName).tlb"
OutputDirectory="$(IntDir)"
HeaderFileName="$(InputName).h"
DLLDataFileName=""
InterfaceIdentifierFileName="$(InputName)_i.c"
ProxyFileName="$(InputName)_p.c"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions=" /STACK:10000000 /machine:I386"
AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ..\Release\portmidi_s.lib winmm.lib "
OutputFile="..\pm_test\Release\qtest.exe"
Version="0.0"
GenerateManifest="TRUE"
LinkIncremental="1"
AdditionalLibraryDirectories=""
ProgramDataBaseFile="../pm_test/Release/qtest.pdb"
SubSystem="1"
ImportLibrary="..\pm_test\Release\qtest.lib"/>
</Configuration>
</Configurations>
<Files>
<Filter
Name="Source Files"
Filter="">
<File
RelativePath="..\pm_test\qtest.c">
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,148 @@
<?xml version="1.0" encoding = "Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="sysex"
ProjectGUID="{71B9BC6E-7B40-4FBC-BC7F-4372AF03D0FD}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="sysex.dir\Debug"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalOptions=" /Zm1000"
AdditionalIncludeDirectories="..\pm_common;..\porttime;"
BasicRuntimeChecks="3"
CompileAs="1"
DebugInformationFormat="3"
ExceptionHandling="0"
InlineFunctionExpansion="0"
Optimization="0"
RuntimeLibrary="1"
WarningLevel="3"
PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"
AssemblerListingLocation="Debug"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="../pm_test/Debug/sysex.pdb"
/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCResourceCompilerTool"
AdditionalIncludeDirectories="..\pm_common;..\porttime;"
PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"
MkTypLibCompatible="FALSE"
TargetEnvironment="1"
GenerateStublessProxies="TRUE"
TypeLibraryName="$(InputName).tlb"
OutputDirectory="$(IntDir)"
HeaderFileName="$(InputName).h"
DLLDataFileName=""
InterfaceIdentifierFileName="$(InputName)_i.c"
ProxyFileName="$(InputName)_p.c"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions=" /STACK:10000000 /machine:I386 /debug"
AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ..\Debug\portmidi_s.lib winmm.lib "
OutputFile="..\pm_test\Debug\sysex.exe"
Version="0.0"
GenerateManifest="TRUE"
LinkIncremental="2"
AdditionalLibraryDirectories=""
ProgramDataBaseFile="../pm_test/Debug/sysex.pdb"
GenerateDebugInformation="TRUE"
SubSystem="1"
ImportLibrary="..\pm_test\Debug\sysex.lib"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="sysex.dir\Release"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalOptions=" /Zm1000"
AdditionalIncludeDirectories="..\pm_common;..\porttime;"
CompileAs="1"
ExceptionHandling="0"
InlineFunctionExpansion="2"
Optimization="2"
RuntimeLibrary="0"
WarningLevel="3"
PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"
AssemblerListingLocation="Release"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="../pm_test/Release/sysex.pdb"
/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCResourceCompilerTool"
AdditionalIncludeDirectories="..\pm_common;..\porttime;"
PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"
MkTypLibCompatible="FALSE"
TargetEnvironment="1"
GenerateStublessProxies="TRUE"
TypeLibraryName="$(InputName).tlb"
OutputDirectory="$(IntDir)"
HeaderFileName="$(InputName).h"
DLLDataFileName=""
InterfaceIdentifierFileName="$(InputName)_i.c"
ProxyFileName="$(InputName)_p.c"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions=" /STACK:10000000 /machine:I386"
AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ..\Release\portmidi_s.lib winmm.lib "
OutputFile="..\pm_test\Release\sysex.exe"
Version="0.0"
GenerateManifest="TRUE"
LinkIncremental="1"
AdditionalLibraryDirectories=""
ProgramDataBaseFile="../pm_test/Release/sysex.pdb"
SubSystem="1"
ImportLibrary="..\pm_test\Release\sysex.lib"/>
</Configuration>
</Configurations>
<Files>
<Filter
Name="Source Files"
Filter="">
<File
RelativePath="..\pm_test\sysex.c">
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

Some files were not shown because too many files have changed in this diff Show More