26extern int pm_initialized;
29void *pm_alloc(
size_t s);
30void pm_free(
void *ptr);
35extern int pm_hosterror;
38struct pm_internal_struct;
41typedef PmError (*pm_write_short_fn)(
struct pm_internal_struct *midi,
43typedef PmError (*pm_begin_sysex_fn)(
struct pm_internal_struct *midi,
45typedef PmError (*pm_end_sysex_fn)(
struct pm_internal_struct *midi,
47typedef PmError (*pm_write_byte_fn)(
struct pm_internal_struct *midi,
49typedef PmError (*pm_write_realtime_fn)(
struct pm_internal_struct *midi,
51typedef PmError (*pm_write_flush_fn)(
struct pm_internal_struct *midi,
53typedef PmTimestamp (*pm_synchronize_fn)(
struct pm_internal_struct *midi);
56typedef PmError (*pm_open_fn)(
struct pm_internal_struct *midi,
58typedef PmError (*pm_create_fn)(
int is_input,
const char *name,
61typedef PmError (*pm_abort_fn)(
struct pm_internal_struct *midi);
64typedef PmError (*pm_close_fn)(
struct pm_internal_struct *midi);
65typedef PmError (*pm_poll_fn)(
struct pm_internal_struct *midi);
66typedef unsigned int (*pm_check_host_error_fn)(
struct pm_internal_struct *midi);
69 pm_write_short_fn write_short;
70 pm_begin_sysex_fn begin_sysex;
71 pm_end_sysex_fn end_sysex;
72 pm_write_byte_fn write_byte;
73 pm_write_realtime_fn write_realtime;
74 pm_write_flush_fn write_flush;
75 pm_synchronize_fn synchronize;
80 pm_check_host_error_fn check_host_error;
82} pm_fns_node, *pm_fns_type;
86extern pm_fns_node pm_none_dictionary;
94 struct pm_internal_struct *pm_internal;
96 pm_fns_type dictionary;
97} descriptor_node, *descriptor_type;
99extern int pm_descriptor_max;
100extern descriptor_type pm_descriptors;
101extern int pm_descriptor_len;
103typedef uint32_t (*time_get_proc_type)(
void *time_info);
105typedef struct pm_internal_struct {
109 PmTimeProcPtr time_proc;
119 int sysex_in_progress;
128 int sysex_message_count;
131 int32_t channel_mask;
136 pm_fns_type dictionary;
144 unsigned char *fill_base;
145 uint32_t *fill_offset_ptr;
146 uint32_t fill_length;
156PmError none_write_byte(PmInternal *midi,
unsigned char byte,
160PmError pm_fail_fn(PmInternal *midi);
162PmError pm_success_fn(PmInternal *midi);
163PmError pm_add_interf(
char *interf, pm_create_fn create_fn,
164 pm_delete_fn delete_fn);
165PmError pm_add_device(
char *interf,
const char *name,
int is_input,
166 int is_virtual,
void *descriptor, pm_fns_type dictionary);
167void pm_undo_add_device(
int id);
168uint32_t pm_read_bytes(PmInternal *midi,
const unsigned char *data,
int len,
170void pm_read_short(PmInternal *midi,
PmEvent *event);
172#define none_write_flush pm_fail_timestamp_fn
173#define none_sysex pm_fail_timestamp_fn
174#define none_poll pm_fail_fn
175#define success_poll pm_success_fn
177#define MIDI_REALTIME_MASK 0xf8
178#define is_real_time(msg) \
179 ((Pm_MessageStatus(msg) & MIDI_REALTIME_MASK) == MIDI_REALTIME_MASK)
181int pm_find_default_device(
char *pattern,
int is_input);
#define PM_HOST_ERROR_MSG_LEN
Any host error msg has at most this many characters, including EOS.
Definition: portmidi.h:182
PmError
PortMidi error code; a common return type.
Definition: portmidi.h:100
int PmDeviceID
Devices are represented as small integers.
Definition: portmidi.h:189
int32_t PmTimestamp
Represents a millisecond clock with arbitrary start time.
Definition: portmidi.h:316
int32_t PmMessage
see PmEvent
Definition: portmidi.h:740
void PmQueue
The queue representation is opaque.
Definition: pmutil.h:21
Definition: portmidi.h:201
All midi data comes in the form of PmEvent structures.
Definition: portmidi.h:806