new audio engine backend for native CoreAudio audio I/O, and PortMIDI for MIDI.

Code builds, runs and functions. Full code review still pending, and some possibly changes to organization of code within the backend is possible
This commit is contained in:
Paul Davis 2014-02-24 14:39:10 -05:00
parent 0a6af1420f
commit 1de00ab6bb
84 changed files with 21936 additions and 0 deletions

View file

@ -0,0 +1,178 @@
/* pminternal.h -- header for interface implementations */
/* this file is included by files that implement library internals */
/* Here is a guide to implementers:
provide an initialization function similar to pm_winmm_init()
add your initialization function to pm_init()
Note that your init function should never require not-standard
libraries or fail in any way. If the interface is not available,
simply do not call pm_add_device. This means that non-standard
libraries should try to do dynamic linking at runtime using a DLL
and return without error if the DLL cannot be found or if there
is any other failure.
implement functions as indicated in pm_fns_type to open, read, write,
close, etc.
call pm_add_device() for each input and output device, passing it a
pm_fns_type structure.
assumptions about pm_fns_type functions are given below.
*/
#ifdef __cplusplus
extern "C" {
#endif
extern int pm_initialized; /* see note in portmidi.c */
/* these are defined in system-specific file */
void *pm_alloc(size_t s);
void pm_free(void *ptr);
/* if an error occurs while opening or closing a midi stream, set these: */
extern int pm_hosterror;
extern char pm_hosterror_text[PM_HOST_ERROR_MSG_LEN];
struct pm_internal_struct;
/* these do not use PmInternal because it is not defined yet... */
typedef PmError (*pm_write_short_fn)(struct pm_internal_struct *midi,
PmEvent *buffer);
typedef PmError (*pm_begin_sysex_fn)(struct pm_internal_struct *midi,
PmTimestamp timestamp);
typedef PmError (*pm_end_sysex_fn)(struct pm_internal_struct *midi,
PmTimestamp timestamp);
typedef PmError (*pm_write_byte_fn)(struct pm_internal_struct *midi,
unsigned char byte, PmTimestamp timestamp);
typedef PmError (*pm_write_realtime_fn)(struct pm_internal_struct *midi,
PmEvent *buffer);
typedef PmError (*pm_write_flush_fn)(struct pm_internal_struct *midi,
PmTimestamp timestamp);
typedef PmTimestamp (*pm_synchronize_fn)(struct pm_internal_struct *midi);
/* pm_open_fn should clean up all memory and close the device if any part
of the open fails */
typedef PmError (*pm_open_fn)(struct pm_internal_struct *midi,
void *driverInfo);
typedef PmError (*pm_abort_fn)(struct pm_internal_struct *midi);
/* pm_close_fn should clean up all memory and close the device if any
part of the close fails. */
typedef PmError (*pm_close_fn)(struct pm_internal_struct *midi);
typedef PmError (*pm_poll_fn)(struct pm_internal_struct *midi);
typedef void (*pm_host_error_fn)(struct pm_internal_struct *midi, char * msg,
unsigned int len);
typedef unsigned int (*pm_has_host_error_fn)(struct pm_internal_struct *midi);
typedef struct {
pm_write_short_fn write_short; /* output short MIDI msg */
pm_begin_sysex_fn begin_sysex; /* prepare to send a sysex message */
pm_end_sysex_fn end_sysex; /* marks end of sysex message */
pm_write_byte_fn write_byte; /* accumulate one more sysex byte */
pm_write_realtime_fn write_realtime; /* send real-time message within sysex */
pm_write_flush_fn write_flush; /* send any accumulated but unsent data */
pm_synchronize_fn synchronize; /* synchronize portmidi time to stream time */
pm_open_fn open; /* open MIDI device */
pm_abort_fn abort; /* abort */
pm_close_fn close; /* close device */
pm_poll_fn poll; /* read pending midi events into portmidi buffer */
pm_has_host_error_fn has_host_error; /* true when device has had host
error message */
pm_host_error_fn host_error; /* provide text readable host error message
for device (clears and resets) */
} pm_fns_node, *pm_fns_type;
/* when open fails, the dictionary gets this set of functions: */
extern pm_fns_node pm_none_dictionary;
typedef struct {
PmDeviceInfo pub; /* some portmidi state also saved in here (for autmatic
device closing (see PmDeviceInfo struct) */
void *descriptor; /* ID number passed to win32 multimedia API open */
void *internalDescriptor; /* points to PmInternal device, allows automatic
device closing */
pm_fns_type dictionary;
} descriptor_node, *descriptor_type;
extern int pm_descriptor_max;
extern descriptor_type descriptors;
extern int pm_descriptor_index;
typedef uint32_t (*time_get_proc_type)(void *time_info);
typedef struct pm_internal_struct {
int device_id; /* which device is open (index to descriptors) */
short write_flag; /* MIDI_IN, or MIDI_OUT */
PmTimeProcPtr time_proc; /* where to get the time */
void *time_info; /* pass this to get_time() */
int32_t buffer_len; /* how big is the buffer or queue? */
PmQueue *queue;
int32_t latency; /* time delay in ms between timestamps and actual output */
/* set to zero to get immediate, simple blocking output */
/* if latency is zero, timestamps will be ignored; */
/* if midi input device, this field ignored */
int sysex_in_progress; /* when sysex status is seen, this flag becomes
* true until EOX is seen. When true, new data is appended to the
* stream of outgoing bytes. When overflow occurs, sysex data is
* dropped (until an EOX or non-real-timei status byte is seen) so
* that, if the overflow condition is cleared, we don't start
* sending data from the middle of a sysex message. If a sysex
* message is filtered, sysex_in_progress is false, causing the
* message to be dropped. */
PmMessage sysex_message; /* buffer for 4 bytes of sysex data */
int sysex_message_count; /* how many bytes in sysex_message so far */
int32_t filters; /* flags that filter incoming message classes */
int32_t channel_mask; /* filter incoming messages based on channel */
PmTimestamp last_msg_time; /* timestamp of last message */
PmTimestamp sync_time; /* time of last synchronization */
PmTimestamp now; /* set by PmWrite to current time */
int first_message; /* initially true, used to run first synchronization */
pm_fns_type dictionary; /* implementation functions */
void *descriptor; /* system-dependent state */
/* the following are used to expedite sysex data */
/* on windows, in debug mode, based on some profiling, these optimizations
* cut the time to process sysex bytes from about 7.5 to 0.26 usec/byte,
* but this does not count time in the driver, so I don't know if it is
* important
*/
unsigned char *fill_base; /* addr of ptr to sysex data */
uint32_t *fill_offset_ptr; /* offset of next sysex byte */
int32_t fill_length; /* how many sysex bytes to write */
} PmInternal;
/* defined by system specific implementation, e.g. pmwinmm, used by PortMidi */
void pm_init(void);
void pm_term(void);
/* defined by portMidi, used by pmwinmm */
PmError none_write_short(PmInternal *midi, PmEvent *buffer);
PmError none_write_byte(PmInternal *midi, unsigned char byte,
PmTimestamp timestamp);
PmTimestamp none_synchronize(PmInternal *midi);
PmError pm_fail_fn(PmInternal *midi);
PmError pm_fail_timestamp_fn(PmInternal *midi, PmTimestamp timestamp);
PmError pm_success_fn(PmInternal *midi);
PmError pm_add_device(char *interf, char *name, int input, void *descriptor,
pm_fns_type dictionary);
uint32_t pm_read_bytes(PmInternal *midi, const unsigned char *data, int len,
PmTimestamp timestamp);
void pm_read_short(PmInternal *midi, PmEvent *event);
#define none_write_flush pm_fail_timestamp_fn
#define none_sysex pm_fail_timestamp_fn
#define none_poll pm_fail_fn
#define success_poll pm_success_fn
#define MIDI_REALTIME_MASK 0xf8
#define is_real_time(msg) \
((Pm_MessageStatus(msg) & MIDI_REALTIME_MASK) == MIDI_REALTIME_MASK)
int pm_find_default_device(char *pattern, int is_input);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,284 @@
/* pmutil.c -- some helpful utilities for building midi
applications that use PortMidi
*/
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include "portmidi.h"
#include "pmutil.h"
#include "pminternal.h"
#ifdef WIN32
#define bzero(addr, siz) memset(addr, 0, siz)
#endif
// #define QUEUE_DEBUG 1
#ifdef QUEUE_DEBUG
#include "stdio.h"
#endif
typedef struct {
long head;
long tail;
long len;
long overflow;
int32_t msg_size; /* number of int32_t in a message including extra word */
int32_t peek_overflow;
int32_t *buffer;
int32_t *peek;
int32_t peek_flag;
} PmQueueRep;
PMEXPORT PmQueue *Pm_QueueCreate(long num_msgs, int32_t bytes_per_msg)
{
int32_t int32s_per_msg =
(int32_t) (((bytes_per_msg + sizeof(int32_t) - 1) &
~(sizeof(int32_t) - 1)) / sizeof(int32_t));
PmQueueRep *queue = (PmQueueRep *) pm_alloc(sizeof(PmQueueRep));
if (!queue) /* memory allocation failed */
return NULL;
/* need extra word per message for non-zero encoding */
queue->len = num_msgs * (int32s_per_msg + 1);
queue->buffer = (int32_t *) pm_alloc(queue->len * sizeof(int32_t));
bzero(queue->buffer, queue->len * sizeof(int32_t));
if (!queue->buffer) {
pm_free(queue);
return NULL;
} else { /* allocate the "peek" buffer */
queue->peek = (int32_t *) pm_alloc(int32s_per_msg * sizeof(int32_t));
if (!queue->peek) {
/* free everything allocated so far and return */
pm_free(queue->buffer);
pm_free(queue);
return NULL;
}
}
bzero(queue->buffer, queue->len * sizeof(int32_t));
queue->head = 0;
queue->tail = 0;
/* msg_size is in words */
queue->msg_size = int32s_per_msg + 1; /* note extra word is counted */
queue->overflow = FALSE;
queue->peek_overflow = FALSE;
queue->peek_flag = FALSE;
return queue;
}
PMEXPORT PmError Pm_QueueDestroy(PmQueue *q)
{
PmQueueRep *queue = (PmQueueRep *) q;
/* arg checking */
if (!queue || !queue->buffer || !queue->peek)
return pmBadPtr;
pm_free(queue->peek);
pm_free(queue->buffer);
pm_free(queue);
return pmNoError;
}
PMEXPORT PmError Pm_Dequeue(PmQueue *q, void *msg)
{
long head;
PmQueueRep *queue = (PmQueueRep *) q;
int i;
int32_t *msg_as_int32 = (int32_t *) msg;
/* arg checking */
if (!queue)
return pmBadPtr;
/* a previous peek operation encountered an overflow, but the overflow
* has not yet been reported to client, so do it now. No message is
* returned, but on the next call, we will return the peek buffer.
*/
if (queue->peek_overflow) {
queue->peek_overflow = FALSE;
return pmBufferOverflow;
}
if (queue->peek_flag) {
memcpy(msg, queue->peek, (queue->msg_size - 1) * sizeof(int32_t));
queue->peek_flag = FALSE;
return pmGotData;
}
head = queue->head;
/* if writer overflows, it writes queue->overflow = tail+1 so that
* when the reader gets to that position in the buffer, it can
* return the overflow condition to the reader. The problem is that
* at overflow, things have wrapped around, so tail == head, and the
* reader will detect overflow immediately instead of waiting until
* it reads everything in the buffer, wrapping around again to the
* point where tail == head. So the condition also checks that
* queue->buffer[head] is zero -- if so, then the buffer is now
* empty, and we're at the point in the msg stream where overflow
* occurred. It's time to signal overflow to the reader. If
* queue->buffer[head] is non-zero, there's a message there and we
* should read all the way around the buffer before signalling overflow.
* There is a write-order dependency here, but to fail, the overflow
* field would have to be written while an entire buffer full of
* writes are still pending. I'm assuming out-of-order writes are
* possible, but not that many.
*/
if (queue->overflow == head + 1 && !queue->buffer[head]) {
queue->overflow = 0; /* non-overflow condition */
return pmBufferOverflow;
}
/* test to see if there is data in the queue -- test from back
* to front so if writer is simultaneously writing, we don't
* waste time discovering the write is not finished
*/
for (i = queue->msg_size - 1; i >= 0; i--) {
if (!queue->buffer[head + i]) {
return pmNoData;
}
}
memcpy(msg, (char *) &queue->buffer[head + 1],
sizeof(int32_t) * (queue->msg_size - 1));
/* fix up zeros */
i = queue->buffer[head];
while (i < queue->msg_size) {
int32_t j;
i--; /* msg does not have extra word so shift down */
j = msg_as_int32[i];
msg_as_int32[i] = 0;
i = j;
}
/* signal that data has been removed by zeroing: */
bzero((char *) &queue->buffer[head], sizeof(int32_t) * queue->msg_size);
/* update head */
head += queue->msg_size;
if (head == queue->len) head = 0;
queue->head = head;
return pmGotData; /* success */
}
PMEXPORT PmError Pm_SetOverflow(PmQueue *q)
{
PmQueueRep *queue = (PmQueueRep *) q;
long tail;
/* arg checking */
if (!queue)
return pmBadPtr;
/* no more enqueue until receiver acknowledges overflow */
if (queue->overflow) return pmBufferOverflow;
tail = queue->tail;
queue->overflow = tail + 1;
return pmBufferOverflow;
}
PMEXPORT PmError Pm_Enqueue(PmQueue *q, void *msg)
{
PmQueueRep *queue = (PmQueueRep *) q;
long tail;
int i;
int32_t *src = (int32_t *) msg;
int32_t *ptr;
int32_t *dest;
int rslt;
if (!queue)
return pmBadPtr;
/* no more enqueue until receiver acknowledges overflow */
if (queue->overflow) return pmBufferOverflow;
rslt = Pm_QueueFull(q);
/* already checked above: if (rslt == pmBadPtr) return rslt; */
tail = queue->tail;
if (rslt) {
queue->overflow = tail + 1;
return pmBufferOverflow;
}
/* queue is has room for message, and overflow flag is cleared */
ptr = &queue->buffer[tail];
dest = ptr + 1;
for (i = 1; i < queue->msg_size; i++) {
int32_t j = src[i - 1];
if (!j) {
*ptr = i;
ptr = dest;
} else {
*dest = j;
}
dest++;
}
*ptr = i;
tail += queue->msg_size;
if (tail == queue->len) tail = 0;
queue->tail = tail;
return pmNoError;
}
PMEXPORT int Pm_QueueEmpty(PmQueue *q)
{
PmQueueRep *queue = (PmQueueRep *) q;
return (!queue) || /* null pointer -> return "empty" */
(queue->buffer[queue->head] == 0 && !queue->peek_flag);
}
PMEXPORT int Pm_QueueFull(PmQueue *q)
{
long tail;
int i;
PmQueueRep *queue = (PmQueueRep *) q;
/* arg checking */
if (!queue)
return pmBadPtr;
tail = queue->tail;
/* test to see if there is space in the queue */
for (i = 0; i < queue->msg_size; i++) {
if (queue->buffer[tail + i]) {
return TRUE;
}
}
return FALSE;
}
PMEXPORT void *Pm_QueuePeek(PmQueue *q)
{
PmError rslt;
int32_t temp;
PmQueueRep *queue = (PmQueueRep *) q;
/* arg checking */
if (!queue)
return NULL;
if (queue->peek_flag) {
return queue->peek;
}
/* this is ugly: if peek_overflow is set, then Pm_Dequeue()
* returns immediately with pmBufferOverflow, but here, we
* want Pm_Dequeue() to really check for data. If data is
* there, we can return it
*/
temp = queue->peek_overflow;
queue->peek_overflow = FALSE;
rslt = Pm_Dequeue(q, queue->peek);
queue->peek_overflow = temp;
if (rslt == 1) {
queue->peek_flag = TRUE;
return queue->peek;
} else if (rslt == pmBufferOverflow) {
/* when overflow is indicated, the queue is empty and the
* first message that was dropped by Enqueue (signalling
* pmBufferOverflow to its caller) would have been the next
* message in the queue. Pm_QueuePeek will return NULL, but
* remember that an overflow occurred. (see Pm_Dequeue)
*/
queue->peek_overflow = TRUE;
}
return NULL;
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,129 @@
# MAKEFILE FOR PORTMIDI
# Roger B. Dannenberg
# Sep 2009
# NOTE: you can use
# make -f pm_osx/Makefile.osx configuration=Release
# to override the default Debug configuration
configuration=Release
PF=/usr/local
# For debugging, define PM_CHECK_ERRORS
ifeq ($(configuration),Release)
CONFIG = Release
else
CONFIG = Debug
endif
current: all
all: $(CONFIG)/CMakeCache.txt
cd $(CONFIG); make
$(CONFIG)/CMakeCache.txt:
rm -f 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'
help:
echo $$'\n\n\
This is help for portmidi/pm_mac/Makefile.osx\n\n\
Installation path for dylib is $(PF)\n\
To build Release version libraries and test applications,\n \
make -f pm_mac/Makefile.osx\n\
To build Debug version libraries and test applications,\n \
make -f pm_mac/Makefile.osx configuration=Debug\n\
To install universal dynamic library,\n \
sudo make -f pm_mac/Makefile.osx install\n\
To install universal dynamic library with xcode,\n \
make -f pm_mac/Makefile.osx install-with-xcode\n\
To make PmDefaults Java application,\n \
make -f pm_mac/Makefile.osx pmdefaults\n\n \
configuration = $(configuration)\n'
clean:
rm -f *.o *~ core* */*.o */*/*.o */*~ */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
rm -f pm_java/pmjni/*.o pm_java/pmjni/*~ pm_java/*.h
rm -rf Release/CMakeFiles Debug/CMakeFiles
rm -rf pm_mac/pmdefaults/lib pm_mac/pmdefaults/src
cleaner: clean
rm -rf pm_mac/build
rm -rf pm_mac/Debug pm_mac/Release pm_test/Debug pm_test/Release
rm -f Debug/*.dylib Release/*.dylib
rm -f pm_java/pmjni/Debug/*.jnilib
rm -f pm_java/pmjni/Release/*.jnilib
cleanest: cleaner
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
rm -f pm_test/Debug/qtest pm_test/Debug/mm
rm -f pm_test/Release/test pm_test/Release/sysex pm_test/Release/midithread
rm -f pm_test/Release/latency pm_test/Release/midithru
rm -f pm_test/Release/qtest pm_test/Release/mm
rm -f pm_java/*/*.class
rm -f pm_java/pmjni/jportmidi_JPortMidiApi_PortMidiStream.h
backup: cleanest
cd ..; zip -r portmidi.zip portmidi
install: porttime/porttime.h pm_common/portmidi.h \
$(CONFIG)/libportmidi.dylib
install porttime/porttime.h $(PF)/include/
install pm_common/portmidi.h $(PF)/include
install $(CONFIG)/libportmidi.dylib $(PF)/lib/
# note - this uses xcode to build and install portmidi universal binaries
install-with-xcode:
sudo xcodebuild -project pm_mac/pm_mac.xcodeproj \
-configuration Release install DSTROOT=/
##### build pmdefault ######
pm_java/pmjni/jportmidi_JPortMidiApi.h: pm_java/jportmidi/JPortMidiApi.class
cd pm_java; javah jportmidi.JPortMidiApi
mv pm_java/jportmidi_JportMidiApi.h pm_java/pmjni
JAVASRC = pmdefaults/PmDefaultsFrame.java \
pmdefaults/PmDefaults.java \
jportmidi/JPortMidiApi.java jportmidi/JPortMidi.java \
jportmidi/JPortMidiException.java
# this compiles ALL of the java code
pm_java/jportmidi/JPortMidiApi.class: $(JAVASRC:%=pm_java/%)
cd pm_java; javac $(JAVASRC)
$(CONFIG)/libpmjni.dylib:
mkdir -p $(CONFIG)
cd $(CONFIG); make -f ../pm_mac/$(MAKEFILE)
pmdefaults: $(CONFIG)/libpmjni.dylib pm_java/jportmidi/JPortMidiApi.class
ifeq ($(CONFIG),Debug)
echo "Error: you cannot build pmdefaults in a Debug configuration \n\
You should use configuration=Release in the Makefile command line. "
@exit 2
endif
xcodebuild -project pm_mac/pm_mac.xcodeproj \
-configuration Release -target PmDefaults
echo "pmdefaults java application is made"
###### test plist reader #######
PLHDR = pm_mac/readbinaryplist.h
PLSRC = pm_mac/plisttest.c pm_mac/readbinaryplist.c
pm_mac/plisttest: $(PLHDR) $(PLSRC)
cc $(VFLAGS) -Ipm_mac \
-I/Developer/Headers/FlatCarbon \
-I/System/Library/Frameworks/CoreFoundation.framework/Headers \
-I/System/Library/Frameworks/CoreServices.framework/Headers \
$(PLSRC) -o pm_mac/$(CONFIG)/plisttest \
-framework CoreFoundation -framework CoreServices

View file

@ -0,0 +1,163 @@
README_MAC.txt for PortMidi
Roger Dannenberg
20 nov 2009
revised 20 Sep 2010 for Xcode 3.2.4 and CMake 8.2-2
To build PortMidi for Mac OS X, you must install Xcode and
CMake.
CMake can build either command-line Makefiles or Xcode projects.
These approaches are described in separate sections below.
==== CLEANING UP ====
(Skip this for now, but later you might want start from a clean
slate.)
Start in the portmedia/portmidi directory.
make -f pm_mac/Makefile.osx clean
will remove .o, CMakeFiles, and other intermediate files.
Using "cleaner" instead of "clean" will also remove jni-related
intermediate files.
Using "cleanest" instead of "clean" or "cleaner" will also remove
application binaries and the portmidi libraries. (It will not
uninstall anything, however.)
==== USING CMAKE (AND COMMAND LINE TOOLS) ====
Start in the portmedia/portmidi directory.
make -f pm_mac/Makefile.osx
(Begin note: make will invoke cmake to build a Makefile and then make to
build portmidi. This extra level allows you to correctly build
both Release and Debug versions. Release is the default, so to get
the Debug version, use:
make -f pm_mac/Makefile.osx configuration=Debug
)
Release version executables and libraries are now in
portmedia/portmidi/Release
Debug version executables and libraries are created in
portmedia/portmidi/Debug
The Debug versions are compiled with PM_CHECK_ERRORS which
prints an error message and aborts when an error code is returned
by PortMidi functions. This is useful for small command line
applications. Otherwise, you should check and handle error returns
in your program.
You can install portmidi as follows:
cd Release; sudo make install
This will install /usr/local/include/{portmidi.h, porttime.h}
and /usr/local/lib/{libportmidi.dylib, libportmidi_s.a, libpmjni.dylib}
You should now make the pmdefaults.app:
make -f pm_mac/Makefile.osx pmdefaults
NOTE: pmdefaults.app will be in pm_mac/Release/.
Please copy pmdefaults.app to your Applications folder or wherever
you would normally expect to find it.
==== USING CMAKE TO BUILD Xcode PROJECT ====
Before you can use Xcode, you need a portmidi.xcodeproj file.
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
use it almost like any other Xcode project, and you will not have
to go back to CMake.
(1) Install CMake if you do not have it already.
(2) Open portmedia/portmidi/CMakeLists.txt with CMake
(3) Use Configure and Generate buttons
(4) This creates portmedia/portmidi/portmidi.xcodeproj.
Note: You will also use pm_mac/pm_mac.xcodeproj, which
is not generated by CMake.
(5) Open portmidi/portmidi.xcodeproj with Xcode and
build what you need. The simplest thing is to build the
ALL_BUILD target. The default will be to build the Debug
version, but you may want to change this to Release.
NOTE: ALL_BUILD may report errors. Try simply building again
or rebuilding specific targets that fail until they build
without errors. There appears to be a race condition or
missing dependencies in the build system.
The Debug version is compiled with PM_CHECK_ERRORS, and the
Release version is not. PM_CHECK_ERRORS will print an error
message and exit your program if any error is returned from
a call into PortMidi.
CMake (currently) also creates MinSizRel and RelWithDebInfo
versions, but only because I cannot figure out how to disable
them.
You will probably want the application PmDefaults, which sets
default MIDI In and Out devices for PortMidi. You may also
want to build a Java application using PortMidi. Since I have
not figured out how to use CMake to make an OS X Java application,
use pm_mac/pm_mac.xcodeproj as follows:
(6) open pm_mac/pm_mac.xcodeproj
(7) pm_java/pmjni/portmidi_JportmidiApi.h is needed
by libpmjni.jnilib, the Java native interface library. Since
portmidi_JportmidiApi.h is included with PortMidi, you can skip
to step 8, but if you really want to rebuild everything from
scratch, build the JPortMidiHeaders project first, and continue
with step 8:
(8) If you did not build libpmjni.dylib using portmidi.xcodeproj,
do it now. (It depends on portmidi_JportmidiApi.h, and the
PmDefaults project depends on libpmjni.dylib.)
(9) Returning to pm_mac.xcodeproj, build the PmDefaults program.
(10) If you wish, copy pm_mac/build/Deployment/PmDefaults.app to
your applications folder.
(11) If you want to install libportmidi.dylib, first make it with
Xcode, then
sudo make -f pm_mac/Makefile.osx install
This command will install /usr/local/include/{porttime.h, portmidi.h}
and /usr/local/lib/libportmidi.dylib
Note that the "install" function of xcode creates portmidi/Release
and does not install the library to /usr/local/lib, so please use
the command line installer.
CHANGELOG
20-Sep-2010 Roger B. Dannenberg
Adapted to Xcode 3.2.4
20-Nov-2009 Roger B. Dannenberg
Added some install instructions
26-Sep-2009 Roger B. Dannenberg
More changes for using CMake, Makefiles, XCode
20-Sep-2009 Roger B. Dannenberg
Modifications for using CMake
14-Sep-2009 Roger B. Dannenberg
Modifications for using CMake
17-Jan-2007 Roger B. Dannenberg
Explicit instructions for Xcode
15-Jan-2007 Roger B. Dannenberg
Changed instructions because of changes to Makefile.osx
07-Oct-2006 Roger B. Dannenberg
Added directions for xcodebuild
29-aug-2006 Roger B. Dannenberg
Updated this documentation.

View file

@ -0,0 +1,57 @@
/* finddefault.c -- find_default_device() implementation
Roger Dannenberg, June 2008
*/
#include <stdlib.h>
#include <string.h>
#include "portmidi.h"
#include "pmutil.h"
#include "pminternal.h"
#include "pmmacosxcm.h"
#include "readbinaryplist.h"
/* Parse preference files, find default device, search devices --
This parses the preference file(s) once for input and once for
output, which is inefficient but much simpler to manage. Note
that using the readbinaryplist.c module, you cannot keep two
plist files (user and system) open at once (due to a simple
memory management scheme).
*/
PmDeviceID find_default_device(char *path, int input, PmDeviceID id)
/* path -- the name of the preference we are searching for
input -- true iff this is an input device
id -- current default device id
returns matching device id if found, otherwise id
*/
{
static char *pref_file = "com.apple.java.util.prefs.plist";
char *pref_str = NULL;
// read device preferences
value_ptr prefs = bplist_read_user_pref(pref_file);
if (prefs) {
value_ptr pref_val = value_dict_lookup_using_path(prefs, path);
if (pref_val) {
pref_str = value_get_asciistring(pref_val);
}
}
if (!pref_str) {
bplist_free_data(); /* look elsewhere */
prefs = bplist_read_system_pref(pref_file);
if (prefs) {
value_ptr pref_val = value_dict_lookup_using_path(prefs, path);
if (pref_val) {
pref_str = value_get_asciistring(pref_val);
}
}
}
if (pref_str) { /* search devices for match */
int i = pm_find_default_device(pref_str, input);
if (i != pmNoDevice) {
id = i;
}
}
if (prefs) {
bplist_free_data();
}
return id;
}

View file

@ -0,0 +1,594 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 44;
objects = {
/* Begin PBXAggregateTarget section */
3D634CAB1247805C0020F829 /* JPortMidiHeaders */ = {
isa = PBXAggregateTarget;
buildConfigurationList = 3D634CAE1247807A0020F829 /* Build configuration list for PBXAggregateTarget "JPortMidiHeaders" */;
buildPhases = (
3D634CAA1247805C0020F829 /* ShellScript */,
);
dependencies = (
3D634CB0124781580020F829 /* PBXTargetDependency */,
);
name = JPortMidiHeaders;
productName = JPortMidiHeaders;
};
3DE2142D124662AA0033C839 /* CopyJavaSources */ = {
isa = PBXAggregateTarget;
buildConfigurationList = 3DE21434124662FF0033C839 /* Build configuration list for PBXAggregateTarget "CopyJavaSources" */;
buildPhases = (
3DE2142C124662AA0033C839 /* CopyFiles */,
);
comments = "The reason for copying files here is that the Compile Java target looks in a particular place for sources. It would be much better to simply have Compile Java look in the original location for all sources, but I don't know how to do that. -RBD\n";
dependencies = (
);
name = CopyJavaSources;
productName = CopyJavaSources;
};
89D0F1C90F3B704E007831A7 /* PmDefaults */ = {
isa = PBXAggregateTarget;
buildConfigurationList = 89D0F1D20F3B7080007831A7 /* Build configuration list for PBXAggregateTarget "PmDefaults" */;
buildPhases = (
);
dependencies = (
89D0F1D10F3B7062007831A7 /* PBXTargetDependency */,
89D0F1CD0F3B7062007831A7 /* PBXTargetDependency */,
3DE21431124662C50033C839 /* PBXTargetDependency */,
);
name = PmDefaults;
productName = pmdefaults;
};
/* End PBXAggregateTarget section */
/* Begin PBXBuildFile section */
3DE2137F124653FB0033C839 /* portmusic_logo.png in Resources */ = {isa = PBXBuildFile; fileRef = 3DE2137E124653FB0033C839 /* portmusic_logo.png */; };
3DE21435124663860033C839 /* PmDefaultsFrame.java in CopyFiles */ = {isa = PBXBuildFile; fileRef = 3DE2137D124653CB0033C839 /* PmDefaultsFrame.java */; };
3DE214361246638A0033C839 /* PmDefaults.java in CopyFiles */ = {isa = PBXBuildFile; fileRef = 3DE2137B1246538B0033C839 /* PmDefaults.java */; };
3DE214371246638F0033C839 /* JPortMidiException.java in CopyFiles */ = {isa = PBXBuildFile; fileRef = 3DE21382124654DE0033C839 /* JPortMidiException.java */; };
3DE214381246638F0033C839 /* JPortMidiApi.java in CopyFiles */ = {isa = PBXBuildFile; fileRef = 3DE21381124654CF0033C839 /* JPortMidiApi.java */; };
3DE214391246638F0033C839 /* JPortMidi.java in CopyFiles */ = {isa = PBXBuildFile; fileRef = 3DE21380124654BC0033C839 /* JPortMidi.java */; };
3DE216131246AC0E0033C839 /* libpmjni.dylib in Copy Java Resources */ = {isa = PBXBuildFile; fileRef = 3DE216101246ABE30033C839 /* libpmjni.dylib */; };
3DE216951246D57A0033C839 /* pmdefaults.icns in Resources */ = {isa = PBXBuildFile; fileRef = 3DE216901246C6410033C839 /* pmdefaults.icns */; };
89C3F2920F5250A300B0048E /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 89C3F2900F5250A300B0048E /* Credits.rtf */; };
89D0F0240F392F20007831A7 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 89D0F0210F392F20007831A7 /* InfoPlist.strings */; };
89D0F0410F39306C007831A7 /* JavaApplicationStub in Copy Executable */ = {isa = PBXBuildFile; fileRef = 89D0F03E0F39304A007831A7 /* JavaApplicationStub */; };
89D0F16A0F3A124E007831A7 /* pmdefaults.jar in Copy Java Resources */ = {isa = PBXBuildFile; fileRef = 89D0F15D0F3A0FF7007831A7 /* pmdefaults.jar */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
3D634CAF124781580020F829 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
proxyType = 1;
remoteGlobalIDString = 89D0F1C90F3B704E007831A7;
remoteInfo = PmDefaults;
};
3DE21430124662C50033C839 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
proxyType = 1;
remoteGlobalIDString = 3DE2142D124662AA0033C839;
remoteInfo = CopyJavaSources;
};
3DE2145D124666900033C839 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
proxyType = 1;
remoteGlobalIDString = 3DE2142D124662AA0033C839;
remoteInfo = CopyJavaSources;
};
89D0F1CC0F3B7062007831A7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
proxyType = 1;
remoteGlobalIDString = 8D1107260486CEB800E47090;
remoteInfo = "Assemble Application";
};
89D0F1D00F3B7062007831A7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
proxyType = 1;
remoteGlobalIDString = 89D0F0480F393A6F007831A7;
remoteInfo = "Compile Java";
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
3DE2142C124662AA0033C839 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "${PROJECT_DIR}/pmdefaults/src/java";
dstSubfolderSpec = 0;
files = (
3DE21435124663860033C839 /* PmDefaultsFrame.java in CopyFiles */,
3DE214361246638A0033C839 /* PmDefaults.java in CopyFiles */,
3DE214371246638F0033C839 /* JPortMidiException.java in CopyFiles */,
3DE214381246638F0033C839 /* JPortMidiApi.java in CopyFiles */,
3DE214391246638F0033C839 /* JPortMidi.java in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 0;
};
89D0F0440F393070007831A7 /* Copy Executable */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 6;
files = (
89D0F0410F39306C007831A7 /* JavaApplicationStub in Copy Executable */,
);
name = "Copy Executable";
runOnlyForDeploymentPostprocessing = 0;
};
89D0F11F0F394189007831A7 /* Copy Java Resources */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 15;
files = (
89D0F16A0F3A124E007831A7 /* pmdefaults.jar in Copy Java Resources */,
3DE216131246AC0E0033C839 /* libpmjni.dylib in Copy Java Resources */,
);
name = "Copy Java Resources";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
3DE2137B1246538B0033C839 /* PmDefaults.java */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.java; name = PmDefaults.java; path = ../pm_java/pmdefaults/PmDefaults.java; sourceTree = SOURCE_ROOT; };
3DE2137D124653CB0033C839 /* PmDefaultsFrame.java */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.java; name = PmDefaultsFrame.java; path = ../pm_java/pmdefaults/PmDefaultsFrame.java; sourceTree = SOURCE_ROOT; };
3DE2137E124653FB0033C839 /* portmusic_logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = portmusic_logo.png; path = ../pm_java/pmdefaults/portmusic_logo.png; sourceTree = SOURCE_ROOT; };
3DE21380124654BC0033C839 /* JPortMidi.java */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.java; name = JPortMidi.java; path = ../pm_java/jportmidi/JPortMidi.java; sourceTree = SOURCE_ROOT; };
3DE21381124654CF0033C839 /* JPortMidiApi.java */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.java; name = JPortMidiApi.java; path = ../pm_java/jportmidi/JPortMidiApi.java; sourceTree = SOURCE_ROOT; };
3DE21382124654DE0033C839 /* JPortMidiException.java */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.java; name = JPortMidiException.java; path = ../pm_java/jportmidi/JPortMidiException.java; sourceTree = SOURCE_ROOT; };
3DE213841246555A0033C839 /* CoreMIDI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMIDI.framework; path = /System/Library/Frameworks/CoreMIDI.framework; sourceTree = "<absolute>"; };
3DE21390124655760033C839 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = "<absolute>"; };
3DE213BE1246557F0033C839 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = /System/Library/Frameworks/CoreAudio.framework; sourceTree = "<absolute>"; };
3DE216101246ABE30033C839 /* libpmjni.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libpmjni.dylib; path = ../Release/libpmjni.dylib; sourceTree = SOURCE_ROOT; };
3DE216901246C6410033C839 /* pmdefaults.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = pmdefaults.icns; path = ../pm_java/pmdefaults/pmdefaults.icns; sourceTree = SOURCE_ROOT; };
89C3F2910F5250A300B0048E /* English */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = English; path = English.lproj/Credits.rtf; sourceTree = "<group>"; };
89D0F0220F392F20007831A7 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
89D0F0230F392F20007831A7 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
89D0F03E0F39304A007831A7 /* JavaApplicationStub */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; name = JavaApplicationStub; path = /System/Library/Frameworks/JavaVM.framework/Versions/A/Resources/MacOS/JavaApplicationStub; sourceTree = "<absolute>"; };
89D0F0840F394066007831A7 /* JavaNativeFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaNativeFoundation.framework; path = /System/Library/Frameworks/JavaVM.framework/Versions/A/Frameworks/JavaNativeFoundation.framework; sourceTree = "<absolute>"; };
89D0F1390F3948A9007831A7 /* pmdefaults/make */ = {isa = PBXFileReference; lastKnownFileType = folder; path = pmdefaults/make; sourceTree = "<group>"; };
89D0F15D0F3A0FF7007831A7 /* pmdefaults.jar */ = {isa = PBXFileReference; lastKnownFileType = archive.jar; name = pmdefaults.jar; path = build/Release/pmdefaults.jar; sourceTree = SOURCE_ROOT; };
89D0F1860F3A2442007831A7 /* JavaVM.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaVM.framework; path = /System/Library/Frameworks/JavaVM.framework; sourceTree = "<absolute>"; };
8D1107320486CEB800E47090 /* PmDefaults.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PmDefaults.app; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXGroup section */
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
isa = PBXGroup;
children = (
3DE213841246555A0033C839 /* CoreMIDI.framework */,
3DE21390124655760033C839 /* CoreFoundation.framework */,
3DE213BE1246557F0033C839 /* CoreAudio.framework */,
89D0F1860F3A2442007831A7 /* JavaVM.framework */,
89D0F0840F394066007831A7 /* JavaNativeFoundation.framework */,
);
name = "Linked Frameworks";
sourceTree = "<group>";
};
1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
isa = PBXGroup;
children = (
);
name = "Other Frameworks";
sourceTree = "<group>";
};
19C28FACFE9D520D11CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
89D0F15D0F3A0FF7007831A7 /* pmdefaults.jar */,
8D1107320486CEB800E47090 /* PmDefaults.app */,
);
name = Products;
sourceTree = "<group>";
};
29B97314FDCFA39411CA2CEA /* pmdefaults */ = {
isa = PBXGroup;
children = (
3DE216101246ABE30033C839 /* libpmjni.dylib */,
89D0F0260F392F48007831A7 /* Source */,
89D0F0200F392F20007831A7 /* Resources */,
89D0F1390F3948A9007831A7 /* pmdefaults/make */,
29B97323FDCFA39411CA2CEA /* Frameworks */,
19C28FACFE9D520D11CA2CBB /* Products */,
);
name = pmdefaults;
sourceTree = "<group>";
};
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
);
name = Frameworks;
sourceTree = "<group>";
};
3DE2136A124652E20033C839 /* pm_java */ = {
isa = PBXGroup;
children = (
3DE21379124653150033C839 /* pmdefaults */,
3DE2137A1246531D0033C839 /* jportmidi */,
);
name = pm_java;
path = ..;
sourceTree = "<group>";
};
3DE21379124653150033C839 /* pmdefaults */ = {
isa = PBXGroup;
children = (
3DE2137D124653CB0033C839 /* PmDefaultsFrame.java */,
3DE2137B1246538B0033C839 /* PmDefaults.java */,
);
name = pmdefaults;
sourceTree = "<group>";
};
3DE2137A1246531D0033C839 /* jportmidi */ = {
isa = PBXGroup;
children = (
3DE21382124654DE0033C839 /* JPortMidiException.java */,
3DE21381124654CF0033C839 /* JPortMidiApi.java */,
3DE21380124654BC0033C839 /* JPortMidi.java */,
);
name = jportmidi;
sourceTree = "<group>";
};
89D0F0200F392F20007831A7 /* Resources */ = {
isa = PBXGroup;
children = (
3DE216901246C6410033C839 /* pmdefaults.icns */,
3DE2137E124653FB0033C839 /* portmusic_logo.png */,
89C3F2900F5250A300B0048E /* Credits.rtf */,
89D0F0230F392F20007831A7 /* Info.plist */,
89D0F0210F392F20007831A7 /* InfoPlist.strings */,
89D0F03E0F39304A007831A7 /* JavaApplicationStub */,
);
name = Resources;
path = pmdefaults/resources;
sourceTree = "<group>";
};
89D0F0260F392F48007831A7 /* Source */ = {
isa = PBXGroup;
children = (
3DE2136A124652E20033C839 /* pm_java */,
);
name = Source;
path = pmdefaults/src;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXLegacyTarget section */
89D0F0480F393A6F007831A7 /* Compile Java */ = {
isa = PBXLegacyTarget;
buildArgumentsString = "-e -f \"${SRCROOT}/make/build.xml\" -debug \"$ACTION\"";
buildConfigurationList = 89D0F04B0F393AB7007831A7 /* Build configuration list for PBXLegacyTarget "Compile Java" */;
buildPhases = (
);
buildToolPath = /usr/bin/ant;
buildWorkingDirectory = "";
dependencies = (
3DE2145E124666900033C839 /* PBXTargetDependency */,
);
name = "Compile Java";
passBuildSettingsInEnvironment = 1;
productName = "Compile Java";
};
/* End PBXLegacyTarget section */
/* Begin PBXNativeTarget section */
8D1107260486CEB800E47090 /* Assemble Application */ = {
isa = PBXNativeTarget;
buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "Assemble Application" */;
buildPhases = (
89D0F0440F393070007831A7 /* Copy Executable */,
89D0F11F0F394189007831A7 /* Copy Java Resources */,
8D1107290486CEB800E47090 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = "Assemble Application";
productInstallPath = "$(HOME)/Applications";
productName = pmdefaults;
productReference = 8D1107320486CEB800E47090 /* PmDefaults.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "pm_mac" */;
compatibilityVersion = "Xcode 3.0";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
English,
Japanese,
French,
German,
);
mainGroup = 29B97314FDCFA39411CA2CEA /* pmdefaults */;
projectDirPath = "";
projectRoot = "";
targets = (
3D634CAB1247805C0020F829 /* JPortMidiHeaders */,
89D0F1C90F3B704E007831A7 /* PmDefaults */,
3DE2142D124662AA0033C839 /* CopyJavaSources */,
89D0F0480F393A6F007831A7 /* Compile Java */,
8D1107260486CEB800E47090 /* Assemble Application */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
8D1107290486CEB800E47090 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
3DE216951246D57A0033C839 /* pmdefaults.icns in Resources */,
89D0F0240F392F20007831A7 /* InfoPlist.strings in Resources */,
89C3F2920F5250A300B0048E /* Credits.rtf in Resources */,
3DE2137F124653FB0033C839 /* portmusic_logo.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
3D634CAA1247805C0020F829 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "echo BUILT_PRODUCTS_DIR is ${BUILT_PRODUCTS_DIR}\njavah -classpath \"${BUILT_PRODUCTS_DIR}/pmdefaults.jar\" -force -o \"${BUILT_PRODUCTS_DIR}/jportmidi_JportMidiApi.h\" \"jportmidi.JPortMidiApi\"\nmv \"${BUILT_PRODUCTS_DIR}/jportmidi_JportMidiApi.h\" ../pm_java/pmjni/\necho \"Created ../pm_java/pmjni/jportmidi_JportMidiApi.h\"\n";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXTargetDependency section */
3D634CB0124781580020F829 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 89D0F1C90F3B704E007831A7 /* PmDefaults */;
targetProxy = 3D634CAF124781580020F829 /* PBXContainerItemProxy */;
};
3DE21431124662C50033C839 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 3DE2142D124662AA0033C839 /* CopyJavaSources */;
targetProxy = 3DE21430124662C50033C839 /* PBXContainerItemProxy */;
};
3DE2145E124666900033C839 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 3DE2142D124662AA0033C839 /* CopyJavaSources */;
targetProxy = 3DE2145D124666900033C839 /* PBXContainerItemProxy */;
};
89D0F1CD0F3B7062007831A7 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 8D1107260486CEB800E47090 /* Assemble Application */;
targetProxy = 89D0F1CC0F3B7062007831A7 /* PBXContainerItemProxy */;
};
89D0F1D10F3B7062007831A7 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 89D0F0480F393A6F007831A7 /* Compile Java */;
targetProxy = 89D0F1D00F3B7062007831A7 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
89C3F2900F5250A300B0048E /* Credits.rtf */ = {
isa = PBXVariantGroup;
children = (
89C3F2910F5250A300B0048E /* English */,
);
name = Credits.rtf;
sourceTree = "<group>";
};
89D0F0210F392F20007831A7 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
89D0F0220F392F20007831A7 /* English */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
3D634CAC1247805C0020F829 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
PRODUCT_NAME = JPortMidiHeaders;
};
name = Debug;
};
3D634CAD1247805C0020F829 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_ENABLE_FIX_AND_CONTINUE = NO;
PRODUCT_NAME = JPortMidiHeaders;
ZERO_LINK = NO;
};
name = Release;
};
3DE2142E124662AB0033C839 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
PRODUCT_NAME = CopyJavaSources;
};
name = Debug;
};
3DE2142F124662AB0033C839 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_ENABLE_FIX_AND_CONTINUE = NO;
PRODUCT_NAME = CopyJavaSources;
ZERO_LINK = NO;
};
name = Release;
};
89D0F0490F393A6F007831A7 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
PRODUCT_NAME = pmdefaults;
SRCROOT = ./pmdefaults;
};
name = Debug;
};
89D0F04A0F393A6F007831A7 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
PRODUCT_NAME = pmdefaults;
SRCROOT = ./pmdefaults;
};
name = Release;
};
89D0F1CA0F3B704F007831A7 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
PRODUCT_NAME = pmdefaults;
};
name = Debug;
};
89D0F1CB0F3B704F007831A7 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
PRODUCT_NAME = pmdefaults;
};
name = Release;
};
C01FCF4B08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CONFIGURATION_BUILD_DIR = "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
COPY_PHASE_STRIP = NO;
INFOPLIST_FILE = pmdefaults/resources/Info.plist;
INSTALL_PATH = "$(HOME)/Applications";
PRODUCT_NAME = pmdefaults;
WRAPPER_EXTENSION = app;
};
name = Debug;
};
C01FCF4C08A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CONFIGURATION_BUILD_DIR = "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
INFOPLIST_FILE = pmdefaults/resources/Info.plist;
INSTALL_PATH = "$(HOME)/Applications";
PRODUCT_NAME = PmDefaults;
WRAPPER_EXTENSION = app;
};
name = Release;
};
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
};
name = Debug;
};
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
3D634CAE1247807A0020F829 /* Build configuration list for PBXAggregateTarget "JPortMidiHeaders" */ = {
isa = XCConfigurationList;
buildConfigurations = (
3D634CAC1247805C0020F829 /* Debug */,
3D634CAD1247805C0020F829 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
3DE21434124662FF0033C839 /* Build configuration list for PBXAggregateTarget "CopyJavaSources" */ = {
isa = XCConfigurationList;
buildConfigurations = (
3DE2142E124662AB0033C839 /* Debug */,
3DE2142F124662AB0033C839 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
89D0F04B0F393AB7007831A7 /* Build configuration list for PBXLegacyTarget "Compile Java" */ = {
isa = XCConfigurationList;
buildConfigurations = (
89D0F0490F393A6F007831A7 /* Debug */,
89D0F04A0F393A6F007831A7 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
89D0F1D20F3B7080007831A7 /* Build configuration list for PBXAggregateTarget "PmDefaults" */ = {
isa = XCConfigurationList;
buildConfigurations = (
89D0F1CA0F3B704F007831A7 /* Debug */,
89D0F1CB0F3B704F007831A7 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "Assemble Application" */ = {
isa = XCConfigurationList;
buildConfigurations = (
C01FCF4B08A954540054247B /* Debug */,
C01FCF4C08A954540054247B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
C01FCF4E08A954540054247B /* Build configuration list for PBXProject "pm_mac" */ = {
isa = XCConfigurationList;
buildConfigurations = (
C01FCF4F08A954540054247B /* Debug */,
C01FCF5008A954540054247B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
}

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:pm_mac.xcodeproj">
</FileRef>
</Workspace>

View file

@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0460"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8D1107260486CEB800E47090"
BuildableName = "PmDefaults.app"
BlueprintName = "Assemble Application"
ReferencedContainer = "container:pm_mac.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8D1107260486CEB800E47090"
BuildableName = "PmDefaults.app"
BlueprintName = "Assemble Application"
ReferencedContainer = "container:pm_mac.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8D1107260486CEB800E47090"
BuildableName = "PmDefaults.app"
BlueprintName = "Assemble Application"
ReferencedContainer = "container:pm_mac.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8D1107260486CEB800E47090"
BuildableName = "PmDefaults.app"
BlueprintName = "Assemble Application"
ReferencedContainer = "container:pm_mac.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View file

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0460"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "89D0F0480F393A6F007831A7"
BuildableName = "Compile Java"
BlueprintName = "Compile Java"
ReferencedContainer = "container:pm_mac.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View file

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0460"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3DE2142D124662AA0033C839"
BuildableName = "CopyJavaSources"
BlueprintName = "CopyJavaSources"
ReferencedContainer = "container:pm_mac.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View file

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0460"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3D634CAB1247805C0020F829"
BuildableName = "JPortMidiHeaders"
BlueprintName = "JPortMidiHeaders"
ReferencedContainer = "container:pm_mac.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View file

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0460"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "89D0F1C90F3B704E007831A7"
BuildableName = "PmDefaults"
BlueprintName = "PmDefaults"
ReferencedContainer = "container:pm_mac.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View file

@ -0,0 +1,62 @@
<?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>SchemeUserState</key>
<dict>
<key>Assemble Application.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>4</integer>
</dict>
<key>Compile Java.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>3</integer>
</dict>
<key>CopyJavaSources.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>2</integer>
</dict>
<key>JPortMidiHeaders.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
<key>PmDefaults.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>3D634CAB1247805C0020F829</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>3DE2142D124662AA0033C839</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>89D0F0480F393A6F007831A7</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>89D0F1C90F3B704E007831A7</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>8D1107260486CEB800E47090</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>

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

@ -0,0 +1,59 @@
/* pmmac.c -- PortMidi os-dependent code */
/* This file only needs to implement:
pm_init(), which calls various routines to register the
available midi devices,
Pm_GetDefaultInputDeviceID(), and
Pm_GetDefaultOutputDeviceID().
It is seperate from pmmacosxcm because we might want to register
non-CoreMIDI devices.
*/
#include "stdlib.h"
#include "portmidi.h"
#include "pmutil.h"
#include "pminternal.h"
#include "pmmacosxcm.h"
PmDeviceID pm_default_input_device_id = -1;
PmDeviceID pm_default_output_device_id = -1;
void pm_init()
{
PmError err = pm_macosxcm_init();
// this is set when we return to Pm_Initialize, but we need it
// now in order to (successfully) call Pm_CountDevices()
pm_initialized = TRUE;
if (!err) {
pm_default_input_device_id = find_default_device(
"/PortMidi/PM_RECOMMENDED_INPUT_DEVICE", TRUE,
pm_default_input_device_id);
pm_default_output_device_id = find_default_device(
"/PortMidi/PM_RECOMMENDED_OUTPUT_DEVICE", FALSE,
pm_default_output_device_id);
}
}
void pm_term(void)
{
pm_macosxcm_term();
}
PmDeviceID Pm_GetDefaultInputDeviceID()
{
Pm_Initialize();
return pm_default_input_device_id;
}
PmDeviceID Pm_GetDefaultOutputDeviceID() {
Pm_Initialize();
return pm_default_output_device_id;
}
void *pm_alloc(size_t s) { return malloc(s); }
void pm_free(void *ptr) { free(ptr); }

View file

@ -0,0 +1,4 @@
/* pmmac.h */
extern PmDeviceID pm_default_input_device_id;
extern PmDeviceID pm_default_output_device_id;

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,6 @@
/* system-specific definitions */
PmError pm_macosxcm_init(void);
void pm_macosxcm_term(void);
PmDeviceID find_default_device(char *path, int input, PmDeviceID id);

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,88 @@
/* readbinaryplist.h -- header to read preference files
Roger B. Dannenberg, Jun 2008
*/
#include <stdint.h> /* for uint8_t ... */
#ifndef TRUE
#define TRUE 1
#define FALSE 0
#endif
#define MAX_KEY_SIZE 256
enum
{
// Object tags (high nybble)
kTAG_SIMPLE = 0x00, // Null, true, false, filler, or invalid
kTAG_INT = 0x10,
kTAG_REAL = 0x20,
kTAG_DATE = 0x30,
kTAG_DATA = 0x40,
kTAG_ASCIISTRING = 0x50,
kTAG_UNICODESTRING = 0x60,
kTAG_UID = 0x80,
kTAG_ARRAY = 0xA0,
kTAG_DICTIONARY = 0xD0,
// "simple" object values
kVALUE_NULL = 0x00,
kVALUE_FALSE = 0x08,
kVALUE_TRUE = 0x09,
kVALUE_FILLER = 0x0F,
kVALUE_FULLDATETAG = 0x33 // Dates are tagged with a whole byte.
};
typedef struct pldata_struct {
uint8_t *data;
size_t len;
} pldata_node, *pldata_ptr;
typedef struct array_struct {
struct value_struct **array;
uint64_t length;
} array_node, *array_ptr;
// a dict_node is a list of <key, value> pairs
typedef struct dict_struct {
struct value_struct *key;
struct value_struct *value;
struct dict_struct *next;
} dict_node, *dict_ptr;
// an value_node is a value with a tag telling the type
typedef struct value_struct {
int tag;
union {
int64_t integer;
uint64_t uinteger;
double real;
char *string;
pldata_ptr data;
array_ptr array;
struct dict_struct *dict;
};
} value_node, *value_ptr;
value_ptr bplist_read_file(char *filename);
value_ptr bplist_read_user_pref(char *filename);
value_ptr bplist_read_system_pref(char *filename);
void bplist_free_data();
/*************** functions for accessing values ****************/
char *value_get_asciistring(value_ptr v);
value_ptr value_dict_lookup_using_string(value_ptr v, char *key);
value_ptr value_dict_lookup_using_path(value_ptr v, char *path);
/*************** functions for debugging ***************/
void plist_print(value_ptr v);

View file

@ -0,0 +1,143 @@
/* pmwin.c -- PortMidi os-dependent code */
/* This file only needs to implement:
pm_init(), which calls various routines to register the
available midi devices,
Pm_GetDefaultInputDeviceID(), and
Pm_GetDefaultOutputDeviceID().
This file must
be separate from the main portmidi.c file because it is system
dependent, and it is separate from, say, pmwinmm.c, because it
might need to register devices for winmm, directx, and others.
*/
#include "stdlib.h"
#include "portmidi.h"
#include "pmutil.h"
#include "pminternal.h"
#include "pmwinmm.h"
#ifdef DEBUG
#include "stdio.h"
#endif
#include <windows.h>
/* pm_exit is called when the program exits.
It calls pm_term to make sure PortMidi is properly closed.
If DEBUG is on, we prompt for input to avoid losing error messages.
*/
static void pm_exit(void) {
pm_term();
#ifdef DEBUG
#define STRING_MAX 80
{
char line[STRING_MAX];
printf("Type ENTER...\n");
/* note, w/o this prompting, client console application can not see one
of its errors before closing. */
fgets(line, STRING_MAX, stdin);
}
#endif
}
/* pm_init is the windows-dependent initialization.*/
void pm_init(void)
{
atexit(pm_exit);
#ifdef DEBUG
printf("registered pm_exit with atexit()\n");
#endif
pm_winmm_init();
/* initialize other APIs (DirectX?) here */
}
void pm_term(void) {
pm_winmm_term();
}
static PmDeviceID pm_get_default_device_id(int is_input, char *key) {
HKEY hkey;
#define PATTERN_MAX 256
char pattern[PATTERN_MAX];
long pattern_max = PATTERN_MAX;
DWORD dwType;
/* Find first input or device -- this is the default. */
PmDeviceID id = pmNoDevice;
int i, j;
Pm_Initialize(); /* make sure descriptors exist! */
for (i = 0; i < pm_descriptor_index; i++) {
if (descriptors[i].pub.input == is_input) {
id = i;
break;
}
}
/* Look in registry for a default device name pattern. */
if (RegOpenKeyEx(HKEY_CURRENT_USER, "Software", 0, KEY_READ, &hkey) !=
ERROR_SUCCESS) {
return id;
}
if (RegOpenKeyEx(hkey, "JavaSoft", 0, KEY_READ, &hkey) !=
ERROR_SUCCESS) {
return id;
}
if (RegOpenKeyEx(hkey, "Prefs", 0, KEY_READ, &hkey) !=
ERROR_SUCCESS) {
return id;
}
if (RegOpenKeyEx(hkey, "/Port/Midi", 0, KEY_READ, &hkey) !=
ERROR_SUCCESS) {
return id;
}
if (RegQueryValueEx(hkey, key, NULL, &dwType, pattern, &pattern_max) !=
ERROR_SUCCESS) {
return id;
}
/* decode pattern: upper case encoded with "/" prefix */
i = j = 0;
while (pattern[i]) {
if (pattern[i] == '/' && pattern[i + 1]) {
pattern[j++] = toupper(pattern[++i]);
} else {
pattern[j++] = tolower(pattern[i]);
}
i++;
}
pattern[j] = 0; /* end of string */
/* now pattern is the string from the registry; search for match */
i = pm_find_default_device(pattern, is_input);
if (i != pmNoDevice) {
id = i;
}
return id;
}
PmDeviceID Pm_GetDefaultInputDeviceID() {
return pm_get_default_device_id(TRUE,
"/P/M_/R/E/C/O/M/M/E/N/D/E/D_/I/N/P/U/T_/D/E/V/I/C/E");
}
PmDeviceID Pm_GetDefaultOutputDeviceID() {
return pm_get_default_device_id(FALSE,
"/P/M_/R/E/C/O/M/M/E/N/D/E/D_/O/U/T/P/U/T_/D/E/V/I/C/E");
}
#include "stdio.h"
void *pm_alloc(size_t s) {
return malloc(s);
}
void pm_free(void *ptr) {
free(ptr);
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,5 @@
/* midiwin32.h -- system-specific definitions */
void pm_winmm_init( void );
void pm_winmm_term( void );

View file

@ -0,0 +1,131 @@
/* ptmacosx.c -- portable timer implementation for mac os x */
#include <stdlib.h>
#include <stdio.h>
#include <CoreAudio/HostTime.h>
#import <mach/mach.h>
#import <mach/mach_error.h>
#import <mach/mach_time.h>
#import <mach/clock.h>
#include <unistd.h>
#include "porttime.h"
#include "sys/time.h"
#include "pthread.h"
#define NSEC_PER_MSEC 1000000
#define THREAD_IMPORTANCE 30
static int time_started_flag = FALSE;
static UInt64 start_time;
static pthread_t pt_thread_pid;
/* note that this is static data -- we only need one copy */
typedef struct {
int id;
int resolution;
PtCallback *callback;
void *userData;
} pt_callback_parameters;
static int pt_callback_proc_id = 0;
static void *Pt_CallbackProc(void *p)
{
pt_callback_parameters *parameters = (pt_callback_parameters *) p;
int mytime = 1;
kern_return_t error;
thread_extended_policy_data_t extendedPolicy;
thread_precedence_policy_data_t precedencePolicy;
extendedPolicy.timeshare = 0;
error = thread_policy_set(mach_thread_self(), THREAD_EXTENDED_POLICY,
(thread_policy_t)&extendedPolicy,
THREAD_EXTENDED_POLICY_COUNT);
if (error != KERN_SUCCESS) {
mach_error("Couldn't set thread timeshare policy", error);
}
precedencePolicy.importance = THREAD_IMPORTANCE;
error = thread_policy_set(mach_thread_self(), THREAD_PRECEDENCE_POLICY,
(thread_policy_t)&precedencePolicy,
THREAD_PRECEDENCE_POLICY_COUNT);
if (error != KERN_SUCCESS) {
mach_error("Couldn't set thread precedence policy", error);
}
/* to kill a process, just increment the pt_callback_proc_id */
/* printf("pt_callback_proc_id %d, id %d\n", pt_callback_proc_id, parameters->id); */
while (pt_callback_proc_id == parameters->id) {
/* wait for a multiple of resolution ms */
UInt64 wait_time;
int delay = mytime++ * parameters->resolution - Pt_Time();
PtTimestamp timestamp;
if (delay < 0) delay = 0;
wait_time = AudioConvertNanosToHostTime((UInt64)delay * NSEC_PER_MSEC);
wait_time += AudioGetCurrentHostTime();
error = mach_wait_until(wait_time);
timestamp = Pt_Time();
(*(parameters->callback))(timestamp, parameters->userData);
}
free(parameters);
return NULL;
}
PtError Pt_Start(int resolution, PtCallback *callback, void *userData)
{
if (time_started_flag) return ptAlreadyStarted;
start_time = AudioGetCurrentHostTime();
if (callback) {
int res;
pt_callback_parameters *parms;
parms = (pt_callback_parameters *) malloc(sizeof(pt_callback_parameters));
if (!parms) return ptInsufficientMemory;
parms->id = pt_callback_proc_id;
parms->resolution = resolution;
parms->callback = callback;
parms->userData = userData;
res = pthread_create(&pt_thread_pid, NULL, Pt_CallbackProc, parms);
if (res != 0) return ptHostError;
}
time_started_flag = TRUE;
return ptNoError;
}
PtError Pt_Stop()
{
/* printf("Pt_Stop called\n"); */
pt_callback_proc_id++;
pthread_join(pt_thread_pid, NULL);
time_started_flag = FALSE;
return ptNoError;
}
int Pt_Started()
{
return time_started_flag;
}
PtTimestamp Pt_Time()
{
UInt64 clock_time, nsec_time;
clock_time = AudioGetCurrentHostTime() - start_time;
nsec_time = AudioConvertHostTimeToNanos(clock_time);
return (PtTimestamp)(nsec_time / NSEC_PER_MSEC);
}
void Pt_Sleep(int32_t duration)
{
usleep(duration * 1000);
}